Browse Source

Test: use the new setTestCaseTemplateName().

pull/362/head
Vladimír Vondruš 7 years ago
parent
commit
3d5f50ac49
  1. 4
      src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp
  2. 4
      src/Magnum/GL/Test/CubeMapTextureGLTest.cpp
  3. 25
      src/Magnum/GL/Test/MeshGLTest.cpp
  4. 4
      src/Magnum/GL/Test/RectangleTextureGLTest.cpp
  5. 8
      src/Magnum/GL/Test/TextureArrayGLTest.cpp
  6. 12
      src/Magnum/GL/Test/TextureGLTest.cpp
  7. 2
      src/Magnum/Math/Algorithms/Test/SvdTest.cpp
  8. 4
      src/Magnum/Math/Test/AngleTest.cpp
  9. 4
      src/Magnum/Math/Test/ComplexTest.cpp
  10. 4
      src/Magnum/Math/Test/ConstantsTest.cpp
  11. 6
      src/Magnum/Math/Test/DualComplexTest.cpp
  12. 6
      src/Magnum/Math/Test/DualQuaternionTest.cpp
  13. 4
      src/Magnum/Math/Test/QuaternionTest.cpp
  14. 5
      src/Magnum/Math/Test/StrictWeakOrderingTest.cpp
  15. 16
      src/Magnum/Math/Test/TypeTraitsTest.cpp
  16. 12
      src/Magnum/Shaders/Test/FlatGLTest.cpp

4
src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp

@ -412,8 +412,8 @@ void CubeMapTextureArrayGLTest::bindImage() {
} }
template<class T> void CubeMapTextureArrayGLTest::sampling() { template<class T> void CubeMapTextureArrayGLTest::sampling() {
setTestCaseName(std::is_same<T, GenericSampler>::value ? setTestCaseTemplateName(std::is_same<T, GenericSampler>::value ?
"sampling<GenericSampler>" : "sampling<GLSampler>"); "GenericSampler" : "GLSampler");
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::ARB::texture_cube_map_array>()) if(!Context::current().isExtensionSupported<Extensions::ARB::texture_cube_map_array>())

4
src/Magnum/GL/Test/CubeMapTextureGLTest.cpp

@ -445,8 +445,8 @@ void CubeMapTextureGLTest::bindImage() {
#endif #endif
template<class T> void CubeMapTextureGLTest::sampling() { template<class T> void CubeMapTextureGLTest::sampling() {
setTestCaseName(std::is_same<T, GenericSampler>::value ? setTestCaseTemplateName(std::is_same<T, GenericSampler>::value ?
"sampling<GenericSampler>" : "sampling<GLSampler>"); "GenericSampler" : "Sampler");
CubeMapTexture texture; CubeMapTexture texture;
texture.setMinificationFilter(T::Filter::Linear, T::Mipmap::Linear) texture.setMinificationFilter(T::Filter::Linear, T::Mipmap::Linear)

25
src/Magnum/GL/Test/MeshGLTest.cpp

@ -442,9 +442,8 @@ void MeshGLTest::wrap() {
} }
template<class T> void MeshGLTest::primitive() { template<class T> void MeshGLTest::primitive() {
setTestCaseName(std::is_same<T, MeshPrimitive>::value ? setTestCaseTemplateName(std::is_same<T, MeshPrimitive>::value ?
"primitive<GL::MeshPrimitive>" : "GL::MeshPrimitive" : "Magnum::MeshPrimitive");
"primitive<Magnum::MeshPrimitive>");
{ {
Mesh mesh{T::LineLoop}; Mesh mesh{T::LineLoop};
@ -2034,9 +2033,8 @@ constexpr Color4ub indexedResult{0xaa, 0xcc, 0x44, 0xff};
#endif #endif
template<class T> void MeshGLTest::setIndexBuffer() { template<class T> void MeshGLTest::setIndexBuffer() {
setTestCaseName(std::is_same<T, MeshIndexType>::value ? setTestCaseTemplateName(std::is_same<T, MeshIndexType>::value ?
"setIndexBuffer<GL::MeshIndexType>" : "GL::MeshIndexType" : "Magnum::MeshIndexType");
"setIndexBuffer<Magnum::MeshIndexType>");
Buffer vertices; Buffer vertices;
vertices.setData(indexedVertexData, BufferUsage::StaticDraw); vertices.setData(indexedVertexData, BufferUsage::StaticDraw);
@ -2067,9 +2065,8 @@ template<class T> void MeshGLTest::setIndexBuffer() {
} }
template<class T> void MeshGLTest::setIndexBufferRange() { template<class T> void MeshGLTest::setIndexBufferRange() {
setTestCaseName(std::is_same<T, MeshIndexType>::value ? setTestCaseTemplateName(std::is_same<T, MeshIndexType>::value ?
"setIndexBufferRange<GL::MeshIndexType>" : "GL::MeshIndexType" : "Magnum::MeshIndexType");
"setIndexBufferRange<Magnum::MeshIndexType>");
Buffer vertices; Buffer vertices;
vertices.setData(indexedVertexData, BufferUsage::StaticDraw); vertices.setData(indexedVertexData, BufferUsage::StaticDraw);
@ -2146,9 +2143,8 @@ void MeshGLTest::setIndexBufferMovedOutInstance() {
} }
template<class T> void MeshGLTest::setIndexBufferTransferOwnership() { template<class T> void MeshGLTest::setIndexBufferTransferOwnership() {
setTestCaseName(std::is_same<T, MeshIndexType>::value ? setTestCaseTemplateName(std::is_same<T, MeshIndexType>::value ?
"setIndexBufferTransferOwnership<GL::MeshIndexType>" : "GL::MeshIndexType" : "Magnum::MeshIndexType");
"setIndexBufferTransferOwnership<Magnum::MeshIndexType>");
const UnsignedShort data = 0; const UnsignedShort data = 0;
Buffer buffer{Buffer::TargetHint::ElementArray}; Buffer buffer{Buffer::TargetHint::ElementArray};
@ -2179,9 +2175,8 @@ template<class T> void MeshGLTest::setIndexBufferTransferOwnership() {
} }
template<class T> void MeshGLTest::setIndexBufferRangeTransferOwnership() { template<class T> void MeshGLTest::setIndexBufferRangeTransferOwnership() {
setTestCaseName(std::is_same<T, MeshIndexType>::value ? setTestCaseTemplateName(std::is_same<T, MeshIndexType>::value ?
"setIndexBufferRangeTransferOwnership<GL::MeshIndexType>" : "GL::MeshIndexType" : "Magnum::MeshIndexType");
"setIndexBufferRangeTransferOwnership<Magnum::MeshIndexType>");
const UnsignedShort data = 0; const UnsignedShort data = 0;
Buffer buffer{Buffer::TargetHint::ElementArray}; Buffer buffer{Buffer::TargetHint::ElementArray};

4
src/Magnum/GL/Test/RectangleTextureGLTest.cpp

@ -221,8 +221,8 @@ void RectangleTextureGLTest::bindImage() {
} }
template<class T> void RectangleTextureGLTest::sampling() { template<class T> void RectangleTextureGLTest::sampling() {
setTestCaseName(std::is_same<T, GenericSampler>::value ? setTestCaseTemplateName(std::is_same<T, GenericSampler>::value ?
"sampling<GenericSampler>" : "sampling<GLSampler>"); "GenericSampler" : "GLSampler");
if(!Context::current().isExtensionSupported<Extensions::ARB::texture_rectangle>()) if(!Context::current().isExtensionSupported<Extensions::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported."));

8
src/Magnum/GL/Test/TextureArrayGLTest.cpp

@ -555,8 +555,8 @@ void TextureArrayGLTest::bindImage2D() {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
template<class T> void TextureArrayGLTest::sampling1D() { template<class T> void TextureArrayGLTest::sampling1D() {
setTestCaseName(std::is_same<T, GenericSampler>::value ? setTestCaseTemplateName(std::is_same<T, GenericSampler>::value ?
"sampling1D<GenericSampler>" : "sampling1D<GLSampler>"); "GenericSampler" : "GLSampler");
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_array>()) if(!Context::current().isExtensionSupported<Extensions::EXT::texture_array>())
CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported."));
@ -632,8 +632,8 @@ void TextureArrayGLTest::samplingDepthStencilMode1D() {
#endif #endif
template<class T> void TextureArrayGLTest::sampling2D() { template<class T> void TextureArrayGLTest::sampling2D() {
setTestCaseName(std::is_same<T, GenericSampler>::value ? setTestCaseTemplateName(std::is_same<T, GenericSampler>::value ?
"sampling2D<GenericSampler>" : "sampling2D<GLSampler>"); "GenericSampler" : "GLSampler");
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_array>()) if(!Context::current().isExtensionSupported<Extensions::EXT::texture_array>())

12
src/Magnum/GL/Test/TextureGLTest.cpp

@ -859,8 +859,8 @@ void TextureGLTest::bindImage3D() {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
template<class T> void TextureGLTest::sampling1D() { template<class T> void TextureGLTest::sampling1D() {
setTestCaseName(std::is_same<T, GenericSampler>::value ? setTestCaseTemplateName(std::is_same<T, GenericSampler>::value ?
"sampling1D<GenericSampler>" : "sampling1D<GLSampler>"); "GenericSampler" : "GLSampler");
Texture1D texture; Texture1D texture;
texture.setMinificationFilter(T::Filter::Linear, T::Mipmap::Linear) texture.setMinificationFilter(T::Filter::Linear, T::Mipmap::Linear)
@ -925,8 +925,8 @@ void TextureGLTest::samplingDepthStencilMode1D() {
#endif #endif
template<class T> void TextureGLTest::sampling2D() { template<class T> void TextureGLTest::sampling2D() {
setTestCaseName(std::is_same<T, GenericSampler>::value ? setTestCaseTemplateName(std::is_same<T, GenericSampler>::value ?
"sampling2D<GenericSampler>" : "sampling2D<GLSampler>"); "GenericSampler" : "GLSampler");
Texture2D texture; Texture2D texture;
texture.setMinificationFilter(T::Filter::Linear, T::Mipmap::Linear) texture.setMinificationFilter(T::Filter::Linear, T::Mipmap::Linear)
@ -1061,8 +1061,8 @@ void TextureGLTest::samplingBorder2D() {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
template<class T> void TextureGLTest::sampling3D() { template<class T> void TextureGLTest::sampling3D() {
setTestCaseName(std::is_same<T, GenericSampler>::value ? setTestCaseTemplateName(std::is_same<T, GenericSampler>::value ?
"sampling3D<GenericSampler>" : "sampling3D<GLSampler>"); "GenericSampler" : "GLSampler");
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2
if(!Context::current().isExtensionSupported<Extensions::OES::texture_3D>()) if(!Context::current().isExtensionSupported<Extensions::OES::texture_3D>())

2
src/Magnum/Math/Algorithms/Test/SvdTest.cpp

@ -50,7 +50,7 @@ SvdTest::SvdTest() {
} }
template<class T> void SvdTest::test() { template<class T> void SvdTest::test() {
setTestCaseName(std::is_same<T, Double>::value ? "test<Double>" : "test<Float>"); setTestCaseTemplateName(TypeTraits<T>::name());
constexpr const Matrix5x8<T> a{ constexpr const Matrix5x8<T> a{
Vector8<T>{T{22}, T{14}, T{ -1}, T{-3}, T{ 9}, T{ 9}, T{ 2}, T{ 4}}, Vector8<T>{T{22}, T{14}, T{ -1}, T{-3}, T{ 9}, T{ 9}, T{ 2}, T{ 4}},

4
src/Magnum/Math/Test/AngleTest.cpp

@ -289,7 +289,7 @@ void AngleTest::debugRad() {
#if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT)) || defined(CORRADE_TARGET_EMSCRIPTEN) #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT)) || defined(CORRADE_TARGET_EMSCRIPTEN)
template<class T> void AngleTest::tweakable() { template<class T> void AngleTest::tweakable() {
auto&& data = TweakableData[testCaseInstanceId()]; auto&& data = TweakableData[testCaseInstanceId()];
setTestCaseName(Corrade::Utility::formatString("tweakable<{}>", TweakableTraits<T>::name())); setTestCaseTemplateName(TweakableTraits<T>::name());
setTestCaseDescription(data.name); setTestCaseDescription(data.name);
std::string input = Corrade::Utility::formatString(data.data, TweakableTraits<T>::literal()); std::string input = Corrade::Utility::formatString(data.data, TweakableTraits<T>::literal());
Corrade::Utility::TweakableState state; Corrade::Utility::TweakableState state;
@ -301,7 +301,7 @@ template<class T> void AngleTest::tweakable() {
template<class T> void AngleTest::tweakableError() { template<class T> void AngleTest::tweakableError() {
auto&& data = TweakableErrorData[testCaseInstanceId()]; auto&& data = TweakableErrorData[testCaseInstanceId()];
setTestCaseName(Corrade::Utility::formatString("tweakableError<{}>", TweakableTraits<T>::name())); setTestCaseTemplateName(TweakableTraits<T>::name());
setTestCaseDescription(data.name); setTestCaseDescription(data.name);
std::string input = Corrade::Utility::formatString(data.data, TweakableTraits<T>::literal()); std::string input = Corrade::Utility::formatString(data.data, TweakableTraits<T>::literal());

4
src/Magnum/Math/Test/ComplexTest.cpp

@ -304,7 +304,7 @@ void ComplexTest::isNormalized() {
} }
template<class T> void ComplexTest::isNormalizedEpsilon() { template<class T> void ComplexTest::isNormalizedEpsilon() {
setTestCaseName(std::string{"isNormalizedEpsilon<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY((Math::Complex<T>{T(0.801775644243754) + TypeTraits<T>::epsilon()/T(2.0), T(0.597625146975521)}.isNormalized())); CORRADE_VERIFY((Math::Complex<T>{T(0.801775644243754) + TypeTraits<T>::epsilon()/T(2.0), T(0.597625146975521)}.isNormalized()));
CORRADE_VERIFY(!(Math::Complex<T>{T(0.801775644243754) + TypeTraits<T>::epsilon()*T(2.0), T(0.597625146975521)}.isNormalized())); CORRADE_VERIFY(!(Math::Complex<T>{T(0.801775644243754) + TypeTraits<T>::epsilon()*T(2.0), T(0.597625146975521)}.isNormalized()));
@ -381,7 +381,7 @@ void ComplexTest::normalized() {
} }
template<class T> void ComplexTest::normalizedIterative() { template<class T> void ComplexTest::normalizedIterative() {
setTestCaseName(std::string{"normalizedIterative<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
auto a = Math::Complex<T>::rotation(Math::Deg<T>{T(36.7)}); auto a = Math::Complex<T>::rotation(Math::Deg<T>{T(36.7)});
for(std::size_t i = 0; i != testCaseRepeatId(); ++i) { for(std::size_t i = 0; i != testCaseRepeatId(); ++i) {

4
src/Magnum/Math/Test/ConstantsTest.cpp

@ -46,7 +46,7 @@ ConstantsTest::ConstantsTest() {
} }
template<class T> void ConstantsTest::constants() { template<class T> void ConstantsTest::constants() {
setTestCaseName(std::is_same<T, Double>::value ? "constants<Double>" : "constants<Float>"); setTestCaseTemplateName(TypeTraits<T>::name());
{ {
constexpr T a = Constants<T>::sqrt2(); constexpr T a = Constants<T>::sqrt2();
@ -70,7 +70,7 @@ template<class T> void ConstantsTest::constants() {
} }
template<class T> void ConstantsTest::specials() { template<class T> void ConstantsTest::specials() {
setTestCaseName(std::is_same<T, Double>::value ? "specials<Double>" : "specials<Float>"); setTestCaseTemplateName(TypeTraits<T>::name());
#ifndef CORRADE_MSVC2015_COMPATIBILITY /* NaN is not constexpr */ #ifndef CORRADE_MSVC2015_COMPATIBILITY /* NaN is not constexpr */
constexpr constexpr

6
src/Magnum/Math/Test/DualComplexTest.cpp

@ -285,14 +285,14 @@ void DualComplexTest::isNormalized() {
} }
template<class T> void DualComplexTest::isNormalizedEpsilonRotation() { template<class T> void DualComplexTest::isNormalizedEpsilonRotation() {
setTestCaseName(std::string{"isNormalizedEpsilonRotation<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY((Math::DualComplex<T>{{T(0.801775644243754) + TypeTraits<T>::epsilon()/T(2.0), T(0.597625146975521)}, {T(8018055.25501103), T(5975850.58193309)}}.isNormalized())); CORRADE_VERIFY((Math::DualComplex<T>{{T(0.801775644243754) + TypeTraits<T>::epsilon()/T(2.0), T(0.597625146975521)}, {T(8018055.25501103), T(5975850.58193309)}}.isNormalized()));
CORRADE_VERIFY(!(Math::DualComplex<T>{{T(0.801775644243754) + TypeTraits<T>::epsilon()*T(2.0), T(0.597625146975521)}, {T(8018055.25501103), T(5975850.58193309)}}.isNormalized())); CORRADE_VERIFY(!(Math::DualComplex<T>{{T(0.801775644243754) + TypeTraits<T>::epsilon()*T(2.0), T(0.597625146975521)}, {T(8018055.25501103), T(5975850.58193309)}}.isNormalized()));
} }
template<class T> void DualComplexTest::isNormalizedEpsilonTranslation() { template<class T> void DualComplexTest::isNormalizedEpsilonTranslation() {
setTestCaseName(std::string{"isNormalizedEpsilonTranslation<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
/* Translation does not affect normalization */ /* Translation does not affect normalization */
CORRADE_VERIFY((Math::DualComplex<T>{{T(0.801775644243754), T(0.597625146975521)}, {T(8018055.25501103), T(20.5)}}.isNormalized())); CORRADE_VERIFY((Math::DualComplex<T>{{T(0.801775644243754), T(0.597625146975521)}, {T(8018055.25501103), T(20.5)}}.isNormalized()));
@ -331,7 +331,7 @@ template<> struct NormalizedIterativeData<Double> {
}; };
template<class T> void DualComplexTest::normalizedIterative() { template<class T> void DualComplexTest::normalizedIterative() {
setTestCaseName(std::string{"normalizedIterative<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
auto a = Math::DualComplex<T>::rotation(Math::Deg<T>{T(36.7)})*Math::DualComplex<T>::translation(NormalizedIterativeData<T>::translation()); auto a = Math::DualComplex<T>::rotation(Math::Deg<T>{T(36.7)})*Math::DualComplex<T>::translation(NormalizedIterativeData<T>::translation());
for(std::size_t i = 0; i != testCaseRepeatId(); ++i) { for(std::size_t i = 0; i != testCaseRepeatId(); ++i) {

6
src/Magnum/Math/Test/DualQuaternionTest.cpp

@ -318,14 +318,14 @@ void DualQuaternionTest::isNormalized() {
} }
template<class T> void DualQuaternionTest::isNormalizedEpsilonRotation() { template<class T> void DualQuaternionTest::isNormalizedEpsilonRotation() {
setTestCaseName(std::string{"isNormalizedEpsilonRotation<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY((Math::DualQuaternion<T>{{{T(0.199367934417197) + TypeTraits<T>::epsilon()/T(2.0), T(0.0), T(0.0)}, T(0.97992470462083)}, {{T(0.440966117079373), T(-0.440120368706115), T(-0.344665143363806)}, T(-0.0897155704877387)}}.isNormalized())); CORRADE_VERIFY((Math::DualQuaternion<T>{{{T(0.199367934417197) + TypeTraits<T>::epsilon()/T(2.0), T(0.0), T(0.0)}, T(0.97992470462083)}, {{T(0.440966117079373), T(-0.440120368706115), T(-0.344665143363806)}, T(-0.0897155704877387)}}.isNormalized()));
CORRADE_VERIFY(!(Math::DualQuaternion<T>{{{T(0.199367934417197), T(0.0), T(0.0)}, T(0.97992470462083) + TypeTraits<T>::epsilon()*T(2.0)}, {{T(0.440966117079373), T(-0.440120368706115), T(-0.344665143363806)}, T(-0.0897155704877387)}}.isNormalized())); CORRADE_VERIFY(!(Math::DualQuaternion<T>{{{T(0.199367934417197), T(0.0), T(0.0)}, T(0.97992470462083) + TypeTraits<T>::epsilon()*T(2.0)}, {{T(0.440966117079373), T(-0.440120368706115), T(-0.344665143363806)}, T(-0.0897155704877387)}}.isNormalized()));
} }
template<class T> void DualQuaternionTest::isNormalizedEpsilonTranslation() { template<class T> void DualQuaternionTest::isNormalizedEpsilonTranslation() {
setTestCaseName(std::string{"isNormalizedEpsilonTranslation<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY((Math::DualQuaternion<T>{{{T(0.199367934417197), T(0.0), T(0.0)}, T(0.97992470462083)}, {{T(0.440966117079373), T(-0.440120368706115) + TypeTraits<T>::epsilon()*T(2.0), T(-0.344665143363806)}, T(-0.0897155704877387)}}.isNormalized())); CORRADE_VERIFY((Math::DualQuaternion<T>{{{T(0.199367934417197), T(0.0), T(0.0)}, T(0.97992470462083)}, {{T(0.440966117079373), T(-0.440120368706115) + TypeTraits<T>::epsilon()*T(2.0), T(-0.344665143363806)}, T(-0.0897155704877387)}}.isNormalized()));
CORRADE_VERIFY(!(Math::DualQuaternion<T>{{{T(0.199367934417197), T(0.0), T(0.0)}, T(0.97992470462083)}, {{T(0.440966117079373) + TypeTraits<T>::epsilon()*T(4.0), T(-0.440120368706115), T(-0.344665143363806)}, T(-0.0897155704877387)}}.isNormalized())); CORRADE_VERIFY(!(Math::DualQuaternion<T>{{{T(0.199367934417197), T(0.0), T(0.0)}, T(0.97992470462083)}, {{T(0.440966117079373) + TypeTraits<T>::epsilon()*T(4.0), T(-0.440120368706115), T(-0.344665143363806)}, T(-0.0897155704877387)}}.isNormalized()));
@ -361,7 +361,7 @@ template<> struct NormalizedIterativeData<Double> {
}; };
template<class T> void DualQuaternionTest::normalizedIterative() { template<class T> void DualQuaternionTest::normalizedIterative() {
setTestCaseName(std::string{"normalizedIterative<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
const auto axis = Math::Vector3<T>{T(0.5), T(7.9), T(0.1)}.normalized(); const auto axis = Math::Vector3<T>{T(0.5), T(7.9), T(0.1)}.normalized();
auto a = Math::DualQuaternion<T>::rotation(Math::Deg<T>{T(36.7)}, Math::Vector3<T>{T(0.25), T(7.3), T(-1.1)}.normalized())*Math::DualQuaternion<T>::translation(NormalizedIterativeData<T>::translation()); auto a = Math::DualQuaternion<T>::rotation(Math::Deg<T>{T(36.7)}, Math::Vector3<T>{T(0.25), T(7.3), T(-1.1)}.normalized())*Math::DualQuaternion<T>::translation(NormalizedIterativeData<T>::translation());

4
src/Magnum/Math/Test/QuaternionTest.cpp

@ -329,7 +329,7 @@ void QuaternionTest::isNormalized() {
} }
template<class T> void QuaternionTest::isNormalizedEpsilon() { template<class T> void QuaternionTest::isNormalizedEpsilon() {
setTestCaseName(std::string{"isNormalizedEpsilon<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY((Math::Quaternion<T>{{T(0.0106550719778129), T(0.311128101752138), T(-0.0468823167023769)}, T(0.949151106053128) + TypeTraits<T>::epsilon()/T(2.0)}.isNormalized())); CORRADE_VERIFY((Math::Quaternion<T>{{T(0.0106550719778129), T(0.311128101752138), T(-0.0468823167023769)}, T(0.949151106053128) + TypeTraits<T>::epsilon()/T(2.0)}.isNormalized()));
CORRADE_VERIFY(!(Math::Quaternion<T>{{T(0.0106550719778129), T(0.311128101752138), T(-0.0468823167023769)}, T(0.949151106053128) + TypeTraits<T>::epsilon()*T(2.0)}.isNormalized())); CORRADE_VERIFY(!(Math::Quaternion<T>{{T(0.0106550719778129), T(0.311128101752138), T(-0.0468823167023769)}, T(0.949151106053128) + TypeTraits<T>::epsilon()*T(2.0)}.isNormalized()));
@ -404,7 +404,7 @@ void QuaternionTest::normalized() {
} }
template<class T> void QuaternionTest::normalizedIterative() { template<class T> void QuaternionTest::normalizedIterative() {
setTestCaseName(std::string{"normalizedIterative<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
const auto axis = Math::Vector3<T>{T(0.5), T(7.9), T(0.1)}.normalized(); const auto axis = Math::Vector3<T>{T(0.5), T(7.9), T(0.1)}.normalized();
auto a = Math::Quaternion<T>::rotation(Math::Deg<T>{T(36.7)}, Math::Vector3<T>{T(0.25), T(7.3), T(-1.1)}.normalized()); auto a = Math::Quaternion<T>::rotation(Math::Deg<T>{T(36.7)}, Math::Vector3<T>{T(0.25), T(7.3), T(-1.1)}.normalized());

5
src/Magnum/Math/Test/StrictWeakOrderingTest.cpp

@ -27,7 +27,6 @@
#include <map> #include <map>
#include <set> #include <set>
#include <Corrade/TestSuite/Tester.h> #include <Corrade/TestSuite/Tester.h>
#include <Corrade/Utility/FormatStl.h>
#include "Magnum/Math/Vector2.h" #include "Magnum/Math/Vector2.h"
#include "Magnum/Math/StrictWeakOrdering.h" #include "Magnum/Math/StrictWeakOrdering.h"
@ -85,7 +84,7 @@ template<> struct Compare<std::less<Vector2i>> {
}; };
template<class Set> void StrictWeakOrderingTest::set() { template<class Set> void StrictWeakOrderingTest::set() {
setTestCaseName(Corrade::Utility::formatString("set<{}>", Compare<typename Set::key_compare>::name())); setTestCaseTemplateName(Compare<typename Set::key_compare>::name());
Set s; Set s;
s.insert({1, 2}); s.insert({1, 2});
@ -100,7 +99,7 @@ template<class Set> void StrictWeakOrderingTest::set() {
} }
template<class Map> void StrictWeakOrderingTest::map() { template<class Map> void StrictWeakOrderingTest::map() {
setTestCaseName(Corrade::Utility::formatString("map<{}>", Compare<typename Map::key_compare>::name())); setTestCaseTemplateName(Compare<typename Map::key_compare>::name());
Map m; Map m;
m[{1, 2}] = 23; m[{1, 2}] = 23;

16
src/Magnum/Math/Test/TypeTraitsTest.cpp

@ -248,7 +248,7 @@ void TypeTraitsTest::underlyingTypeOf() {
} }
template<class T> void TypeTraitsTest::equalsIntegral() { template<class T> void TypeTraitsTest::equalsIntegral() {
setTestCaseName(std::string{"equalsIntegral<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY(TypeTraits<T>::equals(T(1), T(1))); CORRADE_VERIFY(TypeTraits<T>::equals(T(1), T(1)));
CORRADE_VERIFY(!TypeTraits<T>::equals(T(1), T(-1))); CORRADE_VERIFY(!TypeTraits<T>::equals(T(1), T(-1)));
@ -256,35 +256,35 @@ template<class T> void TypeTraitsTest::equalsIntegral() {
} }
template<class T> void TypeTraitsTest::equalsFloatingPoint0() { template<class T> void TypeTraitsTest::equalsFloatingPoint0() {
setTestCaseName(std::string{"equalsFloatingPoint0<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY(TypeTraits<T>::equals(T(0)+TypeTraits<T>::epsilon()/T(2), T(0))); CORRADE_VERIFY(TypeTraits<T>::equals(T(0)+TypeTraits<T>::epsilon()/T(2), T(0)));
CORRADE_VERIFY(!TypeTraits<T>::equals(T(0)+TypeTraits<T>::epsilon()*T(2), T(0))); CORRADE_VERIFY(!TypeTraits<T>::equals(T(0)+TypeTraits<T>::epsilon()*T(2), T(0)));
} }
template<class T> void TypeTraitsTest::equalsFloatingPoint1() { template<class T> void TypeTraitsTest::equalsFloatingPoint1() {
setTestCaseName(std::string{"equalsFloatingPoint1<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY(TypeTraits<T>::equals(T(1)+TypeTraits<T>::epsilon()/T(2), T(1))); CORRADE_VERIFY(TypeTraits<T>::equals(T(1)+TypeTraits<T>::epsilon()/T(2), T(1)));
CORRADE_VERIFY(!TypeTraits<T>::equals(T(1)+TypeTraits<T>::epsilon()*T(3), T(1))); CORRADE_VERIFY(!TypeTraits<T>::equals(T(1)+TypeTraits<T>::epsilon()*T(3), T(1)));
} }
template<class T> void TypeTraitsTest::equalsFloatingPointLarge() { template<class T> void TypeTraitsTest::equalsFloatingPointLarge() {
setTestCaseName(std::string{"equalsFloatingPointLarge<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY(TypeTraits<T>::equals(T(25)+TypeTraits<T>::epsilon()*T(2), T(25))); CORRADE_VERIFY(TypeTraits<T>::equals(T(25)+TypeTraits<T>::epsilon()*T(2), T(25)));
CORRADE_VERIFY(!TypeTraits<T>::equals(T(25)+TypeTraits<T>::epsilon()*T(75), T(25))); CORRADE_VERIFY(!TypeTraits<T>::equals(T(25)+TypeTraits<T>::epsilon()*T(75), T(25)));
} }
template<class T> void TypeTraitsTest::equalsFloatingPointInfinity() { template<class T> void TypeTraitsTest::equalsFloatingPointInfinity() {
setTestCaseName(std::string{"equalsFloatingPointInfinity<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY(TypeTraits<T>::equals(Constants<T>::inf(), CORRADE_VERIFY(TypeTraits<T>::equals(Constants<T>::inf(),
Constants<T>::inf())); Constants<T>::inf()));
} }
template<class T> void TypeTraitsTest::equalsFloatingPointNaN() { template<class T> void TypeTraitsTest::equalsFloatingPointNaN() {
setTestCaseName(std::string{"equalsFloatingPointNaN<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
CORRADE_VERIFY(!TypeTraits<T>::equals(Constants<T>::nan(), CORRADE_VERIFY(!TypeTraits<T>::equals(Constants<T>::nan(),
Constants<T>::nan())); Constants<T>::nan()));
@ -299,7 +299,7 @@ template<class T, class U = T, class V = typename std::enable_if<!std::is_unsign
} }
template<class T> void TypeTraitsTest::equalsZeroIntegral() { template<class T> void TypeTraitsTest::equalsZeroIntegral() {
setTestCaseName(std::string{"equalsZeroIntegral<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
const T a = T(-123); const T a = T(-123);
const T magnitude = abs(a); const T magnitude = abs(a);
@ -310,7 +310,7 @@ template<class T> void TypeTraitsTest::equalsZeroIntegral() {
} }
template<class T> void TypeTraitsTest::equalsZeroFloatingPoint() { template<class T> void TypeTraitsTest::equalsZeroFloatingPoint() {
setTestCaseName(std::string{"equalsZeroFloatingPoint<"} + TypeTraits<T>::name() + ">"); setTestCaseTemplateName(TypeTraits<T>::name());
setTestCaseDescription(EqualsZeroData[testCaseInstanceId()].name); setTestCaseDescription(EqualsZeroData[testCaseInstanceId()].name);
const T a = EqualsZeroData[testCaseInstanceId()].get(T{}); const T a = EqualsZeroData[testCaseInstanceId()].get(T{});

12
src/Magnum/Shaders/Test/FlatGLTest.cpp

@ -80,7 +80,7 @@ FlatGLTest::FlatGLTest() {
} }
template<UnsignedInt dimensions> void FlatGLTest::construct() { template<UnsignedInt dimensions> void FlatGLTest::construct() {
setTestCaseName(Utility::formatString("construct<{}>", dimensions)); setTestCaseTemplateName(std::to_string(dimensions));
auto&& data = ConstructData[testCaseInstanceId()]; auto&& data = ConstructData[testCaseInstanceId()];
setTestCaseDescription(data.name); setTestCaseDescription(data.name);
@ -97,7 +97,7 @@ template<UnsignedInt dimensions> void FlatGLTest::construct() {
} }
template<UnsignedInt dimensions> void FlatGLTest::constructMove() { template<UnsignedInt dimensions> void FlatGLTest::constructMove() {
setTestCaseName(Utility::formatString("constructMove<{}>", dimensions)); setTestCaseTemplateName(std::to_string(dimensions));
Flat<dimensions> a{Flat<dimensions>::Flag::Textured}; Flat<dimensions> a{Flat<dimensions>::Flag::Textured};
const GLuint id = a.id(); const GLuint id = a.id();
@ -118,7 +118,7 @@ template<UnsignedInt dimensions> void FlatGLTest::constructMove() {
} }
template<UnsignedInt dimensions> void FlatGLTest::bindTexture() { template<UnsignedInt dimensions> void FlatGLTest::bindTexture() {
setTestCaseName(Utility::formatString("bindTexture<{}>", dimensions)); setTestCaseTemplateName(std::to_string(dimensions));
char data[4]; char data[4];
@ -139,7 +139,7 @@ template<UnsignedInt dimensions> void FlatGLTest::bindTexture() {
} }
template<UnsignedInt dimensions> void FlatGLTest::bindTextureNotEnabled() { template<UnsignedInt dimensions> void FlatGLTest::bindTextureNotEnabled() {
setTestCaseName(Utility::formatString("bindTextureNotEnabled<{}>", dimensions)); setTestCaseTemplateName(std::to_string(dimensions));
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};
@ -152,6 +152,8 @@ template<UnsignedInt dimensions> void FlatGLTest::bindTextureNotEnabled() {
} }
template<UnsignedInt dimensions> void FlatGLTest::setAlphaMask() { template<UnsignedInt dimensions> void FlatGLTest::setAlphaMask() {
setTestCaseTemplateName(std::to_string(dimensions));
/* Test just that no assertion is fired */ /* Test just that no assertion is fired */
Flat<dimensions> shader{Flat<dimensions>::Flag::AlphaMask}; Flat<dimensions> shader{Flat<dimensions>::Flag::AlphaMask};
shader.setAlphaMask(0.25f); shader.setAlphaMask(0.25f);
@ -160,6 +162,8 @@ template<UnsignedInt dimensions> void FlatGLTest::setAlphaMask() {
} }
template<UnsignedInt dimensions> void FlatGLTest::setAlphaMaskNotEnabled() { template<UnsignedInt dimensions> void FlatGLTest::setAlphaMaskNotEnabled() {
setTestCaseTemplateName(std::to_string(dimensions));
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};

Loading…
Cancel
Save