Skip to content

Commit

Permalink
store terms in deterministic set inside test
Browse files Browse the repository at this point in the history
  • Loading branch information
xtofalex committed Oct 30, 2024
1 parent f254cae commit b3adc78
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/snl/snl/kernel/SNLEquipotentialTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ TEST_F(SNLEquipotentialTest, test) {
auto cpio = SNLInstTermOccurrence(cPath, cpi);

SNLEquipotential equipotentialTopI0(topi0);
std::set<SNLBitTerm*> terms;
using Terms = std::set<SNLBitTerm*, SNLDesignObject::PointerLess>;
Terms terms;
terms.insert(topi0);
terms.insert(topi1);
terms.insert(topout);
Expand All @@ -83,17 +84,14 @@ TEST_F(SNLEquipotentialTest, test) {
instTermOccurrences.insert(cpio);
EXPECT_EQ(equipotentialTopI0.getTerms(), naja::NajaCollection(new naja::NajaSTLCollection(&terms)));
EXPECT_EQ(equipotentialTopI0.getInstTermOccurrences(), naja::NajaCollection(new naja::NajaSTLCollection(&instTermOccurrences)));
{ auto print = equipotentialTopI0.getString(); }

SNLEquipotential equipotentialTopI1(topi1);
EXPECT_EQ(equipotentialTopI1.getTerms(), naja::NajaCollection(new naja::NajaSTLCollection(&terms)));
EXPECT_EQ(equipotentialTopI1.getInstTermOccurrences(), naja::NajaCollection(new naja::NajaSTLCollection(&instTermOccurrences)));
{ auto print = equipotentialTopI1.getString(); }

SNLEquipotential equipotentialTopOut(topout);
EXPECT_EQ(equipotentialTopOut.getTerms(), naja::NajaCollection(new naja::NajaSTLCollection(&terms)));
EXPECT_EQ(equipotentialTopOut.getInstTermOccurrences(), naja::NajaCollection(new naja::NajaSTLCollection(&instTermOccurrences)));
{ auto print = equipotentialTopOut.getString(); }

std::set<SNLInstTermOccurrence> instTermOccurrences1;
instTermOccurrences.insert(aapio);
Expand All @@ -106,8 +104,6 @@ TEST_F(SNLEquipotentialTest, test) {
EXPECT_EQ(equipotentialTopOut.getInstTermOccurrences() == naja::NajaCollection(new naja::NajaSTLCollection(&instTermOccurrences1)), false);
EXPECT_EQ(equipotentialTopOut.getInstTermOccurrences() == naja::NajaCollection(new naja::NajaSTLCollection(&instTermOccurrences2)), false);



//Test compaerators
EXPECT_EQ(equipotentialTopI0 == equipotentialTopI1, true);
EXPECT_EQ(equipotentialTopI0 == equipotentialTopOut, true);
Expand All @@ -125,4 +121,4 @@ TEST_F(SNLEquipotentialTest, test) {
EXPECT_EQ(equipotentialTopI0 > equipotentialTopOut, false);
EXPECT_EQ(equipotentialTopI1 > equipotentialTopOut, false);
EXPECT_EQ(equipotentialTopI0 != equipotentialTopI1, false);
}
}

0 comments on commit b3adc78

Please sign in to comment.