From 07f5f22461d5eda844141b2ffd33e021d2b43ffb Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 29 Aug 2022 00:27:12 -0700 Subject: [PATCH] allow tests to pass None in order to not have to match so, ca, and ov --- src/openpower/test/state.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/openpower/test/state.py b/src/openpower/test/state.py index c20e75d3..d7b5920c 100644 --- a/src/openpower/test/state.py +++ b/src/openpower/test/state.py @@ -116,12 +116,15 @@ class State: crreg, crreg2)) # XER - self.dut.assertEqual(self.so, s2.so, "so mismatch (%s != %s) %s" % - (self.state_type, s2.state_type, repr(self.code))) - self.dut.assertEqual(self.ov, s2.ov, "ov mismatch (%s != %s) %s" % - (self.state_type, s2.state_type, repr(self.code))) - self.dut.assertEqual(self.ca, s2.ca, "ca mismatch (%s != %s) %s" % - (self.state_type, s2.state_type, repr(self.code))) + if self.so is not None and s2.so is not None: + self.dut.assertEqual(self.so, s2.so, "so mismatch (%s != %s) %s" % + (self.state_type, s2.state_type, repr(self.code))) + if self.ov is not None and s2.ov is not None: + self.dut.assertEqual(self.ov, s2.ov, "ov mismatch (%s != %s) %s" % + (self.state_type, s2.state_type, repr(self.code))) + if self.ca is not None and s2.ca is not None: + self.dut.assertEqual(self.ca, s2.ca, "ca mismatch (%s != %s) %s" % + (self.state_type, s2.state_type, repr(self.code))) # pc self.dut.assertEqual(self.pc, s2.pc, "pc mismatch (%s != %s) %s" % -- 2.30.2