Introduce simple export test for assbin.
parent
c25a2dfc22
commit
081365df48
|
@ -188,13 +188,17 @@ aiQuatKey Read<aiQuatKey>(IOStream * stream)
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
void ReadArray(IOStream * stream, T * out, unsigned int size)
|
||||
{
|
||||
for (unsigned int i=0; i<size; i++) out[i] = Read<T>(stream);
|
||||
void ReadArray( IOStream *stream, T * out, unsigned int size) {
|
||||
ai_assert( nullptr != stream );
|
||||
ai_assert( nullptr != out );
|
||||
|
||||
for (unsigned int i=0; i<size; i++) {
|
||||
out[i] = Read<T>(stream);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T> void ReadBounds( IOStream * stream, T* /*p*/, unsigned int n )
|
||||
{
|
||||
template <typename T>
|
||||
void ReadBounds( IOStream * stream, T* /*p*/, unsigned int n ) {
|
||||
// not sure what to do here, the data isn't really useful.
|
||||
stream->Seek( sizeof(T) * n, aiOrigin_CUR );
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
virtual bool importerTest() {
|
||||
Assimp::Importer importer;
|
||||
const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/OBJ/spider.obj", aiProcess_ValidateDataStructure );
|
||||
|
||||
Exporter exporter;
|
||||
EXPECT_EQ( aiReturn_SUCCESS, exporter.Export( scene, "assbin", ASSIMP_TEST_MODELS_DIR "/OBJ/spider_test.assbin" ) );
|
||||
const aiScene *newScene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/OBJ/spider_test.assbin", aiProcess_ValidateDataStructure );
|
||||
|
@ -62,6 +63,12 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
TEST_F( utAssbinImportExport, import3DFromFileTest ) {
|
||||
TEST_F( utAssbinImportExport, exportAssbin3DFromFileTest ) {
|
||||
Assimp::Importer importer;
|
||||
const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/OBJ/spider.obj", aiProcess_ValidateDataStructure );
|
||||
EXPECT_NE( nullptr, scene );
|
||||
}
|
||||
|
||||
TEST_F( utAssbinImportExport, import3ExportAssbinDFromFileTest ) {
|
||||
EXPECT_TRUE( importerTest() );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue