From a93eff23bca6626bcbf6d1bc51108f689f829691 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Thu, 5 May 2022 01:29:52 -0600 Subject: [PATCH] testqbsp: expand base1leak test --- qbsp/test_qbsp.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qbsp/test_qbsp.cc b/qbsp/test_qbsp.cc index fa5473de..4b8d4874 100644 --- a/qbsp/test_qbsp.cc +++ b/qbsp/test_qbsp.cc @@ -945,6 +945,17 @@ TEST(testmaps_q2, base1leak) EXPECT_FALSE(map.leakfile); EXPECT_EQ(GAME_QUAKE_II, bsp.loadversion->game->id); + + EXPECT_EQ(8, map.brushes.size()); + EXPECT_EQ(8, bsp.dbrushes.size()); + + EXPECT_EQ(8, bsp.dleafs.size()); // 1 placeholder + 1 empty (room interior) + 6 solid (sides of room) + + const qvec3d in_plus_y_wall{-776, 976, -24}; + auto *plus_y_wall_leaf = BSP_FindLeafAtPoint(&bsp, &bsp.dmodels[0], in_plus_y_wall); + EXPECT_EQ(Q2_CONTENTS_SOLID, plus_y_wall_leaf->contents); + + EXPECT_EQ(3, plus_y_wall_leaf->numleafbrushes); } TEST(benchmark, winding) {