reformat unittests.

This commit is contained in:
Kim Kulling
2020-03-22 12:13:09 +01:00
parent edc73552cd
commit 68a9fa2df3
77 changed files with 2555 additions and 1632 deletions
+17 -25
View File
@@ -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