Browse Source

Various minor cleanup.

pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
ab651bb61c
  1. 5
      src/Math/Test/Matrix3Test.cpp
  2. 5
      src/Math/Test/Matrix4Test.cpp
  3. 5
      src/Math/Test/RectangularMatrixTest.cpp
  4. 10
      src/Math/Test/Vector2Test.cpp
  5. 10
      src/Math/Test/Vector3Test.cpp
  6. 10
      src/Math/Test/Vector4Test.cpp
  7. 10
      src/Math/Test/VectorTest.cpp
  8. 1
      src/Math/Vector3.h
  9. 4
      src/Test/ColorTest.cpp

5
src/Math/Test/Matrix3Test.cpp

@ -162,10 +162,9 @@ void Matrix3Test::constructConversion() {
{4.5f, 4.0f, 7.0f},
{7.9f, -1.0f, 8.0f});
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Matrix3i b(a);
#else
Matrix3i b(a); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix3i b(a);
CORRADE_COMPARE(b, Matrix3i({3, 5, 8},
{4, 4, 7},
{7, -1, 8}));

5
src/Math/Test/Matrix4Test.cpp

@ -181,10 +181,9 @@ void Matrix4Test::constructConversion() {
{1.0f, 2.0f, 3.0f, -1.0f},
{7.9f, -1.0f, 8.0f, -1.5f});
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Matrix4i b(a);
#else
Matrix4i b(a); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix4i b(a);
CORRADE_COMPARE(b, Matrix4i({3, 5, 8, -3},
{4, 4, 7, 2},
{1, 2, 3, -1},

5
src/Math/Test/RectangularMatrixTest.cpp

@ -155,10 +155,9 @@ void RectangularMatrixTest::constructConversion() {
constexpr Matrix2x2 a(Vector2( 1.3f, 2.7f),
Vector2(-15.0f, 7.0f));
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Matrix2x2i b(a);
#else
Matrix2x2i b(a); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix2x2i b(a);
CORRADE_COMPARE(b, Matrix2x2i(Vector2i( 1, 2),
Vector2i(-15, 7)));

10
src/Math/Test/Vector2Test.cpp

@ -111,10 +111,9 @@ void Vector2Test::constructDefault() {
void Vector2Test::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Vector2 a(3.0f);
#else
Vector2 a(3.0f); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector2 a(3.0f);
CORRADE_COMPARE(a, Vector2(3.0f, 3.0f));
/* Implicit conversion is not allowed */
@ -124,10 +123,9 @@ void Vector2Test::constructOneValue() {
void Vector2Test::constructConversion() {
constexpr Vector2 a(1.5f, 2.5f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Vector2i b(a);
#else
Vector2i b(a); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector2i b(a);
CORRADE_COMPARE(b, Vector2i(1, 2));
/* Implicit conversion is not allowed */

10
src/Math/Test/Vector3Test.cpp

@ -111,10 +111,9 @@ void Vector3Test::constructDefault() {
void Vector3Test::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Vector3 a(-3.0f);
#else
Vector3 a(-3.0f); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector3 a(-3.0f);
CORRADE_COMPARE(a, Vector3(-3.0f, -3.0f, -3.0f));
/* Implicit conversion is not allowed */
@ -130,10 +129,9 @@ void Vector3Test::constructParts() {
void Vector3Test::constructConversion() {
constexpr Vector3 a(1.0f, 2.5f, -3.0f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Vector3i b(a);
#else
Vector3i b(a); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector3i b(a);
CORRADE_COMPARE(b, Vector3i(1, 2, -3));
/* Implicit conversion is not allowed */

10
src/Math/Test/Vector4Test.cpp

@ -108,10 +108,9 @@ void Vector4Test::constructDefault() {
void Vector4Test::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Vector4 a(4.3f);
#else
Vector4 a(4.3f); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4 a(4.3f);
CORRADE_COMPARE(a, Vector4(4.3f, 4.3f, 4.3f, 4.3f));
/* Implicit conversion is not allowed */
@ -127,10 +126,9 @@ void Vector4Test::constructParts() {
void Vector4Test::constructConversion() {
constexpr Vector4 a(1.0f, -2.5f, 3.0f, 4.1f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Vector4i b(a);
#else
Vector4i b(a); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4i b(a);
CORRADE_COMPARE(b, Vector4i(1, -2, 3, 4));
/* Implicit conversion is not allowed */

10
src/Math/Test/VectorTest.cpp

@ -175,10 +175,9 @@ void VectorTest::constructDefault() {
void VectorTest::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Vector4 a(7.25f);
#else
Vector4 a(7.25f); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4 a(7.25f);
CORRADE_COMPARE(a, Vector4(7.25f, 7.25f, 7.25f, 7.25f));
@ -197,10 +196,9 @@ void VectorTest::constructOneComponent() {
void VectorTest::constructConversion() {
constexpr Vector4 a(1.3f, 2.7f, -15.0f, 7.0f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Vector4i b(a);
#else
Vector4i b(a); /* Not constexpr under GCC < 4.7 */
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4i b(a);
CORRADE_COMPARE(b, Vector4i(1, 2, -15, 7));

1
src/Math/Vector3.h

@ -145,7 +145,6 @@ template<class T> class Vector3: public Vector<3, T> {
/** @brief Copy constructor */
constexpr Vector3(const Vector<3, T>& other): Vector<3, T>(other) {}
/**
* @brief X component
*

4
src/Test/ColorTest.cpp

@ -51,8 +51,8 @@ class ColorTest: public TestSuite::Tester {
void configuration();
};
typedef Magnum::BasicColor3<UnsignedByte> Color3ub;
typedef Magnum::BasicColor4<UnsignedByte> Color4ub;
typedef BasicColor3<UnsignedByte> Color3ub;
typedef BasicColor4<UnsignedByte> Color4ub;
ColorTest::ColorTest() {
addTests({&ColorTest::fromHue,

Loading…
Cancel
Save