summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-08 09:52:50 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-08 09:52:50 +0200
commit832641f2905532263f70b3ea9ecc4a9ca7373ed2 (patch)
treec85af0bcec318729fe2fe295b020efe0f387d3e8 /test
parentbfe9becfca9e789bf653c4bb8e92917acac04218 (diff)
a
Diffstat (limited to 'test')
-rw-r--r--test/dijkstra.cpp3
-rw-r--r--test/path-search.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/test/dijkstra.cpp b/test/dijkstra.cpp
index 817f944a..afd2a85a 100644
--- a/test/dijkstra.cpp
+++ b/test/dijkstra.cpp
@@ -13,8 +13,9 @@ void bench_run(StringView name, F&& fun)
{
using namespace std::chrono;
using clock = high_resolution_clock;
+ for (int i = 0; i < 20; i++)
+ fun();
const auto t0 = clock::now();
- fun();
for (int i = 0; i < 1000; i++)
fun();
const auto tm = clock::now() - t0;
diff --git a/test/path-search.cpp b/test/path-search.cpp
index 20645c63..7e594b2d 100644
--- a/test/path-search.cpp
+++ b/test/path-search.cpp
@@ -13,7 +13,7 @@ namespace {
template<typename T> using bbox = path_search::bbox<T>;
using pred = path_search::pred;
-constexpr auto div = path_search::div_factor;
+constexpr auto div_factor = path_search::div_factor;
constexpr auto min_size = path_search::min_size;
constexpr bbox<int> get_value(Vector2ub sz, Vector2ub div, rotation r)
@@ -90,7 +90,7 @@ constexpr bool test_offsets2()
constexpr auto sz = Vector2ub(8, 16);
{
- constexpr auto bb = get_value(sz, Vector2ub(div), N);
+ constexpr auto bb = get_value(sz, Vector2ub(div_factor), N);
constexpr auto min = tile_start + bb.min, max = tile_start + bb.max;
static_assert(min.x() == -32 - sz.x()/2);
static_assert(max.x() == -32 + sz.x()/2);
@@ -98,7 +98,7 @@ constexpr bool test_offsets2()
static_assert(max.y() == -32 + sz.y()/2);
}
{
- constexpr auto bb = get_value(sz, Vector2ub(div), W);
+ constexpr auto bb = get_value(sz, Vector2ub(div_factor), W);
constexpr auto min = tile_start + bb.min, max = tile_start + bb.max;
static_assert(min.x() == -32 - 16 - sz.x()/2);
static_assert(max.x() == -32 + sz.x()/2);