MCPcopy Create free account
hub / github.com/assimp/assimp / TEST_F

Function TEST_F

test/unit/utIssues.cpp:56–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54#ifndef ASSIMP_BUILD_NO_EXPORT
55
56TEST_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

Callers

nothing calls this directly

Calls 5

removeFunction · 0.85
appendMethod · 0.80
ExportMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected