Translated tests for Vector3

This commit is contained in:
Leonetienne 2022-02-11 13:40:22 +01:00
parent 56d712a7f2
commit 59f1164458
4 changed files with 1472 additions and 1609 deletions

View File

@ -20,6 +20,7 @@ add_executable(Tests
Math__Min.cpp
Math__Similar.cpp
Matrix4x4.cpp
Vector3.cpp
)
target_link_libraries(Tests Eule)

View File

@ -1,61 +0,0 @@
#include "CppUnitTest.h"
#include "../Eule/Math.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace Eule;
namespace _Math
{
TEST_CLASS(_Similar)
{
public:
// Checks that the similar function works with an exact comparison -> true
TEST_METHOD(Exact_Comparison_True)
{
Assert::IsTrue(Math::Similar(100, 100, 0));
return;
}
// Checks that the similar function works with an exact comparison -> false
TEST_METHOD(Exact_Comparison_False)
{
Assert::IsFalse(Math::Similar(100, 100.001, 0));
return;
}
// Checks that the similar function works with an exact comparison -> false
TEST_METHOD(Exact_Comparison_False2)
{
Assert::IsFalse(Math::Similar(100, 99.999, 0));
return;
}
// Checks that the similar function works with a loose comparison -> true
TEST_METHOD(Loose_Comparison_True)
{
Assert::IsTrue(Math::Similar(100, 100.001, 0.01));
return;
}
// Checks that the similar function works with a loose comparison -> true
TEST_METHOD(Loose_Comparison_True2)
{
Assert::IsTrue(Math::Similar(100, 99.999, 0.01));
return;
}
// Checks that the similar function works with a loose comparison -> false
TEST_METHOD(Loose_Comparison_False)
{
Assert::IsFalse(Math::Similar(100, 100.1, 0.01));
return;
}
// Checks that the similar function works with a loose comparison -> false
TEST_METHOD(Loose_Comparison_False2)
{
Assert::IsFalse(Math::Similar(100, 99.9, 0.01));
return;
}
};
}

View File

@ -10,7 +10,6 @@ namespace {
static std::mt19937 rng = std::mt19937((std::random_device())());
}
// Tests that a freshly created matrix is an identity matrix
TEST_CASE(__FILE__"/New_Matrix_Is_Identity", "[Matrix4x4]")
{

File diff suppressed because it is too large Load Diff