From c20374ef3fc39674718eea1daa6fdc6cb346d984 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 10 May 2021 18:00:47 +0100 Subject: [PATCH] test_maxint, add zero onto 0xffffffffffffff --- src/openpower/decoder/selectable_int.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openpower/decoder/selectable_int.py b/src/openpower/decoder/selectable_int.py index 2afe50e6..1481f289 100644 --- a/src/openpower/decoder/selectable_int.py +++ b/src/openpower/decoder/selectable_int.py @@ -555,6 +555,12 @@ class SelectableIntTestCase(unittest.TestCase): self.assertTrue(a != b) self.assertFalse(a == b) + def test_maxint(self): + a = SelectableInt(0xffffffffffffffff, bits=64) + b = SelectableInt(0, bits=64) + result = a + b + self.assertTrue(result.value == 0xffffffffffffffff) + if __name__ == "__main__": unittest.main() -- 2.30.2