closes https://github.com/assimp/assimp/issues/1724: add default material access to the material API.
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user