Browse Source

No need to use Double type in tests so extensively.

Makes porting to OpenGL ES easier.
pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
ba0f56fa51
  1. 4
      src/Math/Test/UnitTest.cpp
  2. 6
      src/Test/SwizzleTest.cpp

4
src/Math/Test/UnitTest.cpp

@ -55,7 +55,7 @@ UnitTest::UnitTest() {
template<class> struct Sec_;
typedef Unit<Sec_, Float> Sec;
typedef Unit<Sec_, Double> Secd;
typedef Unit<Sec_, Int> Seci;
inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, Sec value) {
return debug << Float(value);
@ -72,7 +72,7 @@ void UnitTest::constructDefault() {
}
void UnitTest::constructConversion() {
constexpr Secd a(25.0);
constexpr Seci a(25.0);
constexpr Sec b(a);
CORRADE_COMPARE(b, Sec(25.0f));
}

6
src/Test/SwizzleTest.cpp

@ -51,7 +51,7 @@ void SwizzleTest::rgba() {
void SwizzleTest::type() {
constexpr Vector4i orig;
constexpr Color3<Float> origColor3;
constexpr Color4<Double> origColor4;
constexpr Color4<UnsignedByte> origColor4;
constexpr auto a = swizzle<'y', 'a'>(orig);
CORRADE_VERIFY((std::is_same<decltype(a), const Vector2i>::value));
@ -66,13 +66,13 @@ void SwizzleTest::type() {
CORRADE_VERIFY((std::is_same<decltype(d), const Color3<Float>>::value));
constexpr auto e = swizzle<'y', 'z', 'a'>(origColor4);
CORRADE_VERIFY((std::is_same<decltype(e), const Color3<Double>>::value));
CORRADE_VERIFY((std::is_same<decltype(e), const Color3<UnsignedByte>>::value));
constexpr auto f = swizzle<'y', 'z', 'y', 'x'>(origColor3);
CORRADE_VERIFY((std::is_same<decltype(f), const Color4<Float>>::value));
constexpr auto g = swizzle<'y', 'a', 'y', 'x'>(origColor4);
CORRADE_VERIFY((std::is_same<decltype(g), const Color4<Double>>::value));
CORRADE_VERIFY((std::is_same<decltype(g), const Color4<UnsignedByte>>::value));
}
void SwizzleTest::defaultType() {

Loading…
Cancel
Save