From fef5265f597926485e56c4ddee79fb88619462bd Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 4 Dec 2022 15:14:26 +0100 Subject: test/lqt: use --- test/LooseQuadtreeTest.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'test/LooseQuadtreeTest.cpp') diff --git a/test/LooseQuadtreeTest.cpp b/test/LooseQuadtreeTest.cpp index 3e19891b..615ab695 100644 --- a/test/LooseQuadtreeTest.cpp +++ b/test/LooseQuadtreeTest.cpp @@ -12,6 +12,7 @@ #include "test/app.hpp" #include +#include #include #include #include @@ -700,7 +701,7 @@ void StressTest() { template void RunTests(const char* type_str) { - printf("quadtree test %s (%zu-bit)... ", type_str, sizeof(NumberT) * 8); + printf("quadtree test %13s", type_str); fflush(stdout); auto start = std::chrono::high_resolution_clock::now(); TestBoundingBox(); @@ -709,8 +710,8 @@ void RunTests(const char* type_str) { TestQueries(); StressTest(); auto end = std::chrono::high_resolution_clock::now(); - std::chrono::duration time = end - start; - printf("took %f seconds\n", time.count()); + std::chrono::duration time = end - start; + printf(": %.1f ms\n", time.count()); fflush(stdout); } @@ -718,21 +719,19 @@ void RunTests(const char* type_str) { namespace floormat { +#define RUN_TEST(x) RunTests(#x) + void test_app::test_quadtree() { - puts("***** Testing is about to start *****"); - printf("***** This system is %zu-bit\n", sizeof(void*) * 8); - RunTests("float"); - RunTests("double"); - RunTests("long double"); - RunTests("int"); - RunTests("long"); - RunTests("short"); - RunTests("unsigned int"); - RunTests("unsigned long"); - RunTests("unsigned short"); - RunTests("long long"); - puts("***** Testing is successfully finished *****"); + RUN_TEST(float); + RUN_TEST(double); + RUN_TEST(long double); + RUN_TEST(std::int16_t); + RUN_TEST(std::int32_t); + RUN_TEST(std::int64_t); + RUN_TEST(std::uint16_t); + RUN_TEST(std::uint32_t); + RUN_TEST(std::uint64_t); } } // namespace floormat -- cgit v1.2.3