Skip to content

Commit

Permalink
✅ Adjusted tests in accordance with the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelwa committed Jul 24, 2023
1 parent 3866c78 commit fefa907
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions test/algorithms/path_finding/distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ TEST_CASE("2DDWave distance", "[distance]")
CHECK(twoddwave_distance<cart_lyt>(layout, {0, 0}, {1, 1}) == 2);
CHECK(twoddwave_distance<cart_lyt>(layout, {1, 2}, {3, 3}) == 3);
CHECK(twoddwave_distance<cart_lyt>(layout, {0, 0}, {4, 4}) == 8);
CHECK(twoddwave_distance<cart_lyt>(layout, {4, 4}, {0, 0}) == std::numeric_limits<uint64_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {2, 1}, {0, 2}) == std::numeric_limits<uint64_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {1, 0}, {0, 1}) == std::numeric_limits<uint64_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {4, 4}, {0, 0}) == std::numeric_limits<uint32_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {2, 1}, {0, 2}) == std::numeric_limits<uint32_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {1, 0}, {0, 1}) == std::numeric_limits<uint32_t>::max());

// ignore z-axis
CHECK(twoddwave_distance<cart_lyt>(layout, {0, 0, 1}, {8, 9, 0}) == 17);
Expand All @@ -247,18 +247,18 @@ TEST_CASE("2DDWave distance", "[distance]")
CHECK(twoddwave_distance<cart_lyt>(layout, {0, 0}, {1, 1}) == 2);
CHECK(twoddwave_distance<cart_lyt>(layout, {1, 2}, {3, 3}) == 3);
CHECK(twoddwave_distance<cart_lyt>(layout, {0, 0}, {4, 4}) == 8);
CHECK(twoddwave_distance<cart_lyt>(layout, {4, 4}, {0, 0}) == std::numeric_limits<uint64_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {2, 1}, {0, 2}) == std::numeric_limits<uint64_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {1, 0}, {0, 1}) == std::numeric_limits<uint64_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {4, 4}, {0, 0}) == std::numeric_limits<uint32_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {2, 1}, {0, 2}) == std::numeric_limits<uint32_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {1, 0}, {0, 1}) == std::numeric_limits<uint32_t>::max());

// ignore z-axis
CHECK(twoddwave_distance<cart_lyt>(layout, {0, 0, 1}, {8, 9, 0}) == 17);
CHECK(twoddwave_distance<cart_lyt>(layout, {0, 0, 1}, {8, 9, 1}) == 17);

// negative coordinates
CHECK(twoddwave_distance<cart_lyt>(layout, {0, 0}, {-1, -1}) == std::numeric_limits<uint64_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {-2, -8}, {-6, -4}) == std::numeric_limits<uint64_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {-6, -4}, {-2, -8}) == std::numeric_limits<uint64_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {0, 0}, {-1, -1}) == std::numeric_limits<uint32_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {-2, -8}, {-6, -4}) == std::numeric_limits<uint32_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {-6, -4}, {-2, -8}) == std::numeric_limits<uint32_t>::max());
CHECK(twoddwave_distance<cart_lyt>(layout, {-4, -3}, {1, -1}) == 7);
}
}
Expand All @@ -279,7 +279,7 @@ TEST_CASE("2DDWave distance functor", "[distance]")
CHECK(distance(layout, {0, 0}, {1, 1}) == 2);
CHECK(distance(layout, {1, 2}, {3, 3}) == 3);
CHECK(distance(layout, {0, 0}, {4, 4}) == 8);
CHECK(distance(layout, {4, 4}, {0, 0}) == std::numeric_limits<uint64_t>::max());
CHECK(distance(layout, {4, 4}, {0, 0}) == std::numeric_limits<uint32_t>::max());

// ignore z-axis
CHECK(distance(layout, {0, 0, 1}, {8, 9, 0}) == 17);
Expand All @@ -299,16 +299,16 @@ TEST_CASE("2DDWave distance functor", "[distance]")
CHECK(distance(layout, {0, 0}, {1, 1}) == 2);
CHECK(distance(layout, {1, 2}, {3, 3}) == 3);
CHECK(distance(layout, {0, 0}, {4, 4}) == 8);
CHECK(distance(layout, {4, 4}, {0, 0}) == std::numeric_limits<uint64_t>::max());
CHECK(distance(layout, {4, 4}, {0, 0}) == std::numeric_limits<uint32_t>::max());

// ignore z-axis
CHECK(distance(layout, {0, 0, 1}, {8, 9, 0}) == 17);
CHECK(distance(layout, {0, 0, 1}, {8, 9, 1}) == 17);

// negative coordinates
CHECK(distance(layout, {0, 0}, {-1, -1}) == std::numeric_limits<uint64_t>::max());
CHECK(distance(layout, {-2, -8}, {-6, -4}) == std::numeric_limits<uint64_t>::max());
CHECK(distance(layout, {-6, -4}, {-2, -8}) == std::numeric_limits<uint64_t>::max());
CHECK(distance(layout, {0, 0}, {-1, -1}) == std::numeric_limits<uint32_t>::max());
CHECK(distance(layout, {-2, -8}, {-6, -4}) == std::numeric_limits<uint32_t>::max());
CHECK(distance(layout, {-6, -4}, {-2, -8}) == std::numeric_limits<uint32_t>::max());
CHECK(distance(layout, {-4, -3}, {1, -1}) == 7);
}
}
Expand Down

0 comments on commit fefa907

Please sign in to comment.