Refactoring: rename ModelDiffer to Scenediffer.
authorKim Kulling <kim.kulling@googlemail.com>
Fri, 23 Sep 2016 08:22:14 +0000 (10:22 +0200)
committerKim Kulling <kim.kulling@googlemail.com>
Fri, 23 Sep 2016 08:22:14 +0000 (10:22 +0200)
test/CMakeLists.txt
test/unit/SceneDiffer.cpp [moved from test/unit/ModelDiffer.cpp with 96% similarity]
test/unit/SceneDiffer.h [moved from test/unit/ModelDiffer.h with 97% similarity]
test/unit/utObjImportExport.cpp

index 3227577..7c14dff 100644 (file)
@@ -76,8 +76,8 @@ SET( TEST_SRCS
   unit/utMaterialSystem.cpp
   unit/utMatrix3x3.cpp
   unit/utMatrix4x4.cpp
-  unit/ModelDiffer.h
-  unit/ModelDiffer.cpp
+  unit/SceneDiffer.h
+  unit/SceneDiffer.cpp
   unit/utObjImportExport.cpp
   unit/utPretransformVertices.cpp
   unit/utRemoveComments.cpp
similarity index 96%
rename from test/unit/ModelDiffer.cpp
rename to test/unit/SceneDiffer.cpp
index 8858ce8..0858c30 100644 (file)
@@ -38,7 +38,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ---------------------------------------------------------------------------
 */
-#include "ModelDiffer.h"
+#include "SceneDiffer.h"
 #include <assimp/scene.h>
 #include <assimp/mesh.h>
 #include <assimp/material.h>
@@ -46,15 +46,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 using namespace Assimp;
 
-ModelDiffer::ModelDiffer() {
+SceneDiffer::SceneDiffer() {
     // empty
 }
 
-ModelDiffer::~ModelDiffer() {
+SceneDiffer::~SceneDiffer() {
     // empty
 }
 
-bool ModelDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) {
+bool SceneDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) {
     if ( expected == toCompare ) {
         return true;
     }
@@ -115,7 +115,7 @@ bool ModelDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) {
     return true;
 }
 
-void ModelDiffer::showReport() {
+void SceneDiffer::showReport() {
     if ( m_diffs.empty() ) {
         return;
     }
@@ -127,11 +127,11 @@ void ModelDiffer::showReport() {
     std::cout << std::endl;
 }
 
-void ModelDiffer::reset() {
+void SceneDiffer::reset() {
     m_diffs.resize( 0 );
 }
 
-void ModelDiffer::addDiff( const std::string &diff ) {
+void SceneDiffer::addDiff( const std::string &diff ) {
     if ( diff.empty() ) {
         return;
     }
@@ -150,7 +150,7 @@ static std::string dumpColor4D( const aiColor4D &toDump ) {
     return stream.str();
 }
 
-bool ModelDiffer::compareMesh( aiMesh *expected, aiMesh *toCompare ) {
+bool SceneDiffer::compareMesh( aiMesh *expected, aiMesh *toCompare ) {
     if ( expected == toCompare ) {
         return true;
     }
@@ -313,7 +313,7 @@ bool ModelDiffer::compareMesh( aiMesh *expected, aiMesh *toCompare ) {
     return true;
 }
 
-bool ModelDiffer::compareFace( aiFace *expected, aiFace *toCompare ) {
+bool SceneDiffer::compareFace( aiFace *expected, aiFace *toCompare ) {
     if ( nullptr == expected ) {
         return false;
     }
@@ -334,7 +334,7 @@ bool ModelDiffer::compareFace( aiFace *expected, aiFace *toCompare ) {
     return false;
 }
 
-bool ModelDiffer::compareMaterial( aiMaterial *expected, aiMaterial *toCompare ) {
+bool SceneDiffer::compareMaterial( aiMaterial *expected, aiMaterial *toCompare ) {
     if ( nullptr == expected ) {
         return false;
     }
similarity index 97%
rename from test/unit/ModelDiffer.h
rename to test/unit/SceneDiffer.h
index fac5def..7dc5973 100644 (file)
@@ -50,10 +50,10 @@ struct aiMesh;
 struct aiMaterial;
 struct aiFace;
 
-class ModelDiffer {
+class SceneDiffer {
 public:
-    ModelDiffer();
-    ~ModelDiffer();
+    SceneDiffer();
+    ~SceneDiffer();
     bool isEqual( const aiScene *expected, const aiScene *toCompare );
     void showReport();
     void reset();
index 63d2c4e..14fc6b0 100644 (file)
@@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 #include "UnitTestPCH.h"
-#include "ModelDiffer.h"
+#include "SceneDiffer.h"
 
 #include <assimp/Importer.hpp>
 #include <assimp/scene.h>
@@ -139,7 +139,7 @@ TEST_F( utObjImportExport, obj_import_test ) {
     aiScene *expected = createScene();
     EXPECT_NE( nullptr, scene );
 
-    ModelDiffer differ;
+    SceneDiffer differ;
     EXPECT_TRUE( differ.isEqual( expected, scene ) );
     differ.showReport();
 }