ModelDiffer: update material testser + create material for unittests.

pull/1005/head
Kim Kulling 2016-09-23 10:10:00 +02:00
parent d005b38f99
commit 68d33a99a1
2 changed files with 9 additions and 0 deletions

View File

@ -94,6 +94,14 @@ bool ModelDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) {
addDiff( stream.str() );
return false;
}
if ( expected->mNumMaterials > 0 ) {
if ( nullptr == expected->mMaterials || nullptr == toCompare->mMaterials ) {
addDiff( "Number of materials > 0 and mat pointer is nullptr" );
return false;
}
}
for ( unsigned int i = 0; i < expected->mNumMaterials; i++ ) {
aiMaterial *expectedMat( expected->mMaterials[ i ] );
aiMaterial *toCompareMat( expected->mMaterials[ i ] );

View File

@ -124,6 +124,7 @@ protected:
expScene->mMeshes[ 0 ] = mesh;
expScene->mNumMaterials = 1;
expScene->mMaterials = new aiMaterial*[ expScene->mNumMaterials ];
return expScene;
}