return doctest instead catch

This commit is contained in:
BlackMATov
2021-02-11 12:48:39 +07:00
parent 74a716ee67
commit 1e4e6de05e
14 changed files with 6357 additions and 17974 deletions

View File

@@ -5,7 +5,6 @@
******************************************************************************/
#include "vmath_tests.hpp"
#include "catch/catch.hpp"
namespace
{
@@ -31,7 +30,7 @@ namespace
}
TEST_CASE("vmath/mat_fun") {
SECTION("detail") {
SUBCASE("detail") {
STATIC_REQUIRE(map_join([](const int2& x){
return x * 2;
}, int2x2{}) == int2x2(2,0,0,2));
@@ -57,7 +56,7 @@ TEST_CASE("vmath/mat_fun") {
}, int2x2{}) == int2(1,1));
}
SECTION("operators") {
SUBCASE("operators") {
STATIC_REQUIRE(+int2x2(1,-2,3,-4) == int2x2(1,-2,3,-4));
STATIC_REQUIRE(-int2x2(1,-2,3,-4) == int2x2(-1,2,-3,4));
STATIC_REQUIRE(~uint2x2(0xF0F0F0F0,0x0F0F0F0F,0xF0F0F0F0,0x0F0F0F0F) == uint2x2(0x0F0F0F0F,0xF0F0F0F0,0x0F0F0F0F,0xF0F0F0F0));
@@ -164,7 +163,7 @@ TEST_CASE("vmath/mat_fun") {
}
}
SECTION("relational functions") {
SUBCASE("relational functions") {
STATIC_REQUIRE_FALSE(any(bool2x2(false, false, false, false)));
STATIC_REQUIRE(any(bool2x2(true, false, true, false)));
STATIC_REQUIRE(any(bool2x2(false, true, false, true)));
@@ -199,7 +198,7 @@ TEST_CASE("vmath/mat_fun") {
STATIC_REQUIRE(not_equal_to(int2x2(1,1,1,1), int2x2(0,1,2,3)) == bool2x2(true, false, true, true));
}
SECTION("transpose") {
SUBCASE("transpose") {
STATIC_REQUIRE(transpose(int2x2(
1, 2,
3, 4
@@ -231,7 +230,7 @@ TEST_CASE("vmath/mat_fun") {
));
}
SECTION("determinant") {
SUBCASE("determinant") {
constexpr int2x2 m2{1,2,3,4};
constexpr int3x3 m3{1,2,3,4,5,6,7,8,9};
constexpr int4x4 m4{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
@@ -248,7 +247,7 @@ TEST_CASE("vmath/mat_fun") {
STATIC_REQUIRE(determinant(transpose(generate_frank_matrix<int, 4>())) == 1);
}
SECTION("inverse") {
SUBCASE("inverse") {
STATIC_REQUIRE(inverse(float2x2()) == float2x2());
STATIC_REQUIRE(inverse(float3x3()) == float3x3());
STATIC_REQUIRE(inverse(float4x4()) == float4x4());