FIX: Fix not initialized enums in unittest.

pull/4731/head
Kim Kulling 2022-09-18 18:10:56 +02:00
parent 34eaf2d092
commit 704a187c90
1 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ public:
EXPECT_NE(nullptr, scene); EXPECT_NE(nullptr, scene);
EXPECT_NE(nullptr, scene->mMaterials); EXPECT_NE(nullptr, scene->mMaterials);
aiBlendMode blend_mode; aiBlendMode blend_mode = aiBlendMode_Default;
scene->mMaterials[0]->Get(AI_MATKEY_BLEND_FUNC, blend_mode); scene->mMaterials[0]->Get(AI_MATKEY_BLEND_FUNC, blend_mode);
EXPECT_EQ(aiBlendMode_Additive, blend_mode); EXPECT_EQ(aiBlendMode_Additive, blend_mode);
} }
@ -104,14 +104,14 @@ public:
EXPECT_NE(nullptr, scene); EXPECT_NE(nullptr, scene);
EXPECT_NE(nullptr, scene->mMaterials); EXPECT_NE(nullptr, scene->mMaterials);
int texture_flags; int texture_flags = 0;
scene->mMaterials[0]->Get(AI_MATKEY_TEXFLAGS_DIFFUSE(0), texture_flags); scene->mMaterials[0]->Get(AI_MATKEY_TEXFLAGS_DIFFUSE(0), texture_flags);
EXPECT_EQ(aiTextureFlags_UseAlpha, texture_flags); EXPECT_EQ(aiTextureFlags_UseAlpha, texture_flags);
// The model has only one texture, a 256 color bitmap with // The model has only one texture, a 256 color bitmap with
// a palette. Pure blue is the last color in the palette, // a palette. Pure blue is the last color in the palette,
// and should be the transparency color. // and should be the transparency color.
aiColor3D transparency_color; aiColor3D transparency_color = {};
scene->mMaterials[0]->Get(AI_MATKEY_COLOR_TRANSPARENT, transparency_color); scene->mMaterials[0]->Get(AI_MATKEY_COLOR_TRANSPARENT, transparency_color);
EXPECT_EQ(aiColor3D(0, 0, 255), transparency_color); EXPECT_EQ(aiColor3D(0, 0, 255), transparency_color);
} }