reformat unittests.
This commit is contained in:
@@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
|
||||
|
||||
Copyright (c) 2006-2020, assimp team
|
||||
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
@@ -43,32 +41,27 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "UnitTestPCH.h"
|
||||
|
||||
#include <assimp/cexport.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/postprocess.h>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
|
||||
class BlendImportMaterials : public ::testing::Test {
|
||||
public:
|
||||
|
||||
virtual void SetUp()
|
||||
{
|
||||
void SetUp() override {
|
||||
im = new Assimp::Importer();
|
||||
}
|
||||
|
||||
virtual void TearDown()
|
||||
{
|
||||
void TearDown() override {
|
||||
delete im;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
Assimp::Importer* im;
|
||||
Assimp::Importer *im;
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
TEST_F(BlendImportMaterials, testImportMaterial)
|
||||
{
|
||||
const aiScene* pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderMaterial_269.blend", aiProcess_ValidateDataStructure);
|
||||
TEST_F(BlendImportMaterials, testImportMaterial) {
|
||||
const aiScene *pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderMaterial_269.blend", aiProcess_ValidateDataStructure);
|
||||
ASSERT_TRUE(pTest != NULL);
|
||||
ASSERT_TRUE(pTest->HasMaterials());
|
||||
|
||||
@@ -76,15 +69,15 @@ TEST_F(BlendImportMaterials, testImportMaterial)
|
||||
|
||||
auto alpha = pTest->mMaterials[0];
|
||||
|
||||
#define ASSERT_PROPERTY_EQ(expected, key, var) \
|
||||
auto var = expected; \
|
||||
ASSERT_EQ(aiReturn_SUCCESS, alpha->Get("$mat.blend." key, 0, 0, var)); \
|
||||
ASSERT_EQ(expected, var);
|
||||
#define ASSERT_PROPERTY_EQ(expected, key, var) \
|
||||
auto var = expected; \
|
||||
ASSERT_EQ(aiReturn_SUCCESS, alpha->Get("$mat.blend." key, 0, 0, var)); \
|
||||
ASSERT_EQ(expected, var);
|
||||
|
||||
#define ASSERT_PROPERTY_FLOAT_EQ(expected, key, var) \
|
||||
auto var = expected; \
|
||||
ASSERT_EQ(aiReturn_SUCCESS, alpha->Get("$mat.blend." key, 0, 0, var)); \
|
||||
ASSERT_FLOAT_EQ(expected, var);
|
||||
#define ASSERT_PROPERTY_FLOAT_EQ(expected, key, var) \
|
||||
auto var = expected; \
|
||||
ASSERT_EQ(aiReturn_SUCCESS, alpha->Get("$mat.blend." key, 0, 0, var)); \
|
||||
ASSERT_FLOAT_EQ(expected, var);
|
||||
|
||||
ASSERT_PROPERTY_EQ(aiColor3D(0.1f, 0.2f, 0.3f), "diffuse.color", diffuseColor);
|
||||
ASSERT_PROPERTY_EQ(0.4f, "diffuse.intensity", diffuseIntensity);
|
||||
@@ -126,9 +119,8 @@ TEST_F(BlendImportMaterials, testImportMaterial)
|
||||
ASSERT_PROPERTY_FLOAT_EQ(0.87f, "mirror.glossAnisotropic", mirrorGlossAnisotropic);
|
||||
}
|
||||
|
||||
TEST_F(BlendImportMaterials, testImportMaterialwith2texturesAnd2TexCoordMappings)
|
||||
{
|
||||
const aiScene* pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/plane_2_textures_2_texcoords_279.blend", aiProcess_ValidateDataStructure);
|
||||
TEST_F(BlendImportMaterials, testImportMaterialwith2texturesAnd2TexCoordMappings) {
|
||||
const aiScene *pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/plane_2_textures_2_texcoords_279.blend", aiProcess_ValidateDataStructure);
|
||||
ASSERT_TRUE(pTest != NULL);
|
||||
|
||||
// material has 2 diffuse textures
|
||||
|
||||
Reference in New Issue
Block a user