closes https://github.com/assimp/assimp/issues/1724: add default material access to the material API.

This commit is contained in:
kimkulling
2018-07-25 15:11:24 +02:00
parent c5514cda7d
commit 9a6b07e522
12 changed files with 144 additions and 52 deletions

View File

@@ -120,8 +120,7 @@ TEST_F(MaterialSystemTest, testColorProperty)
}
// ------------------------------------------------------------------------------------------------
TEST_F(MaterialSystemTest, testStringProperty)
{
TEST_F(MaterialSystemTest, testStringProperty) {
aiString s;
s.Set("Hello, this is a small test");
this->pcMat->AddProperty(&s,"testKey6");
@@ -129,3 +128,20 @@ TEST_F(MaterialSystemTest, testStringProperty)
EXPECT_EQ(AI_SUCCESS, pcMat->Get("testKey6",0,0,s));
EXPECT_STREQ("Hello, this is a small test", s.data);
}
// ------------------------------------------------------------------------------------------------
TEST_F(MaterialSystemTest, testDefaultMaterialAccess) {
aiMaterial *mat = aiCreateAndRegisterDefaultMaterial();
EXPECT_NE(nullptr, mat);
aiReleaseDefaultMaterial();
}
// ------------------------------------------------------------------------------------------------
TEST_F(MaterialSystemTest, testMaterialNameAccess) {
aiMaterial *mat = aiCreateAndRegisterDefaultMaterial();
EXPECT_NE(nullptr, mat);
aiString name = mat->GetName();
const int retValue(strncmp(name.C_Str(), AI_DEFAULT_MATERIAL_NAME, name.length));
EXPECT_EQ(0, retValue );
}