From bbaf83846320855998c1b08f100f0631ebe3c939 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 22 Apr 2012 23:00:44 +0000 Subject: [PATCH] - update unit tests. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1238 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- test/unit/CCompilerTest.c | 11 +++++------ test/unit/UnitTestPCH.h | 2 +- test/unit/utExport.h | 4 ++-- test/unit/utGenNormals.h | 4 +--- test/unit/utImporter.cpp | 24 ++++++++++++++++++------ test/unit/utImporter.h | 4 ++-- test/unit/utJoinVertices.h | 2 +- test/unit/utLimitBoneWeights.h | 2 +- test/unit/utMaterialSystem.h | 4 +--- test/unit/utPretransformVertices.h | 2 +- test/unit/utRemoveComments.h | 1 - test/unit/utRemoveComponent.h | 2 +- test/unit/utRemoveRedundantMaterials.h | 4 +--- test/unit/utScenePreprocessor.h | 6 +++--- test/unit/utSharedPPData.h | 3 +-- test/unit/utSortByPType.h | 3 +-- test/unit/utSplitLargeMeshes.h | 4 +--- test/unit/utTriangulate.h | 4 +--- test/unit/utVertexTriangleAdjacency.h | 4 ++-- 19 files changed, 44 insertions(+), 46 deletions(-) diff --git a/test/unit/CCompilerTest.c b/test/unit/CCompilerTest.c index 36c27496e..e1b806372 100644 --- a/test/unit/CCompilerTest.c +++ b/test/unit/CCompilerTest.c @@ -1,9 +1,8 @@ // This is just a small test to check whether Assimp's API compiles from C -#include -#include -#include -#include -#include -#include \ No newline at end of file +#include +#include +#include +#include +#include \ No newline at end of file diff --git a/test/unit/UnitTestPCH.h b/test/unit/UnitTestPCH.h index d363919b8..edc4be0bf 100644 --- a/test/unit/UnitTestPCH.h +++ b/test/unit/UnitTestPCH.h @@ -6,7 +6,7 @@ // We need to be sure to have the same STL settings as Assimp #include -#include "cimport.h" +#include // CPPUNIT #include diff --git a/test/unit/utExport.h b/test/unit/utExport.h index ceb1ad67e..722d19e2e 100644 --- a/test/unit/utExport.h +++ b/test/unit/utExport.h @@ -3,8 +3,8 @@ #ifndef ASSIMP_BUILD_NO_EXPORT -#include -#include +#include +#include using namespace Assimp; diff --git a/test/unit/utGenNormals.h b/test/unit/utGenNormals.h index bedf7b7b7..6de09e043 100644 --- a/test/unit/utGenNormals.h +++ b/test/unit/utGenNormals.h @@ -4,9 +4,7 @@ #include #include -#include -#include -#include +#include #include diff --git a/test/unit/utImporter.cpp b/test/unit/utImporter.cpp index e4ed03633..702bb7978 100644 --- a/test/unit/utImporter.cpp +++ b/test/unit/utImporter.cpp @@ -56,6 +56,21 @@ CPPUNIT_TEST_SUITE_REGISTRATION (ImporterTest); #define AIUT_DEF_ERROR_TEXT "sorry, this is a test" +static const aiImporterDesc desc = { + "UNIT TEST - IMPORTER", + "", + "", + "", + 0, + 0, + 0, + 0, + 0, + "apple mac linux windows" +}; + + + bool TestPlugin :: CanRead( const std::string& pFile, IOSystem* pIOHandler, bool test) const { @@ -70,12 +85,9 @@ bool TestPlugin :: CanRead( const std::string& pFile, extension == ".linux" || extension == ".windows" ); } -void TestPlugin :: GetExtensionList(std::set& extensions) +const aiImporterDesc* TestPlugin :: GetInfo() const { - extensions.insert("apple"); - extensions.insert("mac"); - extensions.insert("linux"); - extensions.insert("windows"); + return & desc; } void TestPlugin :: InternReadFile( const std::string& pFile, @@ -147,7 +159,7 @@ void ImporterTest :: testPluginInterface (void) CPPUNIT_ASSERT(pImp->IsExtensionSupported(".3ds")); CPPUNIT_ASSERT(!pImp->IsExtensionSupported(".")); - TestPlugin* p = (TestPlugin*) pImp->FindLoader(".windows"); + TestPlugin* p = (TestPlugin*) pImp->GetImporter(".windows"); CPPUNIT_ASSERT(NULL != p); try { diff --git a/test/unit/utImporter.h b/test/unit/utImporter.h index 12d939b2e..aa4b56301 100644 --- a/test/unit/utImporter.h +++ b/test/unit/utImporter.h @@ -4,7 +4,7 @@ #include #include -#include +#include #include using namespace std; @@ -52,7 +52,7 @@ public: IOSystem* pIOHandler, bool test) const; // overriden - void GetExtensionList(std::set& extensions); + const aiImporterDesc* GetInfo () const; // overriden void InternReadFile( const std::string& pFile, diff --git a/test/unit/utJoinVertices.h b/test/unit/utJoinVertices.h index 7d5f30cdf..6dcf44bae 100644 --- a/test/unit/utJoinVertices.h +++ b/test/unit/utJoinVertices.h @@ -4,7 +4,7 @@ #include #include -#include +#include #include diff --git a/test/unit/utLimitBoneWeights.h b/test/unit/utLimitBoneWeights.h index 3affcd0f2..dd709dda3 100644 --- a/test/unit/utLimitBoneWeights.h +++ b/test/unit/utLimitBoneWeights.h @@ -4,7 +4,7 @@ #include #include -#include +#include #include diff --git a/test/unit/utMaterialSystem.h b/test/unit/utMaterialSystem.h index f31a58b4e..8a35cf650 100644 --- a/test/unit/utMaterialSystem.h +++ b/test/unit/utMaterialSystem.h @@ -4,9 +4,7 @@ #include #include -#include -#include -#include +#include #include diff --git a/test/unit/utPretransformVertices.h b/test/unit/utPretransformVertices.h index af77725ec..2f5754c3c 100644 --- a/test/unit/utPretransformVertices.h +++ b/test/unit/utPretransformVertices.h @@ -4,7 +4,7 @@ #include #include -#include +#include #include diff --git a/test/unit/utRemoveComments.h b/test/unit/utRemoveComments.h index ca723975e..aef61db88 100644 --- a/test/unit/utRemoveComments.h +++ b/test/unit/utRemoveComments.h @@ -4,7 +4,6 @@ #include #include -#include "types.h" #include diff --git a/test/unit/utRemoveComponent.h b/test/unit/utRemoveComponent.h index bb2d86f90..1eeb31e65 100644 --- a/test/unit/utRemoveComponent.h +++ b/test/unit/utRemoveComponent.h @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include diff --git a/test/unit/utRemoveRedundantMaterials.h b/test/unit/utRemoveRedundantMaterials.h index ef9f8c888..388c7dd66 100644 --- a/test/unit/utRemoveRedundantMaterials.h +++ b/test/unit/utRemoveRedundantMaterials.h @@ -4,9 +4,7 @@ #include #include -#include -#include -#include +#include #include #include diff --git a/test/unit/utScenePreprocessor.h b/test/unit/utScenePreprocessor.h index 80ef6d797..8ebc4b0c0 100644 --- a/test/unit/utScenePreprocessor.h +++ b/test/unit/utScenePreprocessor.h @@ -7,9 +7,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include using namespace std; diff --git a/test/unit/utSharedPPData.h b/test/unit/utSharedPPData.h index f9262767e..601420e1d 100644 --- a/test/unit/utSharedPPData.h +++ b/test/unit/utSharedPPData.h @@ -4,8 +4,7 @@ #include #include -#include -#include +#include #include diff --git a/test/unit/utSortByPType.h b/test/unit/utSortByPType.h index 27500d3bd..2590bb2b3 100644 --- a/test/unit/utSortByPType.h +++ b/test/unit/utSortByPType.h @@ -4,8 +4,7 @@ #include #include -#include -#include +#include #include diff --git a/test/unit/utSplitLargeMeshes.h b/test/unit/utSplitLargeMeshes.h index 9fc299f0e..37eaa8ef6 100644 --- a/test/unit/utSplitLargeMeshes.h +++ b/test/unit/utSplitLargeMeshes.h @@ -4,9 +4,7 @@ #include #include -#include -#include -#include +#include #include diff --git a/test/unit/utTriangulate.h b/test/unit/utTriangulate.h index 5e33f7331..426aba94c 100644 --- a/test/unit/utTriangulate.h +++ b/test/unit/utTriangulate.h @@ -4,9 +4,7 @@ #include #include -#include -#include -#include +#include #include diff --git a/test/unit/utVertexTriangleAdjacency.h b/test/unit/utVertexTriangleAdjacency.h index 8a59cf28d..ed2646fc1 100644 --- a/test/unit/utVertexTriangleAdjacency.h +++ b/test/unit/utVertexTriangleAdjacency.h @@ -4,8 +4,8 @@ #include #include -#include "types.h" -#include "mesh.h" +#include "assimp/types.h" +#include "assimp/mesh.h" #include