From 9cb0d9b52c29ab22dce098f5065540a3e67ed0b0 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Mon, 8 Aug 2022 00:16:09 -0600 Subject: [PATCH] testqbsp: add test for the previously missing face in base1 --- tests/test_qbsp.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_qbsp.cc b/tests/test_qbsp.cc index 8901ee1a..9a2f93fb 100644 --- a/tests/test_qbsp.cc +++ b/tests/test_qbsp.cc @@ -1477,6 +1477,20 @@ TEST_CASE("base1", "[testmaps_q2][.releaseonly]") CHECK(3 == bsp.dareaportals.size()); CHECK(3 == bsp.dareas.size()); + + // check for a sliver face which we had issues with being missing + { + const qvec3d face_point {-315.975, -208.036, -84.5}; + const qvec3d normal_point {-315.851, -208.051, -84.5072}; // obtained in TB + + const qvec3d normal = qv::normalize(normal_point - face_point); + + auto *sliver_face = BSP_FindFaceAtPoint(&bsp, &bsp.dmodels[0], face_point, normal); + REQUIRE(nullptr != sliver_face); + + CHECK(std::string_view("e1u1/metal3_5") == Face_TextureName(&bsp, sliver_face)); + CHECK(Face_Winding(&bsp, sliver_face).area() < 5.0); + } } TEST_CASE("quake maps", "[testmaps_q1][.releaseonly]")