Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5361: Migrate the rest of the unit tests to gtest.
- Loading branch information
1 parent
54c0347
commit 0a75b47
Showing
9 changed files
with
66 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "RadiantTest.h" | ||
|
||
#include "ishaders.h" | ||
|
||
namespace test | ||
{ | ||
|
||
using MaterialsTest = RadiantTest; | ||
|
||
TEST_F(MaterialsTest, MaterialFileInfo) | ||
{ | ||
auto& materialManager = GlobalMaterialManager(); | ||
|
||
// Expect our example material definitions in the ShaderLibrary | ||
EXPECT_TRUE(materialManager.materialExists("textures/orbweaver/drain_grille")); | ||
EXPECT_TRUE(materialManager.materialExists("models/md5/chars/nobles/noblewoman/noblebottom")); | ||
EXPECT_TRUE(materialManager.materialExists("tdm_spider_black")); | ||
|
||
// ShaderDefinitions should contain their source file infos | ||
const auto& drainGrille = materialManager.getMaterialForName("textures/orbweaver/drain_grille"); | ||
EXPECT_EQ(drainGrille->getShaderFileInfo().name, "example.mtr"); | ||
EXPECT_EQ(drainGrille->getShaderFileInfo().visibility, vfs::Visibility::NORMAL); | ||
|
||
const auto& nobleTop = materialManager.getMaterialForName("models/md5/chars/nobles/noblewoman/nobletop"); | ||
EXPECT_EQ(nobleTop->getShaderFileInfo().name, "tdm_ai_nobles.mtr"); | ||
EXPECT_EQ(nobleTop->getShaderFileInfo().visibility, vfs::Visibility::NORMAL); | ||
|
||
// Visibility should be parsed from assets.lst | ||
const auto& hiddenTex = materialManager.getMaterialForName("textures/orbweaver/drain_grille_h"); | ||
EXPECT_EQ(hiddenTex->getShaderFileInfo().name, "hidden.mtr"); | ||
EXPECT_EQ(hiddenTex->getShaderFileInfo().visibility, vfs::Visibility::HIDDEN); | ||
|
||
// assets.lst visibility applies to the MTR file, and should propagate to | ||
// all shaders within it | ||
const auto& hiddenTex2 = materialManager.getMaterialForName("textures/darkmod/another_white"); | ||
EXPECT_EQ(hiddenTex2->getShaderFileInfo().name, "hidden.mtr"); | ||
EXPECT_EQ(hiddenTex2->getShaderFileInfo().visibility, vfs::Visibility::HIDDEN); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters