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

Function TEST_F

tests/src/Mod/Part/App/TopoShapeMakeShapeWithElementMap.cpp:65–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63};
64
65TEST_F(TopoShapeMakeShapeWithElementMapTests, nullShapeThrows)
66{
67 // Arrange
68 auto [cube1, cube2] = PartTestHelpers::CreateTwoCubes();
69 std::vector<Part::TopoShape> sources {cube1, cube2};
70 TopoDS_Vertex nullVertex;
71 TopoDS_Edge nullEdge;
72 TopoDS_Wire nullWire;
73 TopoDS_Face nullFace;
74 TopoDS_Shell nullShell;
75 TopoDS_Solid nullSolid;
76 TopoDS_CompSolid nullCompSolid;
77 TopoDS_Compound nullCompound;
78
79 // Act and assert
80 EXPECT_THROW(
81 Shape()->makeShapeWithElementMap(nullVertex, *Mapper(), sources),
82 Part::NullShapeException
83 );
84 EXPECT_THROW(
85 Shape()->makeShapeWithElementMap(nullEdge, *Mapper(), sources),
86 Part::NullShapeException
87 );
88 EXPECT_THROW(
89 Shape()->makeShapeWithElementMap(nullWire, *Mapper(), sources),
90 Part::NullShapeException
91 );
92 EXPECT_THROW(
93 Shape()->makeShapeWithElementMap(nullFace, *Mapper(), sources),
94 Part::NullShapeException
95 );
96 EXPECT_THROW(
97 Shape()->makeShapeWithElementMap(nullShell, *Mapper(), sources),
98 Part::NullShapeException
99 );
100 EXPECT_THROW(
101 Shape()->makeShapeWithElementMap(nullSolid, *Mapper(), sources),
102 Part::NullShapeException
103 );
104 EXPECT_THROW(
105 Shape()->makeShapeWithElementMap(nullCompSolid, *Mapper(), sources),
106 Part::NullShapeException
107 );
108 EXPECT_THROW(
109 Shape()->makeShapeWithElementMap(nullCompound, *Mapper(), sources),
110 Part::NullShapeException
111 );
112}
113
114std::map<IndexedName, MappedName> elementMap(const TopoShape& shape)
115{

Callers

nothing calls this directly

Calls 13

CreateTwoCubesFunction · 0.85
CreateTwoTopoShapeCubesFunction · 0.85
canMapElementMethod · 0.80
elementMapFunction · 0.70
ShapeClass · 0.50
IndexedNameClass · 0.50
getShapeMethod · 0.45
sizeMethod · 0.45
countMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected