summaryrefslogtreecommitdiff
path: root/tests/format
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-08-14 19:09:26 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-08-14 19:09:26 (GMT)
commit2c97b766469c25b09c3b173aa6b8abdb066671c1 (patch)
tree67988f6f796fe16a4f976c8d9702ea03969cc9cf /tests/format
parent7cb4e815b691d05d8c0aea9decf56b9dbc41dfa6 (diff)
Fixed a copy/paste bug.
Diffstat (limited to 'tests/format')
-rw-r--r--tests/format/symbol.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/format/symbol.py b/tests/format/symbol.py
index c720256..5d6be45 100644
--- a/tests/format/symbol.py
+++ b/tests/format/symbol.py
@@ -24,3 +24,27 @@ class TestBinarySymbols(ChrysalideTestCase):
self.assertEqual(symbol.status, BinSymbol.SymbolStatus.INTERNAL)
self.assertEqual(str(symbol.status), 'SymbolStatus.INTERNAL')
+
+
+ def testSymbolComparison(self):
+ """Compare symbols and check the result."""
+
+ saddr = vmpa(0x100, vmpa.VMPA_NO_VIRTUAL)
+ srange = mrange(saddr, 0x3)
+ symbol0 = BinSymbol(BinSymbol.STP_ENTRY_POINT, srange)
+
+ saddr = vmpa(0x10, vmpa.VMPA_NO_VIRTUAL)
+ srange = mrange(saddr, 0x3)
+ symbol1 = BinSymbol(BinSymbol.STP_ENTRY_POINT, srange)
+
+ saddr = vmpa(0x100, vmpa.VMPA_NO_VIRTUAL)
+ srange = mrange(saddr, 0x30)
+ symbol2 = BinSymbol(BinSymbol.STP_ENTRY_POINT, srange)
+
+ self.assertTrue(symbol0 == symbol0)
+
+ self.assertTrue(symbol0 > symbol1)
+
+ self.assertTrue(symbol1 < symbol2)
+
+ self.assertTrue(symbol0 == symbol2)