From b77c0164e6cc0d55af15da49d355b5addf9c3f05 Mon Sep 17 00:00:00 2001 From: klehman Date: Wed, 22 Sep 2021 09:44:28 -0400 Subject: [PATCH] made mem sizes equal for compare purposes --- src/openpower/test/state.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/openpower/test/state.py b/src/openpower/test/state.py index 95f57ef8..0e4b78af 100644 --- a/src/openpower/test/state.py +++ b/src/openpower/test/state.py @@ -67,8 +67,14 @@ class State: (self.state_type, s2.state_type, repr(self.code))) def compare_mem(self, s2): - for i in self.mem: - self.dut.assertEqual(self.mem[i], s2.mem[i], + # copy dics to preserve state mem then pad empty locs + s1mem, s2mem = self.mem.copy(), s2.mem.copy() + for i in set(self.mem).difference(set(s2.mem)): + s2mem[i] = 0 + for i in set(s2.mem).difference(set(self.mem)): + s1mem[i] = 0 + for i in s1mem: + self.dut.assertEqual(s1mem[i], s2mem[i], "mem mismatch location %d %s" % (i, self.code)) -- 2.30.2