Clean code and testing tweak

This commit is contained in:
bgbsww
2024-02-07 11:43:40 -05:00
parent d72896c28d
commit b2cbd7e5a7
4 changed files with 44 additions and 17 deletions

View File

@@ -28,6 +28,6 @@ protected:
Part::Boolean* _boolean; // NOLINT Can't be private in a test framework
};
// This is completely tested in the FeaturePartCommon, FeaturePartCut, and FeaturePartFuse
// subclasses. This class is unfortunately not usable unless initialized in one of those
// forms, so no testing at this level.
// This is completely tested in the FeaturePartCommon, FeaturePartCut, FeaturePartFuse and
// FeaturePartSection subclasses. This class is unfortunately not usable unless initialized in one
// of those forms, so no testing at this level.

View File

@@ -199,3 +199,19 @@ TEST_F(FeaturePartCommonTest, testHistory)
EXPECT_EQ(hist[0].shapeMap, compare2);
EXPECT_EQ(hist[1].shapeMap, compare1);
}
TEST_F(FeaturePartCommonTest, testMapping)
{
// Arrange
_boxes[0]->Shape.getShape().Tag = 1L;
_boxes[1]->Shape.getShape().Tag = 2L;
_common->Base.setValue(_boxes[0]);
_common->Tool.setValue(_boxes[1]);
Part::TopoShape ts1 = _common->Shape.getShape();
#ifndef FC_USE_TNP_FIX
EXPECT_EQ(ts1.getElementMap().size(), 0);
#else
EXPECT_EQ(ts1.getElementMap().size(), 26); // Value and code TBD
#endif
}