"Won't compile" tests are another awesome feature of C++11.
@ -107,6 +107,9 @@ void Vector2Test::constructOneValue() {
Vector2 a(3.0f); /* Not constexpr under GCC < 4.7 */
#endif
CORRADE_COMPARE(a, Vector2(3.0f, 3.0f));
/* Implicit conversion is not allowed */
CORRADE_VERIFY(!(std::is_convertible<Float, Vector2>::value));
}
void Vector2Test::constructConversion() {
@ -114,6 +114,9 @@ void Vector3Test::constructOneValue() {
Vector3 a(-3.0f); /* Not constexpr under GCC < 4.7 */
CORRADE_COMPARE(a, Vector3(-3.0f, -3.0f, -3.0f));
CORRADE_VERIFY(!(std::is_convertible<Float, Vector3>::value));
void Vector3Test::constructParts() {
@ -111,6 +111,9 @@ void Vector4Test::constructOneValue() {
Vector4 a(4.3f); /* Not constexpr under GCC < 4.7 */
CORRADE_COMPARE(a, Vector4(4.3f, 4.3f, 4.3f, 4.3f));
CORRADE_VERIFY(!(std::is_convertible<Float, Vector4>::value));
void Vector4Test::constructParts() {
@ -165,6 +165,9 @@ void VectorTest::constructOneValue() {
CORRADE_COMPARE(a, Vector4(7.25f, 7.25f, 7.25f, 7.25f));
void VectorTest::constructOneComponent() {