diff --git a/code/PlyExporter.h b/code/PlyExporter.h index ce242692c..d1d4eafbb 100644 --- a/code/PlyExporter.h +++ b/code/PlyExporter.h @@ -51,14 +51,12 @@ struct aiScene; struct aiNode; struct aiMesh; -namespace Assimp -{ +namespace Assimp { // ------------------------------------------------------------------------------------------------ /** Helper class to export a given scene to a Stanford Ply file. */ // ------------------------------------------------------------------------------------------------ -class PlyExporter -{ +class PlyExporter { public: /// The class constructor for a specific scene to export PlyExporter(const char* filename, const aiScene* pScene, bool binary = false); diff --git a/test/unit/utPLYImportExport.cpp b/test/unit/utPLYImportExport.cpp index 7ac15edac..5ab809530 100644 --- a/test/unit/utPLYImportExport.cpp +++ b/test/unit/utPLYImportExport.cpp @@ -41,6 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "UnitTestPCH.h" #include +#include #include "AbstractImportExportBase.h" using namespace ::Assimp; @@ -52,12 +53,32 @@ public: const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/PLY/cube.ply", 0 ); return nullptr != scene; } + +#ifndef ASSIMP_BUILD_NO_EXPORT + virtual bool exporterTest() { + Importer importer; + Exporter exporter; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/PLY/cube.ply", 0); + EXPECT_NE(nullptr, scene); + EXPECT_EQ(aiReturn_SUCCESS, exporter.Export(scene, "ply", ASSIMP_TEST_MODELS_DIR "/ply/cube_test.ply")); + + return true; + } +#endif // ASSIMP_BUILD_NO_EXPORT }; -TEST_F( utPLYImportExport, importTest ) { +TEST_F( utPLYImportExport, importTest_Success ) { EXPECT_TRUE( importerTest() ); } +#ifndef ASSIMP_BUILD_NO_EXPORT + +TEST_F(utPLYImportExport, exportTest_Success ) { + EXPECT_TRUE(exporterTest()); +} + +#endif // ASSIMP_BUILD_NO_EXPORT + TEST_F( utPLYImportExport, vertexColorTest ) { Assimp::Importer importer; const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/PLY/float-color.ply", 0 );