From e9cc5271c6837841b4b252d07be8d816ea311946 Mon Sep 17 00:00:00 2001 From: Noam Cohen Date: Tue, 5 Nov 2024 10:03:19 +0100 Subject: [PATCH] coverage + restore comprators --- src/snl/snl/kernel/SNLPath.cpp | 4 ++-- test/snl/python/snl_wrapping/test_snloccurrence.py | 2 ++ test/snl/snl/kernel/SNLPathTest2.cpp | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/snl/snl/kernel/SNLPath.cpp b/src/snl/snl/kernel/SNLPath.cpp index 06217d8f..5051eb27 100644 --- a/src/snl/snl/kernel/SNLPath.cpp +++ b/src/snl/snl/kernel/SNLPath.cpp @@ -134,11 +134,11 @@ SNLDesign* SNLPath::getModel() const { } bool SNLPath::operator==(const SNLPath& path) const { - return !(*this < path or path < *this); + return *sharedPath_ == *path.sharedPath_; } bool SNLPath::operator!=(const SNLPath& path) const { - return not (*this == path); + return *sharedPath_ != *path.sharedPath_; } bool SNLPath::operator<(const SNLPath& path) const { diff --git a/test/snl/python/snl_wrapping/test_snloccurrence.py b/test/snl/python/snl_wrapping/test_snloccurrence.py index cdc5fb11..041a7038 100644 --- a/test/snl/python/snl_wrapping/test_snloccurrence.py +++ b/test/snl/python/snl_wrapping/test_snloccurrence.py @@ -60,6 +60,8 @@ def testFunctions(self): insttermoccurrence = snl.SNLInstTermOccurrence() insttermoccurrence1 = snl.SNLInstTermOccurrence(path0, instTerms[0]) insttermoccurrence2 = snl.SNLInstTermOccurrence(instTerms[0]) + + instTerm = insttermoccurrence1.getInstTerm() uniq = snl.SNLUniquifier(insttermoccurrence1.getPath()) uniqPath = uniq.getPathUniqCollection() diff --git a/test/snl/snl/kernel/SNLPathTest2.cpp b/test/snl/snl/kernel/SNLPathTest2.cpp index b92685f7..494a3387 100644 --- a/test/snl/snl/kernel/SNLPathTest2.cpp +++ b/test/snl/snl/kernel/SNLPathTest2.cpp @@ -82,6 +82,8 @@ TEST_F(SNLPathTest2, testCompare) { EXPECT_EQ(uniquifier0 > uniquifier1, false); EXPECT_EQ(uniquifier0 <= uniquifier1, true); EXPECT_EQ(uniquifier0 >= uniquifier1, false); + + EXPECT_NE(uniquifier0.getString(), uniquifier1.getString()); } TEST_F(SNLPathTest2, testDestroy0) {