Collada Export test: fix unit test for lightsCollada Export test: fix unit

test for lights..
pull/690/head
Kim Kulling 2015-11-02 21:09:26 +01:00
parent c642d9f25e
commit 0ea4682586
2 changed files with 7 additions and 4 deletions

View File

@ -74,7 +74,7 @@ TEST_F(ColladaExportCamera, testExportCamera)
const aiCamera *read = imported->mCameras[ i ];
EXPECT_TRUE( names[ i ] == read->mName );
EXPECT_FLOAT_EQ( origFOV[ i ],read->mHorizontalFOV );
EXPECT_NEAR( origFOV[ i ],read->mHorizontalFOV, 0.0001f );
EXPECT_FLOAT_EQ( orifClipPlaneNear[ i ], read->mClipPlaneNear);
EXPECT_FLOAT_EQ( orifClipPlaneFar[ i ], read->mClipPlaneFar);

View File

@ -49,7 +49,9 @@ TEST_F(ColladaExportLight, testExportLight)
const unsigned int origNumLights( pTest->mNumLights );
aiLight *origLights = new aiLight[ origNumLights ];
std::vector<std::string> origNames;
for (size_t i = 0; i < origNumLights; i++) {
origNames.push_back( pTest->mLights[ i ]->mName.C_Str() );
origLights[ i ] = *(pTest->mLights[ i ]);
}
@ -62,17 +64,17 @@ TEST_F(ColladaExportLight, testExportLight)
EXPECT_TRUE(imported->HasLights());
EXPECT_EQ( origNumLights,imported->mNumLights );
for(size_t i=0; i< pTest->mNumLights;i++){
for(size_t i=0; i< origNumLights; i++){
const aiLight *orig = &origLights[ i ];
const aiLight *read = imported->mLights[i];
EXPECT_TRUE(orig->mName==read->mName);
EXPECT_EQ(0,strncmp(origNames[ i ].c_str(),read->mName.C_Str(), origNames[ i ].size() ) );
EXPECT_EQ(orig->mType,read->mType);
EXPECT_FLOAT_EQ(orig->mAttenuationConstant,read->mAttenuationConstant);
EXPECT_FLOAT_EQ(orig->mAttenuationLinear,read->mAttenuationLinear);
EXPECT_FLOAT_EQ(orig->mAttenuationQuadratic,read->mAttenuationQuadratic);
EXPECT_NEAR(orig->mAttenuationQuadratic,read->mAttenuationQuadratic, 0.001f);
EXPECT_FLOAT_EQ(orig->mColorAmbient.r,read->mColorAmbient.r);
EXPECT_FLOAT_EQ(orig->mColorAmbient.g,read->mColorAmbient.g);
@ -89,6 +91,7 @@ TEST_F(ColladaExportLight, testExportLight)
EXPECT_NEAR(orig->mAngleInnerCone,read->mAngleInnerCone,0.001);
EXPECT_NEAR(orig->mAngleOuterCone,read->mAngleOuterCone,0.001);
}
delete [] origLights;
}