Skip to content

Commit

Permalink
[WIP] Math: add Vector{2,3} tests to existing units
Browse files Browse the repository at this point in the history
  • Loading branch information
sthalik committed Oct 10, 2022
1 parent c478e62 commit 4461cc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Magnum/Math/Test/Vector2Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void Vector2Test::convert() {
}

void Vector2Test::access() {
Vector2 vec(1.0f, -2.0f);
MAGNUM_CONSTEXPR14 Vector2 vec(1.0f, -2.0f);
CORRADE_COMPARE(vec.x(), 1.0f);
CORRADE_COMPARE(vec.y(), -2.0f);

Expand All @@ -209,8 +209,8 @@ void Vector2Test::access() {
}

void Vector2Test::cross() {
Vector2i a(1, -1);
Vector2i b(4, 3);
MAGNUM_CONSTEXPR14 Vector2i a(1, -1);
MAGNUM_CONSTEXPR14 Vector2i b(4, 3);

CORRADE_COMPARE(Math::cross(a, b), 7);
CORRADE_COMPARE(Math::cross<Int>({a, 0}, {b, 0}), Vector3i(0, 0, Math::cross(a, b)));
Expand Down
8 changes: 4 additions & 4 deletions src/Magnum/Math/Test/Vector3Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void Vector3Test::convert() {
}

void Vector3Test::access() {
Vector3 vec(1.0f, -2.0f, 5.0f);
MAGNUM_CONSTEXPR14 Vector3 vec(1.0f, -2.0f, 5.0f);
CORRADE_COMPARE(vec.x(), 1.0f);
CORRADE_COMPARE(vec.r(), 1.0f);
CORRADE_COMPARE(vec.y(), -2.0f);
Expand All @@ -230,8 +230,8 @@ void Vector3Test::access() {
}

void Vector3Test::cross() {
Vector3i a(1, -1, 1);
Vector3i b(4, 3, 7);
MAGNUM_CONSTEXPR14 Vector3i a(1, -1, 1);
MAGNUM_CONSTEXPR14 Vector3i b(4, 3, 7);

CORRADE_COMPARE(Math::cross(a, b), Vector3i(-10, -3, 7));
}
Expand All @@ -255,7 +255,7 @@ void Vector3Test::scales() {
}

void Vector3Test::twoComponent() {
Vector3 a(1.0f, 2.0f, 3.0f);
MAGNUM_CONSTEXPR14 Vector3 a(1.0f, 2.0f, 3.0f);
CORRADE_COMPARE(a.xy(), Vector2(1.0f, 2.0f));

constexpr Vector3 b(1.0f, 2.0f, 3.0f);
Expand Down

0 comments on commit 4461cc9

Please sign in to comment.