Refactoring: rename ModelDiffer to Scenediffer.
parent
68d33a99a1
commit
e72dbad130
|
@ -76,8 +76,8 @@ SET( TEST_SRCS
|
||||||
unit/utMaterialSystem.cpp
|
unit/utMaterialSystem.cpp
|
||||||
unit/utMatrix3x3.cpp
|
unit/utMatrix3x3.cpp
|
||||||
unit/utMatrix4x4.cpp
|
unit/utMatrix4x4.cpp
|
||||||
unit/ModelDiffer.h
|
unit/SceneDiffer.h
|
||||||
unit/ModelDiffer.cpp
|
unit/SceneDiffer.cpp
|
||||||
unit/utObjImportExport.cpp
|
unit/utObjImportExport.cpp
|
||||||
unit/utPretransformVertices.cpp
|
unit/utPretransformVertices.cpp
|
||||||
unit/utRemoveComments.cpp
|
unit/utRemoveComments.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.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
#include "ModelDiffer.h"
|
#include "SceneDiffer.h"
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
#include <assimp/mesh.h>
|
#include <assimp/mesh.h>
|
||||||
#include <assimp/material.h>
|
#include <assimp/material.h>
|
||||||
|
@ -46,15 +46,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
ModelDiffer::ModelDiffer() {
|
SceneDiffer::SceneDiffer() {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelDiffer::~ModelDiffer() {
|
SceneDiffer::~SceneDiffer() {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) {
|
bool SceneDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) {
|
||||||
if ( expected == toCompare ) {
|
if ( expected == toCompare ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ bool ModelDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelDiffer::showReport() {
|
void SceneDiffer::showReport() {
|
||||||
if ( m_diffs.empty() ) {
|
if ( m_diffs.empty() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -127,11 +127,11 @@ void ModelDiffer::showReport() {
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelDiffer::reset() {
|
void SceneDiffer::reset() {
|
||||||
m_diffs.resize( 0 );
|
m_diffs.resize( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelDiffer::addDiff( const std::string &diff ) {
|
void SceneDiffer::addDiff( const std::string &diff ) {
|
||||||
if ( diff.empty() ) {
|
if ( diff.empty() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ static std::string dumpColor4D( const aiColor4D &toDump ) {
|
||||||
return stream.str();
|
return stream.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelDiffer::compareMesh( aiMesh *expected, aiMesh *toCompare ) {
|
bool SceneDiffer::compareMesh( aiMesh *expected, aiMesh *toCompare ) {
|
||||||
if ( expected == toCompare ) {
|
if ( expected == toCompare ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,7 @@ bool ModelDiffer::compareMesh( aiMesh *expected, aiMesh *toCompare ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelDiffer::compareFace( aiFace *expected, aiFace *toCompare ) {
|
bool SceneDiffer::compareFace( aiFace *expected, aiFace *toCompare ) {
|
||||||
if ( nullptr == expected ) {
|
if ( nullptr == expected ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ bool ModelDiffer::compareFace( aiFace *expected, aiFace *toCompare ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelDiffer::compareMaterial( aiMaterial *expected, aiMaterial *toCompare ) {
|
bool SceneDiffer::compareMaterial( aiMaterial *expected, aiMaterial *toCompare ) {
|
||||||
if ( nullptr == expected ) {
|
if ( nullptr == expected ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
|
@ -50,10 +50,10 @@ struct aiMesh;
|
||||||
struct aiMaterial;
|
struct aiMaterial;
|
||||||
struct aiFace;
|
struct aiFace;
|
||||||
|
|
||||||
class ModelDiffer {
|
class SceneDiffer {
|
||||||
public:
|
public:
|
||||||
ModelDiffer();
|
SceneDiffer();
|
||||||
~ModelDiffer();
|
~SceneDiffer();
|
||||||
bool isEqual( const aiScene *expected, const aiScene *toCompare );
|
bool isEqual( const aiScene *expected, const aiScene *toCompare );
|
||||||
void showReport();
|
void showReport();
|
||||||
void reset();
|
void reset();
|
|
@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "UnitTestPCH.h"
|
#include "UnitTestPCH.h"
|
||||||
#include "ModelDiffer.h"
|
#include "SceneDiffer.h"
|
||||||
|
|
||||||
#include <assimp/Importer.hpp>
|
#include <assimp/Importer.hpp>
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
|
@ -139,7 +139,7 @@ TEST_F( utObjImportExport, obj_import_test ) {
|
||||||
aiScene *expected = createScene();
|
aiScene *expected = createScene();
|
||||||
EXPECT_NE( nullptr, scene );
|
EXPECT_NE( nullptr, scene );
|
||||||
|
|
||||||
ModelDiffer differ;
|
SceneDiffer differ;
|
||||||
EXPECT_TRUE( differ.isEqual( expected, scene ) );
|
EXPECT_TRUE( differ.isEqual( expected, scene ) );
|
||||||
differ.showReport();
|
differ.showReport();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue