summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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)