From d9d4ee99ad133407a0bbc660f2414d0350b9a897 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Wed, 28 Sep 2022 22:24:33 -0600 Subject: [PATCH] include only needed catch2 headers --- tests/test.cc | 3 ++- tests/test_common.cc | 2 +- tests/test_entities.cc | 2 +- tests/test_light.cc | 3 ++- tests/test_ltface.cc | 3 --- tests/test_qbsp.cc | 41 ++++++++++++++++++++++++----------------- tests/test_vis.cc | 2 -- 7 files changed, 30 insertions(+), 26 deletions(-) diff --git a/tests/test.cc b/tests/test.cc index 09455296..f11bb3b2 100644 --- a/tests/test.cc +++ b/tests/test.cc @@ -1,4 +1,5 @@ -#include +#include +#include #include "common/settings.hh" diff --git a/tests/test_common.cc b/tests/test_common.cc index d08ea3e4..21c5c9e6 100644 --- a/tests/test_common.cc +++ b/tests/test_common.cc @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/test_entities.cc b/tests/test_entities.cc index 56fee8d5..06654ace 100644 --- a/tests/test_entities.cc +++ b/tests/test_entities.cc @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/test_light.cc b/tests/test_light.cc index f8f48f33..f85eb2a9 100644 --- a/tests/test_light.cc +++ b/tests/test_light.cc @@ -1,4 +1,5 @@ -#include +#include +#include #include #include diff --git a/tests/test_ltface.cc b/tests/test_ltface.cc index 028d6944..e69de29b 100644 --- a/tests/test_ltface.cc +++ b/tests/test_ltface.cc @@ -1,3 +0,0 @@ -#include - -#include diff --git a/tests/test_qbsp.cc b/tests/test_qbsp.cc index 5c257d15..21dfcac9 100644 --- a/tests/test_qbsp.cc +++ b/tests/test_qbsp.cc @@ -1,4 +1,6 @@ -#include +#include +#include +#include #include #include @@ -564,28 +566,33 @@ TEST_CASE("chop_no_change", "[testmaps_q1]") TEST_CASE("simple_sealed", "[testmaps_q1]") { - auto mapname = GENERATE("qbsp_simple_sealed.map", "qbsp_simple_sealed_rotated.map"); + const std::vector quake_maps{"qbsp_simple_sealed.map", "qbsp_simple_sealed_rotated.map"}; - const auto [bsp, bspx, prt] = LoadTestmapQ1(mapname); + for (const auto& mapname : quake_maps) { + DYNAMIC_SECTION("testing " << mapname) { - REQUIRE(bsp.dleafs.size() == 2); + const auto [bsp, bspx, prt] = LoadTestmapQ1(mapname); - REQUIRE(bsp.dleafs[0].contents == CONTENTS_SOLID); - REQUIRE(bsp.dleafs[1].contents == CONTENTS_EMPTY); - - // just a hollow box - REQUIRE(bsp.dfaces.size() == 6); + REQUIRE(bsp.dleafs.size() == 2); - // no bspx lumps - CHECK(bspx.empty()); + REQUIRE(bsp.dleafs[0].contents == CONTENTS_SOLID); + REQUIRE(bsp.dleafs[1].contents == CONTENTS_EMPTY); - // check markfaces - CHECK(bsp.dleafs[0].nummarksurfaces == 0); - CHECK(bsp.dleafs[0].firstmarksurface == 0); + // just a hollow box + REQUIRE(bsp.dfaces.size() == 6); - CHECK(bsp.dleafs[1].nummarksurfaces == 6); - CHECK(bsp.dleafs[1].firstmarksurface == 0); - CHECK_THAT(bsp.dleaffaces, Catch::Matchers::UnorderedEquals(std::vector{0,1,2,3,4,5})); + // no bspx lumps + CHECK(bspx.empty()); + + // check markfaces + CHECK(bsp.dleafs[0].nummarksurfaces == 0); + CHECK(bsp.dleafs[0].firstmarksurface == 0); + + CHECK(bsp.dleafs[1].nummarksurfaces == 6); + CHECK(bsp.dleafs[1].firstmarksurface == 0); + CHECK_THAT(bsp.dleaffaces, Catch::Matchers::UnorderedEquals(std::vector{0, 1, 2, 3, 4, 5})); + } + } } TEST_CASE("simple_sealed2", "[testmaps_q1]") diff --git a/tests/test_vis.cc b/tests/test_vis.cc index 85249180..e69de29b 100644 --- a/tests/test_vis.cc +++ b/tests/test_vis.cc @@ -1,2 +0,0 @@ -#include -