mirror of
https://github.com/BlackMATov/vmath.hpp.git
synced 2025-12-16 22:19:51 +07:00
back to catch
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include "vmath_tests.hpp"
|
||||
#include "doctest/doctest.hpp"
|
||||
#include "catch/catch.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -14,7 +14,7 @@ namespace
|
||||
}
|
||||
|
||||
TEST_CASE("vmath/qua_fun") {
|
||||
SUBCASE("Operators") {
|
||||
SECTION("Operators") {
|
||||
STATIC_REQUIRE(+qua(1,-2,3,-4) == qua(1,-2,3,-4));
|
||||
STATIC_REQUIRE(-qua(1,-2,3,-4) == qua(-1,2,-3,4));
|
||||
|
||||
@@ -72,13 +72,13 @@ TEST_CASE("vmath/qua_fun") {
|
||||
STATIC_REQUIRE(float4{1,0,0,2} * fqua{0,0,0.7071067812f,0.7071067812f} == uapprox4(0.f,1.f,0.f,2.f));
|
||||
}
|
||||
|
||||
SUBCASE("Common Functions") {
|
||||
SECTION("Common Functions") {
|
||||
REQUIRE_FALSE(any(isnan(fqua(1,1,1,1))));
|
||||
REQUIRE_FALSE(any(isinf(fqua(1,1,1,1))));
|
||||
REQUIRE(all(isfinite(fqua(1,1,1,1))));
|
||||
}
|
||||
|
||||
SUBCASE("Geometric Functions") {
|
||||
SECTION("Geometric Functions") {
|
||||
STATIC_REQUIRE(dot(qua(1,2,3,4),qua(3,4,5,6)) == 50);
|
||||
|
||||
REQUIRE(length(fqua(10.f,0.f,0.f,0.f)) == uapprox(10.f));
|
||||
@@ -90,7 +90,7 @@ TEST_CASE("vmath/qua_fun") {
|
||||
REQUIRE(normalize(fqua(0.5f,0.f,0.f,0.f)).v == uapprox3(1.f,0.f,0.f));
|
||||
}
|
||||
|
||||
SUBCASE("Relational Functions") {
|
||||
SECTION("Relational Functions") {
|
||||
STATIC_REQUIRE(approx(qua(1,1,1,1), qua(0,1,2,3)) == bool4(false, true, false, false));
|
||||
STATIC_REQUIRE(approx(qua(1,1,1,1), qua(0,1,2,3), 0) == bool4(false, true, false, false));
|
||||
STATIC_REQUIRE(approx(qua(1,1,1,1), qua(0,1,2,3), 1) == bool4(true, true, true, false));
|
||||
@@ -100,7 +100,7 @@ TEST_CASE("vmath/qua_fun") {
|
||||
STATIC_REQUIRE(not_equal_to(qua(1,1,1,1), qua(0,1,2,3)) == bool4(true, false, true, true));
|
||||
}
|
||||
|
||||
SUBCASE("Quaternion Functions") {
|
||||
SECTION("Quaternion Functions") {
|
||||
STATIC_REQUIRE(conjugate(qua(1,2,3,4)) == qua(-1,-2,-3,4));
|
||||
STATIC_REQUIRE(inverse(qua(0.f,0.f,0.7071067812f,0.7071067812f)).v == uapprox3(0.f,0.f,-0.7071067812f));
|
||||
STATIC_REQUIRE(inverse(qua(0.f,0.f,0.7071067812f,0.7071067812f)).s == uapprox(0.7071067812f));
|
||||
|
||||
Reference in New Issue
Block a user