MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / TEST_F

Function TEST_F

tests/src/Mod/Sketcher/App/Constraint.cpp:47–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45};
46
47TEST_F(ConstraintPointsAccess, testDefaultGeoElementIdsAreSane) // NOLINT
48{
49 // Arrange
50 auto constraint = Sketcher::Constraint();
51
52 // Act - no action needed, we are testing the default state
53
54 // Assert
55#if SKETCHER_CONSTRAINT_USE_LEGACY_ELEMENTS
56 // Old way of accessing elements
57 EXPECT_EQ(constraint.First, Sketcher::GeoEnum::GeoUndef);
58 EXPECT_EQ(constraint.FirstPos, Sketcher::PointPos::none);
59
60 EXPECT_EQ(constraint.Second, Sketcher::GeoEnum::GeoUndef);
61 EXPECT_EQ(constraint.SecondPos, Sketcher::PointPos::none);
62
63 EXPECT_EQ(constraint.Third, Sketcher::GeoEnum::GeoUndef);
64 EXPECT_EQ(constraint.ThirdPos, Sketcher::PointPos::none);
65
66 // New way of accessing elements
67#endif
68 EXPECT_EQ(
69 constraint.getElement(0),
70 Sketcher::GeoElementId(Sketcher::GeoEnum::GeoUndef, Sketcher::PointPos::none)
71 );
72 EXPECT_EQ(
73 constraint.getElement(1),
74 Sketcher::GeoElementId(Sketcher::GeoEnum::GeoUndef, Sketcher::PointPos::none)
75 );
76 EXPECT_EQ(
77 constraint.getElement(2),
78 Sketcher::GeoElementId(Sketcher::GeoEnum::GeoUndef, Sketcher::PointPos::none)
79 );
80}
81
82#if SKETCHER_CONSTRAINT_USE_LEGACY_ELEMENTS
83TEST_F(ConstraintPointsAccess, testOldWriteIsReadByNew) // NOLINT

Callers

nothing calls this directly

Calls 15

getElementsSizeMethod · 0.80
toStdStringMethod · 0.80
substituteIndexMethod · 0.80
substituteIndexAndPosMethod · 0.80
involvesGeoIdMethod · 0.80
involvesGeoIdAndPosIdMethod · 0.80
ConstraintFunction · 0.50
formatFunction · 0.50
getElementMethod · 0.45
setElementMethod · 0.45
addElementMethod · 0.45
SaveMethod · 0.45

Tested by

no test coverage detected