Enable unittest for apacity bug for dae files.

pull/1090/head
Kim Kulling 2016-11-30 15:05:06 +01:00
parent c2deb3e15f
commit 12ea506504
3 changed files with 61 additions and 55 deletions

View File

@ -163,7 +163,6 @@ Exporter::ExportFormatEntry gExporters[] =
class ExporterPimpl { class ExporterPimpl {
public: public:
ExporterPimpl() ExporterPimpl()
: blob() : blob()
, mIOSystem(new Assimp::DefaultIOSystem()) , mIOSystem(new Assimp::DefaultIOSystem())
@ -171,7 +170,7 @@ public:
{ {
GetPostProcessingStepInstanceList(mPostProcessingSteps); GetPostProcessingStepInstanceList(mPostProcessingSteps);
// grab all builtin exporters // grab all built-in exporters
mExporters.resize(ASSIMP_NUM_EXPORTERS); mExporters.resize(ASSIMP_NUM_EXPORTERS);
std::copy(gExporters,gExporters+ASSIMP_NUM_EXPORTERS,mExporters.begin()); std::copy(gExporters,gExporters+ASSIMP_NUM_EXPORTERS,mExporters.begin());
} }

View File

@ -44,7 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../../include/assimp/scene.h" #include "../../include/assimp/scene.h"
#include <assimp/Importer.hpp> #include <assimp/Importer.hpp>
#include <BaseImporter.h> #include <BaseImporter.h>
#include "TestIOSystem.h"
#include "DefaultIOSystem.h"
using namespace ::std; using namespace ::std;
using namespace ::Assimp; using namespace ::Assimp;
@ -271,4 +272,7 @@ TEST_F(ImporterTest, testMultipleReads)
//EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/dwarf.x",flags)); # is in nonbsd //EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/dwarf.x",flags)); # is in nonbsd
} }
// ------------------------------------------------------------------------------------------------ TEST_F( ImporterTest, SearchFileHeaderForTokenTest ) {
//DefaultIOSystem ioSystem;
// BaseImporter::SearchFileHeaderForToken( &ioSystem, assetPath, Token, 2 )
}

View File

@ -53,7 +53,7 @@ class utIssues : public ::testing::Test {
#ifndef ASSIMP_BUILD_NO_EXPORT #ifndef ASSIMP_BUILD_NO_EXPORT
TEST_F( utIssues, OpacityBugWhenExporting_727 ) { TEST_F( utIssues, OpacityBugWhenExporting_727 ) {
/*aiScene *scene( new aiScene ); aiScene *scene( new aiScene );
scene->mNumMaterials = 1; scene->mNumMaterials = 1;
scene->mMaterials = new aiMaterial*; scene->mMaterials = new aiMaterial*;
@ -90,20 +90,23 @@ TEST_F( utIssues, OpacityBugWhenExporting_727 ) {
Assimp::Importer importer; Assimp::Importer importer;
Assimp::Exporter exporter; Assimp::Exporter exporter;
for ( std::size_t i( 0 ); i < exporter.GetExportFormatCount(); ++i ) { for ( std::size_t i( 0 ); i < exporter.GetExportFormatCount(); ++i ) {
std::string path; std::string path;
const aiExportFormatDesc *desc( exporter.GetExportFormatDescription( i ) ); const aiExportFormatDesc *desc( exporter.GetExportFormatDescription( i ) );
EXPECT_NE( desc, nullptr ); EXPECT_NE( desc, nullptr );
path.append( desc->fileExtension ); path.append( desc->fileExtension );
if ( "dae" == path ) {
ASSERT_EQ( AI_SUCCESS, exporter.Export( scene, desc->id, path ) ); EXPECT_EQ( AI_SUCCESS, exporter.Export( scene, desc->id, path ) );
const aiScene *newScene( importer.ReadFile( path, 0 ) ); const aiScene *newScene( importer.ReadFile( path, 0 ) );
ASSERT_TRUE( NULL != newScene ); EXPECT_TRUE( NULL != newScene );
float newOpacity; float newOpacity;
if ( newScene->mNumMaterials > 0 ) { if ( newScene->mNumMaterials > 0 ) {
//ASSERT_EQ( AI_SUCCESS, newScene->mMaterials[ 0 ]->Get( AI_MATKEY_OPACITY, newOpacity ) ); std::cout << "Desc = " << desc->description << "\n";
//EXPECT_EQ( opacity, newOpacity ); EXPECT_EQ( AI_SUCCESS, newScene->mMaterials[ 0 ]->Get( AI_MATKEY_OPACITY, newOpacity ) );
EXPECT_EQ( opacity, newOpacity );
}
}
} }
}*/
} }
#endif // ASSIMP_BUILD_NO_EXPORT #endif // ASSIMP_BUILD_NO_EXPORT