MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / TEST

Function TEST

source/MRTest/MREdgePathsTests.cpp:10–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8{
9
10TEST(MRMesh, BuildShortestPath)
11{
12 Mesh cube = makeCube();
13 auto path = buildShortestPath( cube, 0_v, 6_v );
14 EXPECT_EQ( path.size(), 2 );
15 EXPECT_EQ( cube.topology.org( path[0] ), 0_v );
16 EXPECT_EQ( cube.topology.dest( path[0] ), cube.topology.org( path[1] ) );
17 EXPECT_EQ( cube.topology.dest( path[1] ), 6_v );
18
19 auto path34 = buildShortestPath( cube, 3_v, 4_v );
20 EXPECT_EQ( path34.size(), 2 );
21
22 std::vector<EdgePath> paths{ path, path34 };
23 auto euclid = edgeLengthMetric( cube );
24 EXPECT_GT( calcPathMetric( paths[0], euclid ), calcPathMetric( paths[1], euclid ) );
25 sortPathsByMetric( paths, euclid );
26 EXPECT_LE( calcPathMetric( paths[0], euclid ), calcPathMetric( paths[1], euclid ) );
27}
28
29} //namespace MR

Callers

nothing calls this directly

Calls 8

makeCubeFunction · 0.85
buildShortestPathFunction · 0.85
edgeLengthMetricFunction · 0.85
calcPathMetricFunction · 0.85
sortPathsByMetricFunction · 0.85
sizeMethod · 0.45
orgMethod · 0.45
destMethod · 0.45

Tested by

no test coverage detected