summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-10 02:23:08 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-10 02:23:08 +0200
commitdeda6ceda5f066f1c3c7a35a7c1f68a323724c45 (patch)
tree654c0dbfb9ffbc975635d4f364ba6140c3905582 /test
parente5a5d4445567f151b069ed270700154ddc35db92 (diff)
a
Diffstat (limited to 'test')
-rw-r--r--test/dijkstra.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/test/dijkstra.cpp b/test/dijkstra.cpp
index 014817ad..8b0f531c 100644
--- a/test/dijkstra.cpp
+++ b/test/dijkstra.cpp
@@ -33,22 +33,23 @@ void test_app::test_dijkstra()
fm_assert(ch.is_passability_modified());
- auto do_bench = [&](int debug) {
- a.Dijkstra(w,
- {{0,0,0}, {11,9}}, // from
- {wpos, {wox, woy}}, // to
- 0, max_dist, {32,32}, // size
- debug);
+ auto do_bench = [&](int count, int debug) {
+ for (int i = 0; i < count; i++)
+ a.Dijkstra(w,
+ {{0,0,0}, {11,9}}, // from
+ {wpos, {wox, woy}}, // to
+ 0, max_dist, {32,32}, // size
+ debug);
};
- do_bench(0);
+ static constexpr int iters = 1;
+ if constexpr (iters > 1)
+ do_bench(1, 1);
+#if 1
bench_run("Dijkstra", [&] {
- a.Dijkstra(w,
- {{0,0,0}, {11,9}}, // from
- {wpos, {wox, woy}}, // to
- 0, max_dist, {32,32}, // size
- 1);
+ do_bench(iters, iters == 1);
});
+#endif
}
} // namespace floormat