From e72dbad13086c9c2a32e7ec9967e1d4149fb2c2f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 23 Sep 2016 10:22:14 +0200 Subject: [PATCH] Refactoring: rename ModelDiffer to Scenediffer. --- test/CMakeLists.txt | 4 ++-- .../unit/{ModelDiffer.cpp => SceneDiffer.cpp} | 20 +++++++++---------- test/unit/{ModelDiffer.h => SceneDiffer.h} | 6 +++--- test/unit/utObjImportExport.cpp | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) rename test/unit/{ModelDiffer.cpp => SceneDiffer.cpp} (96%) rename test/unit/{ModelDiffer.h => SceneDiffer.h} (97%) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 322757776..7c14dff0e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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 diff --git a/test/unit/ModelDiffer.cpp b/test/unit/SceneDiffer.cpp similarity index 96% rename from test/unit/ModelDiffer.cpp rename to test/unit/SceneDiffer.cpp index 8858ce8c5..0858c30fb 100644 --- a/test/unit/ModelDiffer.cpp +++ b/test/unit/SceneDiffer.cpp @@ -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 #include #include @@ -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; } diff --git a/test/unit/ModelDiffer.h b/test/unit/SceneDiffer.h similarity index 97% rename from test/unit/ModelDiffer.h rename to test/unit/SceneDiffer.h index fac5def84..7dc5973ff 100644 --- a/test/unit/ModelDiffer.h +++ b/test/unit/SceneDiffer.h @@ -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(); diff --git a/test/unit/utObjImportExport.cpp b/test/unit/utObjImportExport.cpp index 63d2c4ee5..14fc6b0f2 100644 --- a/test/unit/utObjImportExport.cpp +++ b/test/unit/utObjImportExport.cpp @@ -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 #include @@ -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(); }