MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / test_collision

Function test_collision

tests/test_tilemap.cpp:42–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40};
41
42static void test_collision(const TileMap &map, Vec3<float> line_start, Vec3<float> line_end,
43 sp<TileObject> expected_collision)
44{
45 auto collision = map.findCollision(line_start, line_end);
46 if (collision.obj != expected_collision)
47 {
48 LogError("Line between {%f,%f,%f} and {%f,%f,%f} collided with %s, expected %s",
49 line_start.x, line_start.y, line_start.z, line_end.x, line_end.y, line_end.z,
50 collision.obj ? collision.obj->getName() : "NONE",
51 expected_collision ? expected_collision->getName() : "NONE");
52 exit(EXIT_FAILURE);
53 }
54}
55
56int main(int argc, char **argv)
57{

Callers 1

mainFunction · 0.85

Calls 2

findCollisionMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected