Collada exporter: fix access violation.
parent
95c20cb5ab
commit
c642d9f25e
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue