| 54 | #ifndef ASSIMP_BUILD_NO_EXPORT |
| 55 | |
| 56 | TEST_F( utIssues, OpacityBugWhenExporting_727 ) { |
| 57 | float opacity; |
| 58 | aiScene *scene = TestModelFactory::createDefaultTestModel(opacity); |
| 59 | Assimp::Importer importer; |
| 60 | Assimp::Exporter exporter; |
| 61 | |
| 62 | const aiExportFormatDesc *desc = exporter.GetExportFormatDescription( 0 ); |
| 63 | ASSERT_NE( desc, nullptr ); |
| 64 | |
| 65 | std::string path = "dae"; |
| 66 | path.append("."); |
| 67 | path.append( desc->fileExtension ); |
| 68 | EXPECT_EQ( AI_SUCCESS, exporter.Export( scene, desc->id, path ) ); |
| 69 | const aiScene *newScene( importer.ReadFile( path, aiProcess_ValidateDataStructure ) ); |
| 70 | ASSERT_NE( nullptr, newScene ); |
| 71 | float newOpacity; |
| 72 | if (newScene->mNumMaterials > 0 ) { |
| 73 | EXPECT_EQ( AI_SUCCESS, newScene->mMaterials[ 0 ]->Get( AI_MATKEY_OPACITY, newOpacity ) ); |
| 74 | EXPECT_FLOAT_EQ( opacity, newOpacity ); |
| 75 | } |
| 76 | |
| 77 | TestModelFactory::releaseDefaultTestModel(&scene); |
| 78 | |
| 79 | // Cleanup. Delete exported dae.dae file |
| 80 | EXPECT_EQ(0, std::remove(path.c_str())); |
| 81 | } |
| 82 | |
| 83 | #endif // ASSIMP_BUILD_NO_EXPORT |
nothing calls this directly
no test coverage detected