Collada exporter: fix access violation.

pull/682/head
Kim Kulling 2015-11-01 15:15:39 +01:00
parent 95c20cb5ab
commit c642d9f25e
2 changed files with 9 additions and 4 deletions

View File

@ -71,7 +71,6 @@ TEST_F(ColladaExportCamera, testExportCamera)
EXPECT_EQ( origNumCams, imported->mNumCameras );
for(size_t i=0; i< imported->mNumCameras;i++){
//const aiCamera *orig = pTest->mCameras[ i ];
const aiCamera *read = imported->mCameras[ i ];
EXPECT_TRUE( names[ i ] == read->mName );
@ -83,6 +82,7 @@ TEST_F(ColladaExportCamera, testExportCamera)
EXPECT_FLOAT_EQ( pos[ i ].y,read->mPosition.y);
EXPECT_FLOAT_EQ( pos[ i ].z,read->mPosition.z);
}
delete [] origFOV;
delete [] orifClipPlaneNear;
delete [] orifClipPlaneFar;

View File

@ -47,6 +47,11 @@ TEST_F(ColladaExportLight, testExportLight)
ASSERT_TRUE(pTest!=NULL);
ASSERT_TRUE(pTest->HasLights());
const unsigned int origNumLights( pTest->mNumLights );
aiLight *origLights = new aiLight[ origNumLights ];
for (size_t i = 0; i < origNumLights; i++) {
origLights[ i ] = *(pTest->mLights[ i ]);
}
EXPECT_EQ(AI_SUCCESS,ex->Export(pTest,"collada",file));
EXPECT_EQ(AI_SUCCESS,ex->Export(pTest,"collada","lightsExp.dae"));
@ -56,11 +61,11 @@ TEST_F(ColladaExportLight, testExportLight)
ASSERT_TRUE(imported!=NULL);
EXPECT_TRUE(imported->HasLights());
EXPECT_EQ(pTest->mNumLights,imported->mNumLights);
EXPECT_EQ( origNumLights,imported->mNumLights );
for(size_t i=0; i< pTest->mNumLights;i++){
const aiLight *orig = pTest->mLights[i];
const aiLight *orig = &origLights[ i ];
const aiLight *read = imported->mLights[i];
EXPECT_TRUE(orig->mName==read->mName);