Make the tests go faster.
This commit is contained in:
parent
6d7a944a7d
commit
738d9a64d3
7 changed files with 6 additions and 222 deletions
|
|
@ -38,7 +38,7 @@ TEST_CASE("multiple targets can path", "[pathing]") {
|
|||
while(found == PathingResult::CONTINUE) {
|
||||
// fmt::println("\033[2J\033[1;1H");
|
||||
// matrix::dump(diag ? "diag" : "simple", paths.$paths, pos.x, pos.y);
|
||||
std::this_thread::sleep_for(200ms);
|
||||
// std::this_thread::sleep_for(200ms);
|
||||
found = paths.find_path(pos, PATHING_TOWARD, diag);
|
||||
}
|
||||
|
||||
|
|
@ -51,27 +51,3 @@ TEST_CASE("multiple targets can path", "[pathing]") {
|
|||
REQUIRE(found != PathingResult::FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("dijkstra algo test", "[pathing-old]") {
|
||||
json data = load_test_pathing("./tests/dijkstra.json");
|
||||
|
||||
for(auto &test : data) {
|
||||
Matrix expected = test["expected"];
|
||||
Matrix walls = test["walls"];
|
||||
|
||||
Pathing pathing(walls[0].size(), walls.size());
|
||||
|
||||
pathing.$input = test["input"];
|
||||
|
||||
REQUIRE(pathing.INVARIANT());
|
||||
int longest = pathing.compute_paths(walls);
|
||||
REQUIRE(longest > 0);
|
||||
REQUIRE(longest < WALL_PATH_LIMIT);
|
||||
|
||||
REQUIRE(pathing.INVARIANT());
|
||||
|
||||
matrix::dump("PATHING RESULT", pathing.$paths);
|
||||
matrix::dump("PATHING EXPECTED", expected);
|
||||
REQUIRE(pathing.$paths == expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue