Files
j3ml/tests/LinearAlgebra/Vector4Tests.hpp
josh 1285b85fbd
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 2m2s
Build Docs With Doxygen / Explore-Gitea-Actions (push) Successful in 33s
Add AxisAngle members and fill out more unit tests.
2025-03-05 02:12:53 -05:00

138 lines
2.5 KiB
C++

#include <J3ML/LinearAlgebra/Vector4.hpp>
#include <jtest/jtest.hpp>
#include <jtest/Unit.hpp>
using Vector4 = J3ML::LinearAlgebra::Vector4;
namespace jtest
{
void check_v4_eq(const Vector4& lhs, const Vector4& rhs)
{
check_float_eq(lhs.x, rhs.x);
check_float_eq(lhs.y, rhs.y);
check_float_eq(lhs.z, rhs.z);
check_float_eq(lhs.w, rhs.w);
}
}
jtest::Unit Vector4Unit {"Vector4"};
namespace Vector4Tests
{
inline void Define()
{
using namespace jtest;
Vector4Unit += Test("Vector4()", []{
jtest::check_v4_eq(Vector4(), Vector4::Zero);
});
Vector4Unit += Test("Vector4(float x, float y, float z, float) w", []{
Vector4 Input (0, 1, 0, 1);
jtest::check_float_eq(Input.x, 0);
jtest::check_float_eq(Input.y, 1);
jtest::check_float_eq(Input.z, 0);
jtest::check_float_eq(Input.w, 1);
});
Vector4Unit += Test("Addition_Op", [] {
Vector4 A (1, 1, 1, 1);
Vector4 B (2, 2, 2, 2);
Vector4 ExpectedResult (3, 3, 3, 3);
jtest::check_v4_eq(A + B, ExpectedResult);
});
Vector4Unit += Test("Addition_Method", [] {
Vector4 A (1, 2, 3, 4);
Vector4 B (2, 2, 2, 2);
Vector4 Expected(3, 4, 5, 6);
jtest::check_v4_eq(A.Add(B), Expected);
});
Vector4Unit += Test("Addition_Static", [] {
});
}
inline void Run()
{
Vector4Unit.RunAll();
}
}
/*TEST(Vector4Test, V4_Addition_Method)
{
}
TEST(Vector4Test, V4_Addition_Static)
{
}
TEST(Vector4Test, V4_Subtract_Op)
{
}
TEST(Vector4Test, V4_Subtract_Method)
{
}
TEST(Vector4Test, V4_Subtract_Static)
{
}
TEST(Vector4Test, V4_Scalar_Mult_Op)
{
}
TEST(Vector4Test, V4_Scalar_Mult_Method)
{
}
TEST(Vector4Test, V4_Scalar_Mult_Static)
{
}
TEST(Vector4Test, V4_Scalar_Div_Op)
{
}
TEST(Vector4Test, V4_Scalar_Div_Method)
{
}
TEST(Vector4Test, V4_Scalar_Div_Static)
{
}
TEST(Vector4Test, V4_Sizeof)
{
}
TEST(Vector4Test, V4_NaN)
{
}
TEST(Vector4Tests, V4_Min) {}
TEST(Vector4Tests, V4_Max) {}
TEST(Vector4Tests, V4_Clamp) {}
TEST(Vector4Tests, V4_DotProduct) {}
TEST(Vector4Tests, V4_CrossProduct) {}
TEST(Vector4Tests, V4_Project) {}
TEST(Vector4Test, V4_Normalize) {}*/