mirror of
https://github.com/BlackMATov/vmath.hpp.git
synced 2025-12-16 14:11:28 +07:00
return doctest instead catch
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include "vmath_tests.hpp"
|
||||
#include "catch/catch.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -14,7 +13,7 @@ namespace
|
||||
}
|
||||
|
||||
TEST_CASE("vmath/mat") {
|
||||
SECTION("size/sizeof") {
|
||||
SUBCASE("size/sizeof") {
|
||||
STATIC_REQUIRE(int2x2{}.size == 2);
|
||||
STATIC_REQUIRE(int3x3{}.size == 3);
|
||||
STATIC_REQUIRE(int4x4{}.size == 4);
|
||||
@@ -24,7 +23,7 @@ TEST_CASE("vmath/mat") {
|
||||
STATIC_REQUIRE(sizeof(int4x4{}) == sizeof(int) * 4 * 4);
|
||||
}
|
||||
|
||||
SECTION("guides") {
|
||||
SUBCASE("guides") {
|
||||
STATIC_REQUIRE(mat{1,2,3,4}.size == 2);
|
||||
STATIC_REQUIRE(mat{{1,2},{3,4}}.size == 2);
|
||||
STATIC_REQUIRE(mat{vec{1,2},vec{3,4}}.size == 2);
|
||||
@@ -40,7 +39,7 @@ TEST_CASE("vmath/mat") {
|
||||
STATIC_REQUIRE(mat{mat{1,2,3,4,5,6,7,8,9},vec{5,6,7}}.size == 4);
|
||||
}
|
||||
|
||||
SECTION("ctors") {
|
||||
SUBCASE("ctors") {
|
||||
{
|
||||
STATIC_REQUIRE(int2x2()[0] == int2(1,0));
|
||||
STATIC_REQUIRE(int2x2()[1] == int2(0,1));
|
||||
@@ -93,7 +92,7 @@ TEST_CASE("vmath/mat") {
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("operator=") {
|
||||
SUBCASE("operator=") {
|
||||
{
|
||||
int2x2 v(1,2,3,4);
|
||||
int2x2 v2;
|
||||
@@ -108,7 +107,7 @@ TEST_CASE("vmath/mat") {
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("swap") {
|
||||
SUBCASE("swap") {
|
||||
{
|
||||
int2x2 v1(1,2,3,4);
|
||||
int2x2 v2(4,5,6,7);
|
||||
@@ -125,7 +124,7 @@ TEST_CASE("vmath/mat") {
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("iter") {
|
||||
SUBCASE("iter") {
|
||||
{
|
||||
int2x2 m{1,2,3,4};
|
||||
|
||||
@@ -195,7 +194,7 @@ TEST_CASE("vmath/mat") {
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("data") {
|
||||
SUBCASE("data") {
|
||||
{
|
||||
int2x2 m2;
|
||||
REQUIRE(m2.data() == &m2[0]);
|
||||
@@ -218,7 +217,7 @@ TEST_CASE("vmath/mat") {
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("operator[]") {
|
||||
SUBCASE("operator[]") {
|
||||
{
|
||||
STATIC_REQUIRE(int2x2()[0] == int2(1,0));
|
||||
STATIC_REQUIRE(int2x2()[1] == int2(0,1));
|
||||
@@ -255,13 +254,13 @@ TEST_CASE("vmath/mat") {
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("at") {
|
||||
SUBCASE("at") {
|
||||
STATIC_REQUIRE(int2x2(1,2,3,4).at(0) == int2(1,2));
|
||||
STATIC_REQUIRE(int2x2(1,2,3,4).at(1) == int2(3,4));
|
||||
REQUIRE_THROWS_AS((void)int2x2(1,2,3,4).at(2), std::out_of_range);
|
||||
}
|
||||
|
||||
SECTION("operator==/operator!=") {
|
||||
SUBCASE("operator==/operator!=") {
|
||||
STATIC_REQUIRE(int2x2(1,2,3,4) == int2x2(1,2,3,4));
|
||||
STATIC_REQUIRE_FALSE(int2x2(1,2,3,4) == int2x2(2,2,3,4));
|
||||
STATIC_REQUIRE_FALSE(int2x2(1,2,3,4) == int2x2(1,3,3,4));
|
||||
@@ -271,7 +270,7 @@ TEST_CASE("vmath/mat") {
|
||||
STATIC_REQUIRE(int2x2(1,2,3,4) != int2x2(1,3,3,4));
|
||||
}
|
||||
|
||||
SECTION("operator<") {
|
||||
SUBCASE("operator<") {
|
||||
STATIC_REQUIRE_FALSE(int2x2(1,2,3,4) < int2x2(1,2,3,4));
|
||||
|
||||
STATIC_REQUIRE(int2x2(1,1,3,4) < int2x2(1,2,3,4));
|
||||
|
||||
Reference in New Issue
Block a user