Bug/evaluate matrix4x4 access (#5936)

* Add test for 3x3 matrices and 4x4 matrix access
This commit is contained in:
Kim Kulling
2024-12-23 16:33:37 +01:00
committed by GitHub
parent 9f3a7e95ab
commit 1ce3164bc2
10 changed files with 85 additions and 62 deletions

View File

@@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2024, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
@@ -42,6 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "UnitTestPCH.h"
#include "MathTest.h"
#include <array>
using namespace Assimp;
@@ -158,3 +157,18 @@ TEST_F(AssimpAPITest_aiMatrix3x3, aiMatrix3FromToTest) {
aiMatrix3FromTo(&result_c, &from, &to);
EXPECT_EQ(result_cpp, result_c);
}
TEST_F(AssimpAPITest_aiMatrix3x3, operatorTest) {
std::array<ai_real, 9> value = { 1, 2, 3, 4, 5, 6, 7, 8,9};
result_cpp = aiMatrix3x3( value[0], value[1], value[2], value[3],
value[4], value[5], value[6], value[7],
value[8]);
size_t idx=0;
for (unsigned int i = 0; i < 3; ++i) {
for (unsigned int j = 0; j < 3; ++j) {
ai_real curValue = result_cpp[i][j];
EXPECT_EQ(curValue, value[idx]);
idx++;
}
}
}