Skip to content

Commit

Permalink
#5532: Unit test tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Mar 21, 2021
1 parent 4d9cbcb commit abece93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions test/Materials.cpp
Expand Up @@ -184,13 +184,17 @@ TEST_F(MaterialsTest, MaterialParserSortRequest)
EXPECT_FALSE(material->getParseFlags() & Material::PF_HasSortDefined); // sort is not explicitly set
EXPECT_EQ(material->getSortRequest(), Material::SORT_DECAL);

material = materialManager.getMaterial("textures/parsertest/sortPredefined_custom");
material = materialManager.getMaterial("textures/parsertest/sort_custom");
EXPECT_TRUE(material->getParseFlags() & Material::PF_HasSortDefined);
EXPECT_FLOAT_EQ(material->getSortRequest(), 34.56f);

material = materialManager.getMaterial("textures/parsertest/sortPredefined_custom2");
material = materialManager.getMaterial("textures/parsertest/sort_custom2");
EXPECT_TRUE(material->getParseFlags() & Material::PF_HasSortDefined);
EXPECT_FLOAT_EQ(material->getSortRequest(), 34.56f);

// Update the sort request
material->setSortRequest(78.45f);
EXPECT_FLOAT_EQ(material->getSortRequest(), 78.45f);
}

TEST_F(MaterialsTest, MaterialParserAmbientRimColour)
Expand Down
4 changes: 2 additions & 2 deletions test/resources/tdm/materials/parsertest.mtr
Expand Up @@ -33,8 +33,8 @@ textures/parsertest/sortPredefined_afterfog { sORt aFteRfog }
textures/parsertest/sortPredefined_postprocess { sORt pOstProcess }
textures/parsertest/sortPredefined_portalsky { sORt pOrtAlsky }
textures/parsertest/sortPredefined_decal_macro { DECAL_MACRO }
textures/parsertest/sortPredefined_custom { sort 34.56 }
textures/parsertest/sortPredefined_custom2 { sort portalsky sort 34.56 }
textures/parsertest/sort_custom { sort 34.56 }
textures/parsertest/sort_custom2 { sort portalsky sort 34.56 }

textures/parsertest/withAmbientRimColor
{
Expand Down

0 comments on commit abece93

Please sign in to comment.