tests: failing test for noclipfaces choosing to use a nodraw face

which ends up defeating the point of _noclipfaces 1
This commit is contained in:
Eric Wasylishen 2024-06-01 11:53:56 -06:00
parent d090a8f476
commit e44d73a05b
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,30 @@
// Game: Quake 2
// Format: Quake2
// entity 0
{
"classname" "worldspawn"
"_tb_textures" "textures/e1u1"
// brush 0
{
( -64 -64 -32 ) ( -64 -63 -32 ) ( -64 -64 -31 ) e1u1/water1_8 0 -16 0 1 1 32 0 0
( -64 -64 -32 ) ( -64 -64 -31 ) ( -63 -64 -32 ) e1u1/water1_8 0 -16 0 1 1 32 0 0
( -64 -64 -32 ) ( -63 -64 -32 ) ( -64 -63 -32 ) e1u1/water1_8 0 0 0 1 1 32 0 0
( 64 64 0 ) ( 64 65 0 ) ( 65 64 0 ) e1u1/water1_8 0 0 0 1 1 32 0 0
( 64 64 0 ) ( 65 64 0 ) ( 64 64 1 ) e1u1/water1_8 0 -16 0 1 1 32 0 0
( 64 64 0 ) ( 64 64 1 ) ( 64 65 0 ) e1u1/water1_8 0 -16 0 1 1 32 0 0
}
}
// entity 1
{
"classname" "func_group"
"_noclipfaces" "1"
// brush 0
{
( -112 -64 0 ) ( -112 -63 0 ) ( -112 -64 1 ) e1u1/water8 0 16 0 1 1 32 152 0
( -64 -112 0 ) ( -64 -112 1 ) ( -63 -112 0 ) e1u1/water8 0 16 0 1 1 32 152 0
( -64 -64 0 ) ( -63 -64 0 ) ( -64 -63 0 ) e1u1/water8 0 0 0 1 1 32 152 0
( 64 64 32 ) ( 64 65 32 ) ( 65 64 32 ) e1u1/water8 0 0 0 1 1 32 152 0
( 64 128 32 ) ( 65 128 32 ) ( 64 128 33 ) e1u1/water8 0 16 0 1 1 32 152 0
( 176 64 32 ) ( 176 64 33 ) ( 176 65 32 ) e1u1/water8 0 16 0 1 1 32 152 0
}
}

View File

@ -1093,4 +1093,22 @@ TEST_CASE("q2_unknown_contents" * doctest::test_suite("testmaps_q2"))
CHECK(texinfo->flags.native == 1024);
}
}
TEST_CASE("q2_noclipfaces_nodraw" * doctest::test_suite("testmaps_q2") * doctest::may_fail())
{
INFO("when _noclipfaces has a choice of faces, don't use the nodraw one");
const auto [bsp, bspx, prt] = LoadTestmapQ2("q2_noclipfaces_nodraw.map");
const qvec3d top_of_water = {0, 0, 0};
auto up_faces = BSP_FindFacesAtPoint(&bsp, &bsp.dmodels[0], top_of_water, {0, 0, 1});
auto down_faces = BSP_FindFacesAtPoint(&bsp, &bsp.dmodels[0], top_of_water, {0, 0, -1});
REQUIRE(1 == up_faces.size());
REQUIRE(1 == down_faces.size());
CHECK(Face_TextureNameView(&bsp, up_faces[0]) == "e1u1/water1_8");
CHECK(Face_TextureNameView(&bsp, down_faces[0]) == "e1u1/water1_8");
}