update assimp to 5.2.5 Bugfix-Release

This commit is contained in:
AzaezelX 2023-05-28 11:19:45 -05:00
parent 360edf18a1
commit c3f53b99ea
886 changed files with 7946 additions and 524449 deletions

View file

@ -44,6 +44,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using namespace ::Assimp;
AbstractImportExportBase::~AbstractImportExportBase() {
// empty
}
AbstractImportExportBase::~AbstractImportExportBase() = default;

View file

@ -47,26 +47,35 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using namespace std;
using namespace Assimp;
class Base64Test : public ::testing::Test {
public:
virtual void SetUp() {
}
virtual void TearDown() {
}
};
class Base64Test : public ::testing::Test {};
static const std::vector<uint8_t> assimpStringBinary = { 97, 115, 115, 105, 109, 112 };
static const std::string assimpStringEncoded = "YXNzaW1w";
TEST_F( Base64Test, encodeTest ) {
EXPECT_EQ( "", Base64::Encode (std::vector<uint8_t>{}) );
EXPECT_EQ( "Vg==", Base64::Encode (std::vector<uint8_t>{ 86 }) );
EXPECT_EQ( assimpStringEncoded, Base64::Encode (assimpStringBinary) );
TEST_F( Base64Test, encodeTest) {
EXPECT_EQ( "", Base64::Encode(std::vector<uint8_t>{}) );
EXPECT_EQ( "Vg==", Base64::Encode(std::vector<uint8_t>{ 86 }) );
EXPECT_EQ( assimpStringEncoded, Base64::Encode(assimpStringBinary) );
}
TEST_F( Base64Test, decodeTest ) {
EXPECT_EQ( std::vector<uint8_t> {}, Base64::Decode ("") );
EXPECT_EQ( std::vector<uint8_t> { 86 }, Base64::Decode ("Vg==") );
EXPECT_EQ( assimpStringBinary, Base64::Decode (assimpStringEncoded) );
TEST_F( Base64Test, encodeTestWithNullptr ) {
std::string out;
Base64::Encode(nullptr, 100u, out);
EXPECT_TRUE(out.empty());
Base64::Encode(&assimpStringBinary[0], 0u, out);
EXPECT_TRUE(out.empty());
}
TEST_F( Base64Test, decodeTest) {
EXPECT_EQ( std::vector<uint8_t> {}, Base64::Decode("") );
EXPECT_EQ( std::vector<uint8_t> { 86 }, Base64::Decode("Vg==") );
EXPECT_EQ( assimpStringBinary, Base64::Decode(assimpStringEncoded) );
}
TEST_F(Base64Test, decodeTestWithNullptr) {
uint8_t *out = nullptr;
size_t size = Base64::Decode(nullptr, 100u, out);
EXPECT_EQ(nullptr, out);
EXPECT_EQ(0u, size);
}

View file

@ -0,0 +1,110 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2022, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
#include "TestIOSystem.h"
#include "UnitTestPCH.h"
#include "Common/BaseProcess.h"
#include "Common/AssertHandler.h"
using namespace Assimp;
class BaseProcessTest : public ::testing::Test {
public:
static void test_handler( const char*, const char*, int ) {
HandlerWasCalled = true;
}
void SetUp() override {
HandlerWasCalled = false;
setAiAssertHandler(test_handler);
}
void TearDown() override {
setAiAssertHandler(nullptr);
}
static bool handlerWasCalled() {
return HandlerWasCalled;
}
private:
static bool HandlerWasCalled;
};
bool BaseProcessTest::HandlerWasCalled = false;
class TestingBaseProcess : public BaseProcess {
public:
TestingBaseProcess() : BaseProcess() {
// empty
}
~TestingBaseProcess() override = default;
bool IsActive( unsigned int ) const override {
return true;
}
void Execute(aiScene*) override {
}
};
TEST_F( BaseProcessTest, constructTest ) {
bool ok = true;
try {
TestingBaseProcess process;
} catch (...) {
ok = false;
}
EXPECT_TRUE(ok);
}
TEST_F( BaseProcessTest, executeOnSceneTest ) {
TestingBaseProcess process;
process.ExecuteOnScene(nullptr);
#ifdef ASSIMP_BUILD_DEBUG
EXPECT_TRUE(BaseProcessTest::handlerWasCalled());
#else
EXPECT_FALSE(BaseProcessTest::handlerWasCalled());
#endif
}

View file

@ -0,0 +1,56 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2022, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
#include "UnitTestPCH.h"
#include <assimp/Hash.h>
using namespace Assimp;
class utHash : public ::testing::Test {
// empty
};
TEST_F( utHash, SuperFastHashTest ) {
const char *Data = "-21416115v";
auto result = SuperFastHash(Data, 10);
EXPECT_NE(0u, result);
}

View file

@ -0,0 +1,54 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2022, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
#include "UnitTestPCH.h"
#include "Common/Maybe.h"
using namespace Assimp;
class utMaybe : public ::testing::Test {
// empty
};
TEST_F(utMaybe, creationTest) {
Maybe<int> first(1);
EXPECT_EQ(first.Get(), 1);
}

View file

@ -55,9 +55,7 @@ public:
// empty
}
virtual ~TestProgressHandler() {
// empty
}
virtual ~TestProgressHandler() = default;
bool Update(float percentage = -1.f) override {
mPercentage = percentage;
@ -104,4 +102,4 @@ TEST_F(ExporterTest, ExporterIdTest) {
EXPECT_EQ(nullptr, desc) << "More exporters than claimed";
}
#endif
#endif

View file

@ -1,6 +1,5 @@
#include "../../include/assimp/DefaultLogger.hpp"
#include "UnitTestPCH.h"
#include <math.h>
#include <time.h>

View file

@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2022, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,

View file

@ -53,9 +53,7 @@ SceneDiffer::SceneDiffer()
// empty
}
SceneDiffer::~SceneDiffer() {
// empty
}
SceneDiffer::~SceneDiffer() = default;
bool SceneDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) {
if ( expected == toCompare ) {

View file

@ -56,7 +56,7 @@ public:
virtual void write(const char* message) {
if ( nullptr != message ) {
m_messages.push_back( std::string( message ) );
m_messages.emplace_back(message);
}
}

View file

@ -69,7 +69,7 @@ TEST_F(BlendImportAreaLight, testImportLight) {
std::vector<std::pair<std::string, size_t>> lightNames;
for (size_t i = 0; i < pTest->mNumLights; i++) {
lightNames.push_back(std::make_pair(pTest->mLights[i]->mName.C_Str(), i));
lightNames.emplace_back(pTest->mLights[i]->mName.C_Str(), i);
}
std::sort(lightNames.begin(), lightNames.end());

View file

@ -64,8 +64,7 @@ TEST_F(utBlenderImporterExporter, importBlenFromFileTest) {
TEST(utBlenderImporter, import4cubes) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/4Cubes4Mats_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, import269_regress1) {
@ -77,22 +76,19 @@ TEST(utBlenderImporter, import269_regress1) {
TEST(utBlenderImporter, importBlenderDefault248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importBlenderDefault250) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importBlenderDefault250Compressed) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250_Compressed.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importBlenderDefault262) {
@ -123,92 +119,79 @@ TEST(utBlenderImporter, importBlenderDefault293) {
TEST(utBlenderImporter, importCubeHierarchy_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/CubeHierarchy_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importHuman) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/HUMAN.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importMirroredCube_252) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/MirroredCube_252.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importNoisyTexturedCube_VoronoiGlob_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/NoisyTexturedCube_VoronoiGlob_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importSmoothVsSolidCube_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SmoothVsSolidCube_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importSuzanne_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/Suzanne_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importSuzanneSubdiv_252) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SuzanneSubdiv_252.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importTexturedCube_ImageGlob_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedCube_ImageGlob_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importTexturedPlane_ImageUv_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUv_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importTexturedPlane_ImageUvPacked_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUvPacked_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importTorusLightsCams_250_compressed) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TorusLightsCams_250_compressed.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, import_yxa_1) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/yxa_1.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importBob) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/BLEND/Bob.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importFleurOptonl) {

View file

@ -69,31 +69,44 @@ public:
virtual bool importerTest() final {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck.dae", aiProcess_ValidateDataStructure);
if (scene == nullptr)
return false;
{
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck.dae", aiProcess_ValidateDataStructure);
if (scene == nullptr)
return false;
// Expected number of items
EXPECT_EQ(scene->mNumMeshes, 1u);
EXPECT_EQ(scene->mNumMaterials, 1u);
EXPECT_EQ(scene->mNumAnimations, 0u);
EXPECT_EQ(scene->mNumTextures, 0u);
EXPECT_EQ(scene->mNumLights, 1u);
EXPECT_EQ(scene->mNumCameras, 1u);
// Expected number of items
EXPECT_EQ(scene->mNumMeshes, 1u);
EXPECT_EQ(scene->mNumMaterials, 1u);
EXPECT_EQ(scene->mNumAnimations, 0u);
EXPECT_EQ(scene->mNumTextures, 0u);
EXPECT_EQ(scene->mNumLights, 1u);
EXPECT_EQ(scene->mNumCameras, 1u);
// Expected common metadata
aiString value;
EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_FORMAT, value)) << "No importer format metadata";
EXPECT_STREQ("Collada Importer", value.C_Str());
// Expected common metadata
aiString value;
EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_FORMAT, value)) << "No importer format metadata";
EXPECT_STREQ("Collada Importer", value.C_Str());
EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_FORMAT_VERSION, value)) << "No format version metadata";
EXPECT_STREQ("1.4.1", value.C_Str());
EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_FORMAT_VERSION, value)) << "No format version metadata";
EXPECT_STREQ("1.4.1", value.C_Str());
EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_GENERATOR, value)) << "No generator metadata";
EXPECT_EQ(strncmp(value.C_Str(), "Maya 8.0", 8), 0) << "AI_METADATA_SOURCE_GENERATOR was: " << value.C_Str();
EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_GENERATOR, value)) << "No generator metadata";
EXPECT_EQ(strncmp(value.C_Str(), "Maya 8.0", 8), 0) << "AI_METADATA_SOURCE_GENERATOR was: " << value.C_Str();
EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_COPYRIGHT, value)) << "No copyright metadata";
EXPECT_EQ(strncmp(value.C_Str(), "Copyright 2006", 14), 0) << "AI_METADATA_SOURCE_COPYRIGHT was: " << value.C_Str();
EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_COPYRIGHT, value)) << "No copyright metadata";
EXPECT_EQ(strncmp(value.C_Str(), "Copyright 2006", 14), 0) << "AI_METADATA_SOURCE_COPYRIGHT was: " << value.C_Str();
}
{
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/box_nested_animation.dae", aiProcess_ValidateDataStructure);
if (scene == nullptr)
return false;
// Expect only one animation with the correct name
EXPECT_EQ(scene->mNumAnimations, 1u);
EXPECT_EQ(std::string(scene->mAnimations[0]->mName.C_Str()), std::string("Armature"));
}
return true;
}

View file

@ -423,3 +423,10 @@ TEST_F(utFBXImporterExporter, importMaxPbrMaterialsSpecularGloss) {
ASSERT_EQ(mat->Get("$raw.3dsMax|main|emit_color", aiTextureType_NONE, 0, emitColor), aiReturn_SUCCESS);
EXPECT_EQ(emitColor, aiColor4D(1, 0, 1, 1));
}
TEST_F(utFBXImporterExporter, importSkeletonTest) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/FBX/animation_with_skeleton.fbx", aiProcess_ValidateDataStructure);
ASSERT_NE(nullptr, scene);
ASSERT_TRUE(scene->mRootNode);
}

View file

@ -114,7 +114,7 @@ TEST_F(LimitBoneWeightsTest, testProcess) {
aiBone &pcBone = **(mMesh->mBones + i);
for (unsigned int q = 0; q < pcBone.mNumWeights; ++q) {
aiVertexWeight weight = pcBone.mWeights[q];
asWeights[weight.mVertexId].push_back(LimitBoneWeightsProcess::Weight(i, weight.mWeight));
asWeights[weight.mVertexId].emplace_back(i, weight.mWeight);
}
}

View file

@ -55,9 +55,7 @@ public:
// empty
}
~TestObjFileParser() {
// empty
}
~TestObjFileParser() = default;
void testCopyNextWord(char *pBuffer, size_t length) {
copyNextWord(pBuffer, length);

View file

@ -40,6 +40,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "AbstractImportExportBase.h"
#include <assimp/scene.h>
#include "UnitTestPCH.h"
#include <assimp/Importer.hpp>
@ -51,11 +53,12 @@ public:
bool importerTest() override {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/OpenGEX/Example.ogex", 0);
EXPECT_EQ(1u, scene->mNumMeshes);
return nullptr != scene;
}
};
TEST_F(utOpenGEXImportExport, importLWSFromFileTest) {
TEST_F(utOpenGEXImportExport, importOpenGexFromFileTest) {
EXPECT_TRUE(importerTest());
}

View file

@ -42,6 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "UnitTestPCH.h"
#include "AbstractImportExportBase.h"
#include "AssetLib/MMD/MMDImporter.h"
#include "assimp/postprocess.h"
#include <assimp/Importer.hpp>
@ -51,9 +52,8 @@ class utPMXImporter : public AbstractImportExportBase {
public:
virtual bool importerTest() {
Assimp::Importer importer;
/*const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/../models-nonbsd/MMD/Alicia_blade.pmx", aiProcess_ValidateDataStructure );
return nullptr != scene;*/
return true;
const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/../models-nonbsd/MMD/Alicia_blade.pmx", aiProcess_ValidateDataStructure );
return nullptr != scene;
}
};

View file

@ -61,7 +61,7 @@ TEST_F( utVersion, aiGetVersionMajorTest ) {
}
TEST_F( utVersion, aiGetVersionPatchTest ) {
EXPECT_EQ(aiGetVersionPatch(), 0U );
EXPECT_EQ(aiGetVersionPatch(), 4U );
}
TEST_F( utVersion, aiGetCompileFlagsTest ) {