| 8 | { |
| 9 | |
| 10 | TEST(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 |
nothing calls this directly
no test coverage detected