Skip to content

Commit

Permalink
fix test names to comply with gtest rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwa committed Jun 24, 2024
1 parent daffd2c commit baaaff9
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 149 deletions.
60 changes: 30 additions & 30 deletions tests/test_light.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ TEST(polylib, ClosestPointOnPolyBoundary)
EXPECT_EQ(std::make_pair(0, qvec3f(0, 0, 0)), ClosestPointOnPolyBoundary(poly, qvec3f(-1, -1, 0)));
}

TEST(polylib, PolygonCentroid_empty)
TEST(polylib, PolygonCentroidEmpty)
{
const std::initializer_list<qvec3d> empty{};
const qvec3f res = qv::PolyCentroid(empty.begin(), empty.end());
Expand All @@ -168,13 +168,13 @@ TEST(polylib, PolygonCentroid_empty)
}
}

TEST(polylib, PolygonCentroid_point)
TEST(polylib, PolygonCentroidPoint)
{
const std::initializer_list<qvec3d> point{{1, 1, 1}};
EXPECT_EQ(*point.begin(), qv::PolyCentroid(point.begin(), point.end()));
}

TEST(polylib, PolygonCentroid_line)
TEST(polylib, PolygonCentroidLine)
{
const std::initializer_list<qvec3d> line{{0, 0, 0}, {2, 2, 2}};
EXPECT_EQ(qvec3d(1, 1, 1), qv::PolyCentroid(line.begin(), line.end()));
Expand Down Expand Up @@ -447,15 +447,15 @@ TEST(mathlib, ConcavityTestCoplanar)

static const float MANGLE_EPSILON = 0.1f;

TEST(mathlib, vec_from_mangle)
TEST(mathlib, vecFromMangle)
{
EXPECT_TRUE(qv::epsilonEqual(qvec3f(1, 0, 0), qv::vec_from_mangle(qvec3f(0, 0, 0)), MANGLE_EPSILON));
EXPECT_TRUE(qv::epsilonEqual(qvec3f(-1, 0, 0), qv::vec_from_mangle(qvec3f(180, 0, 0)), MANGLE_EPSILON));
EXPECT_TRUE(qv::epsilonEqual(qvec3f(0, 0, 1), qv::vec_from_mangle(qvec3f(0, 90, 0)), MANGLE_EPSILON));
EXPECT_TRUE(qv::epsilonEqual(qvec3f(0, 0, -1), qv::vec_from_mangle(qvec3f(0, -90, 0)), MANGLE_EPSILON));
}

TEST(mathlib, mangle_from_vec)
TEST(mathlib, mangleFromVec)
{
EXPECT_TRUE(qv::epsilonEqual(qvec3f(0, 0, 0), qv::mangle_from_vec(qvec3f(1, 0, 0)), MANGLE_EPSILON));
EXPECT_TRUE(qv::epsilonEqual(qvec3f(180, 0, 0), qv::mangle_from_vec(qvec3f(-1, 0, 0)), MANGLE_EPSILON));
Expand Down Expand Up @@ -611,54 +611,54 @@ TEST(mathlib, DistToLineSegment)
ASSERT_LT(fabs(0.5 - DistToLineSegment(qvec3f(10, 0, 0), qvec3f(10, 0, 100), qvec3f(9.5, 0, 0))), epsilon);
}

TEST(mathlib, linesOverlap_points)
TEST(mathlib, linesOverlapPoints)
{
ASSERT_TRUE(LinesOverlap({0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}));
}

TEST(mathlib, linesOverlap_point_line)
TEST(mathlib, linesOverlapPointLine)
{
ASSERT_TRUE(LinesOverlap({0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 1}));
}

TEST(mathlib, linesOverlap_same)
TEST(mathlib, linesOverlapSame)
{
ASSERT_TRUE(LinesOverlap({0, 0, 0}, {0, 0, 1}, {0, 0, 0}, {0, 0, 1}));
}

TEST(mathlib, linesOverlap_same_opposite_dir)
TEST(mathlib, linesOverlapSameOppositeDir)
{
ASSERT_TRUE(LinesOverlap({0, 0, 0}, {0, 0, 1}, {0, 0, 1}, {0, 0, 0}));
}

TEST(mathlib, linesOverlap_overlap)
TEST(mathlib, linesOverlapOverlap)
{
ASSERT_TRUE(LinesOverlap({0, 0, 0}, {0, 0, 1}, {0, 0, 0.5}, {0, 0, 1.5}));
}

TEST(mathlib, linesOverlap_overlap_opposite_dir)
TEST(mathlib, linesOverlapOverlapOppositeDir)
{
ASSERT_TRUE(LinesOverlap({0, 0, 0}, {0, 0, 1}, {0, 0, 1.5}, {0, 0, 0.5}));
}

TEST(mathlib, linesOverlap_only_tips_touching)
TEST(mathlib, linesOverlapOnlyTipsTouching)
{
ASSERT_TRUE(LinesOverlap({0, 0, 0}, {0, 0, 1}, {0, 0, 1}, {0, 0, 2}));
}

TEST(mathlib, linesOverlap_non_colinear)
TEST(mathlib, linesOverlapNonColinear)
{
ASSERT_FALSE(LinesOverlap({0, 0, 0}, {0, 0, 1}, {5, 0, 0}, {5, 0, 1}));
}

TEST(mathlib, linesOverlap_colinear_not_touching)
TEST(mathlib, linesOverlapColinearNotTouching)
{
ASSERT_FALSE(LinesOverlap({0, 0, 0}, {0, 0, 1}, {0, 0, 2}, {0, 0, 3}));
}

// qvec

TEST(mathlib, qvec_expand)
TEST(mathlib, qvecExpand)
{
const qvec2f test(1, 2);
const qvec4f test2(test);
Expand All @@ -669,7 +669,7 @@ TEST(mathlib, qvec_expand)
EXPECT_EQ(0, test2[3]);
}

TEST(mathlib, qvec_contract)
TEST(mathlib, qvecContract)
{
const qvec4f test(1, 2, 0, 0);
const qvec2f test2(test);
Expand All @@ -678,7 +678,7 @@ TEST(mathlib, qvec_contract)
EXPECT_EQ(2, test2[1]);
}

TEST(mathlib, qvec_copy)
TEST(mathlib, qvecCopy)
{
const qvec2f test(1, 2);
const qvec2f test2(test);
Expand All @@ -687,21 +687,21 @@ TEST(mathlib, qvec_copy)
EXPECT_EQ(2, test2[1]);
}

TEST(mathlib, qvec_constructor_init)
TEST(mathlib, qvecConstructorInit)
{
const qvec2f test{};
EXPECT_EQ(0, test[0]);
EXPECT_EQ(0, test[1]);
}

TEST(mathlib, qvec_constructor_1)
TEST(mathlib, qvecConstructor1)
{
const qvec2f test(42);
EXPECT_EQ(42, test[0]);
EXPECT_EQ(42, test[1]);
}

TEST(mathlib, qvec_constructor_fewer)
TEST(mathlib, qvecConstructorFewer)
{
const qvec4f test(1, 2, 3);
EXPECT_EQ(1, test[0]);
Expand All @@ -710,7 +710,7 @@ TEST(mathlib, qvec_constructor_fewer)
EXPECT_EQ(0, test[3]);
}

TEST(mathlib, qvec_constructor_extra)
TEST(mathlib, qvecConstructorExtra)
{
const qvec2f test(1, 2, 3);
EXPECT_EQ(1, test[0]);
Expand All @@ -728,22 +728,22 @@ TEST(mathlib, aabbBasic)
EXPECT_EQ(qvec3f(9, 9, 9), b1.size());
}

TEST(mathlib, aabb_grow)
TEST(mathlib, aabbGrow)
{
const aabb3f b1(qvec3f(1, 1, 1), qvec3f(10, 10, 10));

EXPECT_EQ(aabb3f(qvec3f(0, 0, 0), qvec3f(11, 11, 11)), b1.grow(qvec3f(1, 1, 1)));
}

TEST(mathlib, aabb_unionwith)
TEST(mathlib, aabbUnionwith)
{
const aabb3f b1(qvec3f(1, 1, 1), qvec3f(10, 10, 10));
const aabb3f b2(qvec3f(11, 11, 11), qvec3f(12, 12, 12));

EXPECT_EQ(aabb3f(qvec3f(1, 1, 1), qvec3f(12, 12, 12)), b1.unionWith(b2));
}

TEST(mathlib, aabb_expand)
TEST(mathlib, aabbExpand)
{
const aabb3f b1(qvec3f(1, 1, 1), qvec3f(10, 10, 10));

Expand All @@ -758,7 +758,7 @@ TEST(mathlib, aabb_expand)
EXPECT_EQ(b3, b1.expand(qvec3f(0, 1, 1)));
}

TEST(mathlib, aabb_disjoint)
TEST(mathlib, aabbDisjoint)
{
const aabb3f b1(qvec3f(1, 1, 1), qvec3f(10, 10, 10));

Expand Down Expand Up @@ -790,7 +790,7 @@ TEST(mathlib, aabb_disjoint)
EXPECT_FALSE(b1.disjoint_or_touching(aabb3f(qvec3f(9.99, 1, 1), qvec3f(20, 10, 10))));
}

TEST(mathlib, aabb_contains)
TEST(mathlib, aabbContains)
{
const aabb3f b1(qvec3f(1, 1, 1), qvec3f(10, 10, 10));

Expand All @@ -806,7 +806,7 @@ TEST(mathlib, aabb_contains)
EXPECT_FALSE(b1.contains(no2));
}

TEST(mathlib, aabb_containsPoint)
TEST(mathlib, aabbContainsPoint)
{
const aabb3f b1(qvec3f(1, 1, 1), qvec3f(10, 10, 10));

Expand All @@ -826,7 +826,7 @@ TEST(mathlib, aabb_containsPoint)
EXPECT_FALSE(b1.containsPoint(no3));
}

TEST(mathlib, aabb_create_invalid)
TEST(mathlib, aabbCreateInvalid)
{
const aabb3f b1(qvec3f(1, 1, 1), qvec3f(-1, -1, -1));
const aabb3f fixed(qvec3f(1, 1, 1), qvec3f(1, 1, 1));
Expand Down Expand Up @@ -913,15 +913,15 @@ TEST(qmat, matrix4x4inv)
ASSERT_TRUE(std::isnan(nanMat.at(0, 0)));
}

TEST(qmat, qmat_construct_initialize)
TEST(qmat, qmatConstructInitialize)
{
const qmat2x2f test{1, 2, 3, 4}; // column major

EXPECT_EQ(qvec2f(1, 3), test.row(0));
EXPECT_EQ(qvec2f(2, 4), test.row(1));
}

TEST(qmat, qmat_construct_row_major)
TEST(qmat, qmatConstructRowMajor)
{
const qmat2x2f test = qmat2x2f::row_major({1, 2, 3, 4});

Expand Down
26 changes: 13 additions & 13 deletions tests/test_ltface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ testresults_t QbspVisLight_HL(
return QbspVisLight_Common(name, {"-hlbsp"}, extra_light_args, run_vis);
}

TEST(lightgrid_sample_t, styleEquality)
TEST(lightgridsample, styleEquality)
{
lightgrid_sample_t a {.used = true, .style = 4, .color = {}};
lightgrid_sample_t b = a;
Expand All @@ -147,7 +147,7 @@ TEST(lightgrid_sample_t, styleEquality)
EXPECT_NE(a, b);
}

TEST(lightgrid_sample_t, colorEquality) {
TEST(lightgridsample, colorEquality) {
lightgrid_sample_t a {.used = true, .style = 4, .color = {1,2,3}};
lightgrid_sample_t b = a;
EXPECT_EQ(a, b);
Expand All @@ -156,7 +156,7 @@ TEST(lightgrid_sample_t, colorEquality) {
EXPECT_NE(a, b);
}

TEST(lightgrid_sample_t, nanColors) {
TEST(lightgridsample, nanColors) {
lightgrid_sample_t a {.used = true, .style = 4, .color = {std::numeric_limits<double>::quiet_NaN(), 1.0, 1.0}};
lightgrid_sample_t b = a;
EXPECT_EQ(a, b);
Expand All @@ -165,7 +165,7 @@ TEST(lightgrid_sample_t, nanColors) {
EXPECT_NE(a, b);
}

TEST(lightgrid_sample_t, unusedEqualityDoesntConsiderOtherAttributes) {
TEST(lightgridsample, unusedEqualityDoesntConsiderOtherAttributes) {
lightgrid_sample_t a, b;
EXPECT_FALSE(a.used);
EXPECT_EQ(a, b);
Expand All @@ -178,7 +178,7 @@ TEST(lightgrid_sample_t, unusedEqualityDoesntConsiderOtherAttributes) {
}


TEST(world_units_per_luxel, lightgrid)
TEST(worldunitsperluxel, lightgrid)
{
auto [bsp, bspx] = QbspVisLight_Q2("q2_lightmap_custom_scale.map", {"-lightgrid"});

Expand Down Expand Up @@ -415,7 +415,7 @@ TEST(ltfaceQ2, phongDoesntCrossContents)
auto [bsp, bspx] = QbspVisLight_Q2("q2_phong_doesnt_cross_contents.map", {"-wrnormals"});
}

TEST(ltfaceQ2, q2_minlight_nomottle)
TEST(ltfaceQ2, minlightNomottle)
{
SCOPED_TRACE("_minlightMottle 0 works on worldspawn");

Expand Down Expand Up @@ -739,7 +739,7 @@ TEST(ltfaceQ2, lightCone)
CheckSpotCutoff(bsp, {1236, 1472, 952});
}

TEST(ltfaceQ2, light_sunlight_default_mangle)
TEST(ltfaceQ2, lightSunlightDefaultMangle)
{
auto [bsp, bspx] = QbspVisLight_Q2("q2_light_sunlight_default_mangle.map", {});

Expand All @@ -751,7 +751,7 @@ TEST(ltfaceQ2, light_sunlight_default_mangle)
CheckFaceLuxelAtPoint(&bsp, &bsp.dmodels[0], {100, 100, 100}, shadow_pos + qvec3d{-48, 0, 0});
}

TEST(ltfaceQ2, q2_light_sun)
TEST(ltfaceQ2, lightSun)
{
const std::vector<std::string> maps{"q2_light_sun.map", "q2_light_sun_mangle.map"};

Expand All @@ -768,7 +768,7 @@ TEST(ltfaceQ2, q2_light_sun)
}
}

TEST(ltfaceQ2, light_origin_brush_shadow)
TEST(ltfaceQ2, lightOriginBrushShadow)
{
auto [bsp, bspx] = QbspVisLight_Q2("q2_light_origin_brush_shadow.map", {});

Expand All @@ -792,7 +792,7 @@ TEST(ltfaceQ2, light_origin_brush_shadow)
CheckFaceLuxelAtPoint(&bsp, &bsp.dmodels[0], {100, 100, 100}, at_origin);
}

TEST(ltfaceQ2, surface_lights_culling)
TEST(ltfaceQ2, surfaceLightsCulling)
{
GTEST_SKIP();

Expand Down Expand Up @@ -978,7 +978,7 @@ TEST(ltfaceQ1, suntexture)
CheckFaceLuxelAtPoint(&bsp, &bsp.dmodels[0], {0, 0, 142}, {1000, 1288, 944}, {0, 0, 1}, &lit);
}

TEST(ltfaceQ1, q1_light_sun_artifact)
TEST(ltfaceQ1, lightSunArtifact)
{
SCOPED_TRACE("sun rays can hit cracks if RTC_SCENE_FLAG_ROBUST is not used");

Expand All @@ -991,7 +991,7 @@ TEST(ltfaceQ1, q1_light_sun_artifact)
}
}

TEST(ltfaceQ1, q1_light_invalid_delay)
TEST(ltfaceQ1, lightInvalidDelay)
{
SCOPED_TRACE("invalid light formulas are ignored, not a fatal error");

Expand All @@ -1002,7 +1002,7 @@ TEST(ltfaceQ1, q1_light_invalid_delay)
}
}

TEST(ltfaceQ1, bounce_litwaterWithoutTheWater)
TEST(ltfaceQ1, bounceLitwaterWithoutTheWater)
{
auto [bsp, bspx] = QbspVisLight_Common("q1_light_bounce_litwater.map", {"-omitdetail"}, {"-lit", "-bounce", "4"}, runvis_t::no);
CheckFaceLuxelAtPoint(&bsp, &bsp.dmodels[0], {118, 118, 118}, {128, 12, 156}, {-1, 0, 0});
Expand Down
Loading

0 comments on commit baaaff9

Please sign in to comment.