summaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-01-08 07:45:45 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-01-08 07:45:45 (GMT)
commit8f77fd4f0a73a92087b185af0b45d70607268107 (patch)
tree992c04083257689078f34ed228f0b89d6e0fcd24 /tests/common
parentefde18ba4a4ec26d06682ac1b15d63f818f7ccfe (diff)
Fixed a bug in bitfield comparison.
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/bitfield.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/common/bitfield.py b/tests/common/bitfield.py
index cb82580..717181c 100644
--- a/tests/common/bitfield.py
+++ b/tests/common/bitfield.py
@@ -132,3 +132,15 @@ class TestBitfields(ChrysalideTestCase):
self.assertEqual(bf.size, 65)
self.assertEqual(bf.popcount, 65)
+
+
+ def testBitfieldComparison(self):
+ """Check bitfield comparison."""
+
+ bf_a = bitfield(9, 0)
+ bf_a.set(0, 1)
+ bf_a.set(5, 1)
+
+ bf_b = bitfield(9, 1)
+
+ self.assertNotEqual(bf_a, bf_b)