Skip to content

Commit

Permalink
Math: more explicit Quaternion-from-Vector constructor test.
Browse files Browse the repository at this point in the history
For better readability, nothing more.
  • Loading branch information
mosra committed Feb 27, 2013
1 parent 6ed315b commit 6edc26f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Math/Test/DualQuaternionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void DualQuaternionTest::constructDefault() {
}

void DualQuaternionTest::constructFromVector() {
CORRADE_COMPARE(DualQuaternion({1.0f, 2.0f, 3.0f}), DualQuaternion({{0.0f, 0.0f, 0.0f}, 1.0f}, {{1.0f, 2.0f, 3.0f}, 0.0f}));
CORRADE_COMPARE(DualQuaternion(Vector3(1.0f, 2.0f, 3.0f)), DualQuaternion({{0.0f, 0.0f, 0.0f}, 1.0f}, {{1.0f, 2.0f, 3.0f}, 0.0f}));
}

void DualQuaternionTest::constExpressions() {
Expand All @@ -108,7 +108,7 @@ void DualQuaternionTest::constExpressions() {
CORRADE_COMPARE(b, DualQuaternion({{1.0f, 2.0f, -3.0f}, -3.5f}, {{4.5f, -7.0f, 2.0f}, 1.0f}));

/* Vector constructor */
constexpr DualQuaternion c({1.5f, -5.0f, 3.0f});
constexpr DualQuaternion c(Vector3(1.5f, -5.0f, 3.0f));
CORRADE_COMPARE(c, DualQuaternion({{0.0f, 0.0f, 0.0f}, 1.0f}, {{1.5f, -5.0f, 3.0f}, 0.0f}));

/* Copy constructor */
Expand Down
4 changes: 2 additions & 2 deletions src/Math/Test/QuaternionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void QuaternionTest::constructDefault() {
}

void QuaternionTest::constructFromVector() {
CORRADE_COMPARE(Quaternion({1.0f, 2.0f, 3.0f}), Quaternion({1.0f, 2.0f, 3.0f}, 0.0f));
CORRADE_COMPARE(Quaternion(Vector3(1.0f, 2.0f, 3.0f)), Quaternion({1.0f, 2.0f, 3.0f}, 0.0f));
}

void QuaternionTest::compare() {
Expand All @@ -130,7 +130,7 @@ void QuaternionTest::constExpressions() {
CORRADE_COMPARE(b, Quaternion({1.0f, -3.0f, 7.0f}, 2.5f));

/* Construct from vector */
constexpr Quaternion c({2.0f, -3.0f, 1.5f});
constexpr Quaternion c(Vector3(2.0f, -3.0f, 1.5f));
CORRADE_COMPARE(c, Quaternion({2.0f, -3.0f, 1.5f}, 0.0f));

/* Copy constructor */
Expand Down

0 comments on commit 6edc26f

Please sign in to comment.