Browse Source

Make this compile and test cleanly with CORRADE_NO_ASSERT defined.

catastrophic-cross
Vladimír Vondruš 6 years ago
parent
commit
65a2ced2a7
  1. 90
      src/Magnum/Animation/Test/InterpolationTest.cpp
  2. 4
      src/Magnum/Animation/Test/PlayerTest.cpp
  3. 2
      src/Magnum/Audio/AbstractImporter.cpp
  4. 28
      src/Magnum/Audio/Test/AbstractImporterTest.cpp
  5. 9
      src/Magnum/DebugTools/CompareImage.cpp
  6. 24
      src/Magnum/DebugTools/Test/CompareImageTest.cpp
  7. 4
      src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp
  8. 4
      src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp
  9. 8
      src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp
  10. 2
      src/Magnum/DebugTools/TextureImage.cpp
  11. 8
      src/Magnum/GL/AbstractTexture.cpp
  12. 2
      src/Magnum/GL/Attribute.cpp
  13. 6
      src/Magnum/GL/CubeMapTexture.cpp
  14. 4
      src/Magnum/GL/Mesh.cpp
  15. 2
      src/Magnum/GL/PixelFormat.cpp
  16. 4
      src/Magnum/GL/PixelFormat.h
  17. 2
      src/Magnum/GL/Shader.cpp
  18. 2
      src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp
  19. 48
      src/Magnum/GL/Test/AbstractTextureGLTest.cpp
  20. 20
      src/Magnum/GL/Test/AttributeTest.cpp
  21. 4
      src/Magnum/GL/Test/BufferImageGLTest.cpp
  22. 64
      src/Magnum/GL/Test/CubeMapTextureGLTest.cpp
  23. 8
      src/Magnum/GL/Test/FramebufferGLTest.cpp
  24. 8
      src/Magnum/GL/Test/MeshGLTest.cpp
  25. 20
      src/Magnum/GL/Test/MeshTest.cpp
  26. 52
      src/Magnum/GL/Test/PixelFormatTest.cpp
  27. 4
      src/Magnum/GL/Test/RendererGLTest.cpp
  28. 12
      src/Magnum/GL/Test/SamplerTest.cpp
  29. 20
      src/Magnum/Math/Test/ComplexTest.cpp
  30. 32
      src/Magnum/Math/Test/CubicHermiteTest.cpp
  31. 4
      src/Magnum/Math/Test/DistanceTest.cpp
  32. 8
      src/Magnum/Math/Test/DualComplexTest.cpp
  33. 20
      src/Magnum/Math/Test/DualQuaternionTest.cpp
  34. 4
      src/Magnum/Math/Test/FrustumTest.cpp
  35. 8
      src/Magnum/Math/Test/FunctionsTest.cpp
  36. 3
      src/Magnum/Math/Test/InterpolationBenchmark.cpp
  37. 4
      src/Magnum/Math/Test/IntersectionTest.cpp
  38. 20
      src/Magnum/Math/Test/Matrix3Test.cpp
  39. 24
      src/Magnum/Math/Test/Matrix4Test.cpp
  40. 4
      src/Magnum/Math/Test/MatrixTest.cpp
  41. 12
      src/Magnum/Math/Test/PackingBatchTest.cpp
  42. 44
      src/Magnum/Math/Test/QuaternionTest.cpp
  43. 8
      src/Magnum/Math/Test/VectorTest.cpp
  44. 2
      src/Magnum/MeshTools/CompressIndices.cpp
  45. 6
      src/Magnum/MeshTools/GenerateIndices.cpp
  46. 4
      src/Magnum/MeshTools/Interleave.h
  47. 4
      src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp
  48. 36
      src/Magnum/MeshTools/Test/CombineTest.cpp
  49. 20
      src/Magnum/MeshTools/Test/CompileGLTest.cpp
  50. 16
      src/Magnum/MeshTools/Test/CompressIndicesTest.cpp
  51. 16
      src/Magnum/MeshTools/Test/ConcatenateTest.cpp
  52. 36
      src/Magnum/MeshTools/Test/DuplicateTest.cpp
  53. 4
      src/Magnum/MeshTools/Test/FlipNormalsTest.cpp
  54. 44
      src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp
  55. 28
      src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp
  56. 37
      src/Magnum/MeshTools/Test/InterleaveTest.cpp
  57. 16
      src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp
  58. 12
      src/Magnum/MeshTools/Test/SubdivideTest.cpp
  59. 2
      src/Magnum/PixelFormat.cpp
  60. 2
      src/Magnum/Platform/GlfwApplication.cpp
  61. 4
      src/Magnum/Platform/Sdl2Application.cpp
  62. 1
      src/Magnum/Primitives/Implementation/Spheroid.h
  63. 2
      src/Magnum/SceneGraph/Object.hpp
  64. 44
      src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp
  65. 62
      src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp
  66. 32
      src/Magnum/SceneGraph/Test/ObjectTest.cpp
  67. 62
      src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp
  68. 58
      src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp
  69. 14
      src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp
  70. 8
      src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp
  71. 24
      src/Magnum/Shaders/Test/FlatGLTest.cpp
  72. 40
      src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp
  73. 32
      src/Magnum/Shaders/Test/PhongGLTest.cpp
  74. 8
      src/Magnum/Shaders/Test/VectorGLTest.cpp
  75. 4
      src/Magnum/Shaders/Test/VertexColorGLTest.cpp
  76. 11
      src/Magnum/Test/ImageTest.cpp
  77. 19
      src/Magnum/Test/ImageViewTest.cpp
  78. 12
      src/Magnum/Test/MeshTest.cpp
  79. 32
      src/Magnum/Test/PixelFormatTest.cpp
  80. 37
      src/Magnum/Test/ResourceManagerTest.cpp
  81. 80
      src/Magnum/Test/VertexFormatTest.cpp
  82. 10
      src/Magnum/Text/AbstractFont.cpp
  83. 12
      src/Magnum/Text/AbstractFontConverter.cpp
  84. 2
      src/Magnum/Text/AbstractGlyphCache.cpp
  85. 4
      src/Magnum/Text/DistanceFieldGlyphCache.cpp
  86. 60
      src/Magnum/Text/Test/AbstractFontTest.cpp
  87. 12
      src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp
  88. 4
      src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp
  89. 8
      src/Magnum/Trade/AbstractImageConverter.cpp
  90. 30
      src/Magnum/Trade/AbstractImporter.cpp
  91. 2
      src/Magnum/Trade/AnimationData.h
  92. 4
      src/Magnum/Trade/MeshData.cpp
  93. 12
      src/Magnum/Trade/MeshData.h
  94. 44
      src/Magnum/Trade/Test/AbstractImageConverterTest.cpp
  95. 332
      src/Magnum/Trade/Test/AbstractImporterTest.cpp
  96. 24
      src/Magnum/Trade/Test/AnimationDataTest.cpp
  97. 12
      src/Magnum/Trade/Test/CameraDataTest.cpp
  98. 35
      src/Magnum/Trade/Test/ImageDataTest.cpp
  99. 8
      src/Magnum/Trade/Test/MaterialDataTest.cpp
  100. 180
      src/Magnum/Trade/Test/MeshDataTest.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

90
src/Magnum/Animation/Test/InterpolationTest.cpp

@ -41,15 +41,25 @@ struct InterpolationTest: TestSuite::Tester {
explicit InterpolationTest();
void interpolatorFor();
void interpolatorForInvalid();
void interpolatorForBool();
void interpolatorForBoolInvalid();
void interpolatorForBoolVector();
void interpolatorForBoolVectorInvalid();
void interpolatorForComplex();
void interpolatorForComplexInvalid();
void interpolatorForQuaternion();
void interpolatorForQuaternionInvalid();
void interpolatorForDualQuaternion();
void interpolatorForDualQuaternionInvalid();
void interpolatorForCubicHermiteScalar();
void interpolatorForCubicHermiteScalarInvalid();
void interpolatorForCubicHermiteVector();
void interpolatorForCubicHermiteVectorInvalid();
void interpolatorForCubicHermiteComplex();
void interpolatorForCubicHermiteComplexInvalid();
void interpolatorForCubicHermiteQuaternion();
void interpolatorForCubicHermiteQuaternionInvalid();
void interpolate();
void interpolateStrict();
@ -148,15 +158,25 @@ const struct {
InterpolationTest::InterpolationTest() {
addTests({&InterpolationTest::interpolatorFor,
&InterpolationTest::interpolatorForInvalid,
&InterpolationTest::interpolatorForBool,
&InterpolationTest::interpolatorForBoolInvalid,
&InterpolationTest::interpolatorForBoolVector,
&InterpolationTest::interpolatorForBoolVectorInvalid,
&InterpolationTest::interpolatorForComplex,
&InterpolationTest::interpolatorForComplexInvalid,
&InterpolationTest::interpolatorForQuaternion,
&InterpolationTest::interpolatorForQuaternionInvalid,
&InterpolationTest::interpolatorForDualQuaternion,
&InterpolationTest::interpolatorForDualQuaternionInvalid,
&InterpolationTest::interpolatorForCubicHermiteScalar,
&InterpolationTest::interpolatorForCubicHermiteScalarInvalid,
&InterpolationTest::interpolatorForCubicHermiteVector,
&InterpolationTest::interpolatorForCubicHermiteVectorInvalid,
&InterpolationTest::interpolatorForCubicHermiteComplex,
&InterpolationTest::interpolatorForCubicHermiteQuaternion});
&InterpolationTest::interpolatorForCubicHermiteComplexInvalid,
&InterpolationTest::interpolatorForCubicHermiteQuaternion,
&InterpolationTest::interpolatorForCubicHermiteQuaternionInvalid});
addInstancedTests({&InterpolationTest::interpolate,
&InterpolationTest::interpolateStrict},
@ -195,6 +215,12 @@ void InterpolationTest::interpolatorFor() {
Vector2{0.3f, 0.5f}, Vector2{-0.3f, -1.5f}, 0.5f), (Vector2{0.3f, 0.5f}));
CORRADE_COMPARE(Animation::interpolatorFor<Vector2>(Interpolation::Linear)(
Vector2{0.3f, 0.5f}, Vector2{-0.3f, -1.5f}, 0.5f), (Vector2{0.0f, -0.5f}));
}
void InterpolationTest::interpolatorForInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -211,6 +237,12 @@ void InterpolationTest::interpolatorForBool() {
true, false, 0.5f), true);
CORRADE_COMPARE(Animation::interpolatorFor<bool>(Interpolation::Linear)(
true, false, 0.5f), true);
}
void InterpolationTest::interpolatorForBoolInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -227,6 +259,12 @@ void InterpolationTest::interpolatorForBoolVector() {
Math::BoolVector<4>{0xa}, Math::BoolVector<4>{0x5}, 0.5f), (Math::BoolVector<4>{0xa}));
CORRADE_COMPARE(Animation::interpolatorFor<Math::BoolVector<4>>(Interpolation::Linear)(
Math::BoolVector<4>{0xa}, Math::BoolVector<4>{0x5}, 0.5f), (Math::BoolVector<4>{0xa}));
}
void InterpolationTest::interpolatorForBoolVectorInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -247,6 +285,12 @@ void InterpolationTest::interpolatorForComplex() {
Complex::rotation(25.0_degf),
Complex::rotation(75.0_degf), 0.5f),
Complex::rotation(50.0_degf));
}
void InterpolationTest::interpolatorForComplexInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -267,6 +311,12 @@ void InterpolationTest::interpolatorForQuaternion() {
Quaternion::rotation(25.0_degf, Vector3::xAxis()),
Quaternion::rotation(75.0_degf, Vector3::xAxis()), 0.5f),
Quaternion::rotation(50.0_degf, Vector3::xAxis()));
}
void InterpolationTest::interpolatorForQuaternionInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -287,6 +337,12 @@ void InterpolationTest::interpolatorForDualQuaternion() {
DualQuaternion::translation(Vector3::xAxis(2.5f)),
DualQuaternion::translation(Vector3::xAxis(7.5f)), 0.5f),
DualQuaternion::translation(Vector3::xAxis(5.0f)));
}
void InterpolationTest::interpolatorForDualQuaternionInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -304,6 +360,12 @@ void InterpolationTest::interpolatorForCubicHermiteScalar() {
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermite1D>(Interpolation::Constant)(a, b, 0.8f), 3.0f);
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermite1D>(Interpolation::Linear)(a, b, 0.8f), -1.0f);
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermite1D>(Interpolation::Spline)(a, b, 0.8f), -2.152f);
}
void InterpolationTest::interpolatorForCubicHermiteScalarInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -321,6 +383,12 @@ void InterpolationTest::interpolatorForCubicHermiteVector() {
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermite2D>(Interpolation::Constant)(a, b, 0.8f), (Vector2{3.0f, 0.1f}));
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermite2D>(Interpolation::Linear)(a, b, 0.8f), (Vector2{-1.0f, 0.9f}));
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermite2D>(Interpolation::Spline)(a, b, 0.8f), (Vector2{-2.152f, 0.9576f}));
}
void InterpolationTest::interpolatorForCubicHermiteVectorInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -338,6 +406,12 @@ void InterpolationTest::interpolatorForCubicHermiteComplex() {
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermiteComplex>(Interpolation::Constant)(a, b, 0.8f), (Complex{0.999445f, 0.0333148f}));
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermiteComplex>(Interpolation::Linear)(a, b, 0.8f), (Complex{-0.78747f, 0.616353f}));
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermiteComplex>(Interpolation::Spline)(a, b, 0.8f), (Complex{-0.95958f, 0.281435f}));
}
void InterpolationTest::interpolatorForCubicHermiteComplexInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -361,6 +435,12 @@ void InterpolationTest::interpolatorForCubicHermiteQuaternion() {
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermiteQuaternion>(Interpolation::Constant)(a, b, 0.8f), (Quaternion{{0.780076f, 0.0260025f, 0.598059f}, 0.182018f}));
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermiteQuaternion>(Interpolation::Linear)(a, b, 0.8f), (Quaternion{{-0.533196f, 0.410685f, 0.521583f}, 0.524396f}));
CORRADE_COMPARE(Animation::interpolatorFor<CubicHermiteQuaternion>(Interpolation::Spline)(a, b, 0.8f), (Quaternion{{-0.911408f, 0.23368f, 0.185318f}, 0.283524f}));
}
void InterpolationTest::interpolatorForCubicHermiteQuaternionInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -477,6 +557,10 @@ void InterpolationTest::interpolateStrictIntegerKey() {
}
void InterpolationTest::interpolateError() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -490,6 +574,10 @@ void InterpolationTest::interpolateError() {
}
void InterpolationTest::interpolateStrictError() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

4
src/Magnum/Animation/Test/PlayerTest.cpp

@ -326,6 +326,10 @@ void PlayerTest::setDurationReplace() {
}
void PlayerTest::trackInvalidIndex() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

2
src/Magnum/Audio/AbstractImporter.cpp

@ -90,7 +90,7 @@ bool AbstractImporter::openData(Containers::ArrayView<const char> data) {
}
void AbstractImporter::doOpenData(Containers::ArrayView<const char>) {
CORRADE_ASSERT(false, "Audio::AbstractImporter::openData(): feature advertised but not implemented", );
CORRADE_ASSERT_UNREACHABLE("Audio::AbstractImporter::openData(): feature advertised but not implemented", );
}
bool AbstractImporter::openFile(const std::string& filename) {

28
src/Magnum/Audio/Test/AbstractImporterTest.cpp

@ -188,6 +188,10 @@ void AbstractImporterTest::openFileAsDataNotFound() {
}
void AbstractImporterTest::openFileNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct Importer: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -206,6 +210,10 @@ void AbstractImporterTest::openFileNotImplemented() {
}
void AbstractImporterTest::openDataNotSupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -224,6 +232,10 @@ void AbstractImporterTest::openDataNotSupported() {
}
void AbstractImporterTest::openDataNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; }
bool doIsOpened() const override { return false; }
@ -256,6 +268,10 @@ void AbstractImporterTest::format() {
}
void AbstractImporterTest::formatNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -288,6 +304,10 @@ void AbstractImporterTest::frequency() {
}
void AbstractImporterTest::frequencyNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -324,6 +344,10 @@ void AbstractImporterTest::data() {
}
void AbstractImporterTest::dataNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -342,6 +366,10 @@ void AbstractImporterTest::dataNoFile() {
}
void AbstractImporterTest::dataCustomDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }

9
src/Magnum/DebugTools/CompareImage.cpp

@ -99,6 +99,9 @@ std::tuple<Containers::Array<Float>, Float, Float> calculateImageDelta(const Pix
{std::size_t(expected.size().y()), std::size_t(expected.size().x())}};
CORRADE_INTERNAL_ASSERT(actualFormat == expected.format());
#ifdef CORRADE_NO_ASSERT
static_cast<void>(actualFormat);
#endif
CORRADE_ASSERT(!isPixelFormatImplementationSpecific(expected.format()),
"DebugTools::CompareImage: can't compare implementation-specific pixel formats", {});
@ -167,8 +170,7 @@ std::tuple<Containers::Array<Float>, Float, Float> calculateImageDelta(const Pix
case PixelFormat::RG16F:
case PixelFormat::RGB16F:
case PixelFormat::RGBA16F:
CORRADE_ASSERT(false,
"DebugTools::CompareImage: half-float formats are not supported yet", {});
CORRADE_ASSERT_UNREACHABLE("DebugTools::CompareImage: half-float formats are not supported yet", {});
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
@ -667,6 +669,9 @@ void ImageComparatorBase::printMessage(const TestSuite::ComparisonStatusFlags fl
<< _state->maxThreshold << Debug::nospace << ".";
else if(_state->result == Result::VerboseMessage) {
CORRADE_INTERNAL_ASSERT(flags & TestSuite::ComparisonStatusFlag::Verbose);
#ifdef CORRADE_NO_ASSERT
static_cast<void>(flags);
#endif
out << "deltas" << _state->max << Debug::nospace << "/"
<< Debug::nospace << _state->mean << "below threshold"
<< _state->maxThreshold << Debug::nospace << "/"

24
src/Magnum/DebugTools/Test/CompareImageTest.cpp

@ -238,6 +238,10 @@ const ImageView2D ActualRed{PixelFormat::R32F, {3, 3}, ActualRedData};
const ImageView2D ExpectedRed{PixelFormat::R32F, {3, 3}, ExpectedRedData};
void CompareImageTest::formatUnknown() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -248,6 +252,10 @@ void CompareImageTest::formatUnknown() {
}
void CompareImageTest::formatHalf() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -258,6 +266,10 @@ void CompareImageTest::formatHalf() {
}
void CompareImageTest::formatImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -825,6 +837,10 @@ void CompareImageTest::compareSpecialsMeanOnly() {
}
void CompareImageTest::compareSpecialsDisallowedThreshold() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
{
@ -844,16 +860,16 @@ void CompareImageTest::setupExternalPluginManager() {
/* Load the plugin directly from the build tree. Otherwise it's either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_importerManager->load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_importerManager->load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef ANYIMAGECONVERTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_converterManager->load(ANYIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_converterManager->load(ANYIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_importerManager->load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_importerManager->load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMAGECONVERTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_converterManager->load(TGAIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_converterManager->load(TGAIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
}

4
src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp

@ -68,10 +68,10 @@ ForceRendererGLTest::ForceRendererGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
}

4
src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp

@ -68,10 +68,10 @@ ObjectRendererGLTest::ObjectRendererGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
}

8
src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp

@ -80,16 +80,16 @@ ScreenshotGLTest::ScreenshotGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGECONVERTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_converterManager.load(ANYIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_converterManager.load(ANYIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMAGECONVERTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_converterManager.load(TGAIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_converterManager.load(TGAIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_importerManager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_importerManager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_importerManager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_importerManager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
}

2
src/Magnum/DebugTools/TextureImage.cpp

@ -134,7 +134,7 @@ void textureSubImage(GL::Texture2D& texture, const Int level, const Range2Di& ra
reinterpretFormat = GL::PixelFormat::RGBAInteger;
break;
default:
CORRADE_ASSERT(false, "DebugTools::textureSubImage(): unsupported pixel format" << format, );
CORRADE_ASSERT_UNREACHABLE("DebugTools::textureSubImage(): unsupported pixel format" << format, );
}
GL::Texture2D output;

8
src/Magnum/GL/AbstractTexture.cpp

@ -580,7 +580,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
/* RGTC is on WebGL 1 but there's no Red pixel format (which is
okay because WebGL doesn't allow compression by upload anyway).
Assert here to have the enum value handled. */
CORRADE_ASSERT(false, "No single-component pixel format in WebGL 1 for RGTC compression", {});
CORRADE_ASSERT_UNREACHABLE("No single-component pixel format in WebGL 1 for RGTC compression", {});
#endif
#endif
@ -630,7 +630,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
/* RGTC is on WebGL 1 but there's no RG pixel format (which is okay
because WebGL doesn't allow compression by upload anyway).
Assert here to have the enum value handled. */
CORRADE_ASSERT(false, "No two-component pixel format in WebGL 1 for RGTC compression", {});
CORRADE_ASSERT_UNREACHABLE("No two-component pixel format in WebGL 1 for RGTC compression", {});
#endif
#endif
@ -1031,7 +1031,7 @@ PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) {
/* RGTC is on WebGL 1 but there's no RG pixel format (which is okay
because WebGL doesn't allow compression by upload anyway).
Assert here to have the enum value handled. */
CORRADE_ASSERT(false, "No signed pixel type in OpenGL ES 2.0 for RGTC compression", {});
CORRADE_ASSERT_UNREACHABLE("No signed pixel type in OpenGL ES 2.0 for RGTC compression", {});
#endif
#endif
@ -1975,7 +1975,6 @@ template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<2>(GLint, con
template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<3>(GLint, const Range3Di&, CompressedImage<3>&);
template<UnsignedInt dimensions> void AbstractTexture::compressedSubImage(const GLint level, const RangeTypeFor<dimensions, Int>& range, const BasicMutableCompressedImageView<dimensions>& image) {
#ifndef CORRADE_NO_ASSERT
CORRADE_ASSERT(image.data().data() != nullptr || !(Math::Vector<dimensions, Int>(range.size()).product()),
"GL::AbstractTexture::compressedSubImage(): image view is nullptr", );
CORRADE_ASSERT(image.size() == range.size(),
@ -1985,6 +1984,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedSubImage(const
const Math::Vector<dimensions, Int> size = range.size();
#ifndef CORRADE_NO_ASSERT
/* Internal texture format */
GLint format;
(this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);

2
src/Magnum/GL/Attribute.cpp

@ -605,7 +605,7 @@ DynamicAttribute::DynamicAttribute(const Kind kind, UnsignedInt location, const
#endif
}
#ifndef CORRADE_NO_DEBUG
#ifndef CORRADE_NO_ASSERT
CORRADE_ASSERT(_vectors <= maxVectors,
"GL::DynamicAttribute: can't use" << format << "for a" << maxVectors << Debug::nospace << "-vector attribute", );
/* Should pass also if maxComponents is GL_BGRA */

6
src/Magnum/GL/CubeMapTexture.cpp

@ -153,7 +153,6 @@ CompressedImage3D CubeMapTexture::compressedImage(const Int level, CompressedIma
}
void CubeMapTexture::compressedImage(const Int level, const MutableCompressedImageView3D& image) {
#ifndef CORRADE_NO_ASSERT
const Vector3i size{imageSize(level), 6};
CORRADE_ASSERT(image.data().data() != nullptr || !size.product(),
@ -172,6 +171,7 @@ void CubeMapTexture::compressedImage(const Int level, const MutableCompressedIma
CORRADE_ASSERT(image.data().size() == dataOffsetSize.first + dataOffsetSize.second,
"GL::CubeMapTexture::compressedImage(): expected image view data size" << dataOffsetSize.first + dataOffsetSize.second << "bytes but got" << image.data().size(), );
#ifndef CORRADE_NO_ASSERT
/* Internal texture format */
GLint format;
(this->*Context::current().state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
@ -239,13 +239,11 @@ Image2D CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int leve
}
void CubeMapTexture::image(const CubeMapCoordinate coordinate, const Int level, const MutableImageView2D& image) {
#ifndef CORRADE_NO_ASSERT
const Vector2i size = imageSize(level);
CORRADE_ASSERT(image.data().data() != nullptr || !size.product(),
"GL::CubeMapTexture::image(): image view is nullptr", );
CORRADE_ASSERT(image.size() == size,
"GL::CubeMapTexture::image(): expected image view size" << size << "but got" << image.size(), );
#endif
Buffer::unbindInternal(Buffer::TargetHint::PixelPack);
Context::current().state().renderer->applyPixelStoragePack(image.storage());
@ -306,7 +304,6 @@ CompressedImage2D CubeMapTexture::compressedImage(const CubeMapCoordinate coordi
}
void CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const Int level, const MutableCompressedImageView2D& image) {
#ifndef CORRADE_NO_ASSERT
const Vector2i size = imageSize(level);
CORRADE_ASSERT(image.data().data() != nullptr || !size.product(),
@ -314,6 +311,7 @@ void CubeMapTexture::compressedImage(const CubeMapCoordinate coordinate, const I
CORRADE_ASSERT(image.size() == size,
"GL::CubeMapTexture::compressedImage(): expected image view size" << size << "but got" << image.size(), );
#ifndef CORRADE_NO_ASSERT
/* If the user-provided pixel storage doesn't tell us all properties about
the compression, we need to ask GL for it */
std::size_t dataSize;

4
src/Magnum/GL/Mesh.cpp

@ -429,7 +429,7 @@ void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr i
/* Indexed mesh */
} else glDrawElementsBaseVertex(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast<GLvoid*>(indexOffset), baseVertex);
#else
CORRADE_ASSERT(false, "GL::Mesh::draw(): desktop OpenGL is required for base vertex specification in indexed meshes", );
CORRADE_ASSERT_UNREACHABLE("GL::Mesh::draw(): desktop OpenGL is required for base vertex specification in indexed meshes", );
#endif
/* Indexed mesh */
@ -488,7 +488,7 @@ void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr i
glDrawElementsInstancedBaseVertex(GLenum(_primitive), count, GLenum(_indexType), reinterpret_cast<GLvoid*>(indexOffset), instanceCount, baseVertex);
}
#else
CORRADE_ASSERT(false, "GL::Mesh::draw(): OpenGL ES 3.2 or desktop GL is required for base vertex specification in indexed meshes", );
CORRADE_ASSERT_UNREACHABLE("GL::Mesh::draw(): OpenGL ES 3.2 or desktop GL is required for base vertex specification in indexed meshes", );
#endif
/* Indexed mesh */

2
src/Magnum/GL/PixelFormat.cpp

@ -252,7 +252,7 @@ UnsignedInt pixelSize(const PixelFormat format, const PixelType type) {
/* Handled above */
case PixelFormat::DepthStencil:
CORRADE_ASSERT(false, "GL::pixelSize(): invalid" << type << "specified for" << format, 0);
CORRADE_ASSERT_UNREACHABLE("GL::pixelSize(): invalid" << type << "specified for" << format, 0);
}
#ifdef __GNUC__
#pragma GCC diagnostic pop

4
src/Magnum/GL/PixelFormat.h

@ -35,6 +35,10 @@
#include "Magnum/GL/OpenGL.h"
#include "Magnum/GL/visibility.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum { namespace GL {
/**

2
src/Magnum/GL/Shader.cpp

@ -673,7 +673,7 @@ Shader::Shader(const Version version, const Type type): _type(type), _id(0) {
case Version::None: return;
}
CORRADE_ASSERT(false, "GL::Shader::Shader(): unsupported version" << version, );
CORRADE_ASSERT_UNREACHABLE("GL::Shader::Shader(): unsupported version" << version, );
}
Shader::~Shader() {

2
src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp

@ -799,7 +799,7 @@ void AbstractShaderProgramGLTest::compute() {
#endif
Shader::Type::Compute);
compute.addSource(rs.get("ComputeShader.comp"));
CORRADE_INTERNAL_ASSERT(compute.compile());
CORRADE_INTERNAL_ASSERT_OUTPUT(compute.compile());
attachShader(compute);
link();

48
src/Magnum/GL/Test/AbstractTextureGLTest.cpp

@ -125,6 +125,10 @@ void AbstractTextureGLTest::constructMove() {
#ifndef MAGNUM_TARGET_GLES
void AbstractTextureGLTest::imageQueryViewNullptr() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Texture2D texture;
texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2});
@ -139,6 +143,10 @@ void AbstractTextureGLTest::imageQueryViewNullptr() {
}
void AbstractTextureGLTest::imageQueryViewBadSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Texture2D texture;
texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2});
@ -154,6 +162,10 @@ void AbstractTextureGLTest::imageQueryViewBadSize() {
}
void AbstractTextureGLTest::subImageQueryViewNullptr() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Texture2D texture;
texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2});
@ -168,6 +180,10 @@ void AbstractTextureGLTest::subImageQueryViewNullptr() {
}
void AbstractTextureGLTest::subImageQueryViewBadSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
@ -186,6 +202,10 @@ void AbstractTextureGLTest::subImageQueryViewBadSize() {
}
void AbstractTextureGLTest::compressedImageQueryViewNullptr() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -203,6 +223,10 @@ void AbstractTextureGLTest::compressedImageQueryViewNullptr() {
}
void AbstractTextureGLTest::compressedImageQueryViewBadSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -221,6 +245,10 @@ void AbstractTextureGLTest::compressedImageQueryViewBadSize() {
}
void AbstractTextureGLTest::compressedImageQueryViewBadDataSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -239,6 +267,10 @@ void AbstractTextureGLTest::compressedImageQueryViewBadDataSize() {
}
void AbstractTextureGLTest::compressedImageQueryViewBadFormat() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -257,6 +289,10 @@ void AbstractTextureGLTest::compressedImageQueryViewBadFormat() {
}
void AbstractTextureGLTest::compressedSubImageQueryViewNullptr() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
@ -278,6 +314,10 @@ void AbstractTextureGLTest::compressedSubImageQueryViewNullptr() {
}
void AbstractTextureGLTest::compressedSubImageQueryViewBadSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
@ -300,6 +340,10 @@ void AbstractTextureGLTest::compressedSubImageQueryViewBadSize() {
}
void AbstractTextureGLTest::compressedSubImageQueryViewBadDataSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
@ -322,6 +366,10 @@ void AbstractTextureGLTest::compressedSubImageQueryViewBadDataSize() {
}
void AbstractTextureGLTest::compressedSubImageQueryViewBadFormat() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())

20
src/Magnum/GL/Test/AttributeTest.cpp

@ -776,6 +776,10 @@ void AttributeTest::attributeFromGenericFormatEnableNormalized() {
}
void AttributeTest::attributeFromGenericFormatUnexpectedForNormalizedKind() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
DynamicAttribute{DynamicAttribute::Kind::GenericNormalized, 3,
@ -786,6 +790,10 @@ void AttributeTest::attributeFromGenericFormatUnexpectedForNormalizedKind() {
#ifndef MAGNUM_TARGET_GLES2
void AttributeTest::attributeFromGenericFormatUnexpectedForIntegralKind() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
DynamicAttribute{DynamicAttribute::Kind::Integral, 3,
@ -800,6 +808,10 @@ void AttributeTest::attributeFromGenericFormatUnexpectedForIntegralKind() {
#ifndef MAGNUM_TARGET_GLES
void AttributeTest::attributeFromGenericFormatUnexpectedForLongKind() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
DynamicAttribute{DynamicAttribute::Kind::Long, 3,
@ -810,6 +822,10 @@ void AttributeTest::attributeFromGenericFormatUnexpectedForLongKind() {
#endif
void AttributeTest::attributeFromGenericFormatTooManyVectors() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
DynamicAttribute{Attribute<7, Vector2>{}, VertexFormat::Matrix2x2};
@ -818,6 +834,10 @@ void AttributeTest::attributeFromGenericFormatTooManyVectors() {
}
void AttributeTest::attributeFromGenericFormatTooManyComponents() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
DynamicAttribute{Attribute<7, Vector2>{}, VertexFormat::Vector3};

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

@ -330,6 +330,10 @@ void BufferImageGLTest::constructBufferCompressedGeneric() {
}
void BufferImageGLTest::constructInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

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

@ -899,6 +899,10 @@ void CubeMapTextureGLTest::imageQueryView() {
}
void CubeMapTextureGLTest::imageQueryViewNullptr() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
CubeMapTexture texture;
texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2});
@ -914,6 +918,10 @@ void CubeMapTextureGLTest::imageQueryViewNullptr() {
}
void CubeMapTextureGLTest::imageQueryViewBadSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
CubeMapTexture texture;
texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2});
@ -1241,6 +1249,10 @@ void CubeMapTextureGLTest::compressedImageQueryView() {
}
void CubeMapTextureGLTest::compressedImageQueryViewNullptr() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1258,6 +1270,10 @@ void CubeMapTextureGLTest::compressedImageQueryViewNullptr() {
}
void CubeMapTextureGLTest::compressedImageQueryViewBadSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1276,6 +1292,10 @@ void CubeMapTextureGLTest::compressedImageQueryViewBadSize() {
}
void CubeMapTextureGLTest::compressedImageQueryViewBadDataSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1294,6 +1314,10 @@ void CubeMapTextureGLTest::compressedImageQueryViewBadDataSize() {
}
void CubeMapTextureGLTest::compressedImageQueryViewBadFormat() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1583,6 +1607,10 @@ void CubeMapTextureGLTest::compressedSubImageQueryView() {
}
void CubeMapTextureGLTest::compressedSubImageQueryViewNullptr() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1600,6 +1628,10 @@ void CubeMapTextureGLTest::compressedSubImageQueryViewNullptr() {
}
void CubeMapTextureGLTest::compressedSubImageQueryViewBadSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1618,6 +1650,10 @@ void CubeMapTextureGLTest::compressedSubImageQueryViewBadSize() {
}
void CubeMapTextureGLTest::compressedSubImageQueryViewBadDataSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1636,6 +1672,10 @@ void CubeMapTextureGLTest::compressedSubImageQueryViewBadDataSize() {
}
void CubeMapTextureGLTest::compressedSubImageQueryViewBadFormat() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1745,6 +1785,10 @@ void CubeMapTextureGLTest::fullImageQueryView() {
}
void CubeMapTextureGLTest::fullImageQueryViewNullptr() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
CubeMapTexture texture;
texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2});
@ -1760,6 +1804,10 @@ void CubeMapTextureGLTest::fullImageQueryViewNullptr() {
}
void CubeMapTextureGLTest::fullImageQueryViewBadSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
CubeMapTexture texture;
texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2});
@ -1909,6 +1957,10 @@ void CubeMapTextureGLTest::compressedFullImageQueryView() {
}
void CubeMapTextureGLTest::compressedFullImageQueryViewNullptr() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1926,6 +1978,10 @@ void CubeMapTextureGLTest::compressedFullImageQueryViewNullptr() {
}
void CubeMapTextureGLTest::compressedFullImageQueryViewBadSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1944,6 +2000,10 @@ void CubeMapTextureGLTest::compressedFullImageQueryViewBadSize() {
}
void CubeMapTextureGLTest::compressedFullImageQueryViewBadDataSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
@ -1962,6 +2022,10 @@ void CubeMapTextureGLTest::compressedFullImageQueryViewBadDataSize() {
}
void CubeMapTextureGLTest::compressedFullImageQueryViewBadFormat() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
if(!Context::current().isExtensionSupported<Extensions::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));

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

@ -1584,6 +1584,10 @@ void FramebufferGLTest::readView() {
}
void FramebufferGLTest::readViewNullptr() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
#ifndef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available."));
@ -1608,6 +1612,10 @@ void FramebufferGLTest::readViewNullptr() {
}
void FramebufferGLTest::readViewBadSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
#ifndef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available."));

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

@ -1770,6 +1770,10 @@ void MeshGLTest::addVertexBufferMultipleGaps() {
}
void MeshGLTest::addVertexBufferMovedOutInstance() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Buffer buffer{NoCreate};
Mesh mesh;
@ -2095,6 +2099,10 @@ void MeshGLTest::setIndexBufferUnsignedInt() {
}
void MeshGLTest::setIndexBufferMovedOutInstance() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Buffer buffer{NoCreate};
Mesh mesh;

20
src/Magnum/GL/Test/MeshTest.cpp

@ -129,6 +129,10 @@ struct Shader: AbstractShaderProgram {
};
void MeshTest::drawCountNotSet() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -139,6 +143,10 @@ void MeshTest::drawCountNotSet() {
}
void MeshTest::drawViewCountNotSet() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -189,6 +197,10 @@ void MeshTest::mapPrimitiveImplementationSpecific() {
}
void MeshTest::mapPrimitiveUnsupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
meshPrimitive(Magnum::MeshPrimitive::Instances);
@ -196,6 +208,10 @@ void MeshTest::mapPrimitiveUnsupported() {
}
void MeshTest::mapPrimitiveInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -235,6 +251,10 @@ void MeshTest::mapIndexType() {
}
void MeshTest::mapIndexTypeInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

52
src/Magnum/GL/Test/PixelFormatTest.cpp

@ -197,6 +197,10 @@ void PixelFormatTest::mapFormatImplementationSpecific() {
}
void PixelFormatTest::mapFormatUnsupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
#ifndef MAGNUM_TARGET_GLES2
CORRADE_SKIP("All pixel formats are supported on ES3+.");
#else
@ -210,6 +214,10 @@ void PixelFormatTest::mapFormatUnsupported() {
}
void PixelFormatTest::mapFormatInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -230,6 +238,10 @@ void PixelFormatTest::mapTypeImplementationSpecific() {
}
void PixelFormatTest::mapTypeImplementationSpecificZero() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -238,6 +250,10 @@ void PixelFormatTest::mapTypeImplementationSpecificZero() {
}
void PixelFormatTest::mapTypeUnsupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
#ifndef MAGNUM_TARGET_GLES2
CORRADE_SKIP("All pixel formats are supported on ES3+.");
#else
@ -251,6 +267,10 @@ void PixelFormatTest::mapTypeUnsupported() {
}
void PixelFormatTest::mapTypeInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
pixelType(Magnum::PixelFormat{});
@ -261,6 +281,10 @@ void PixelFormatTest::mapTypeInvalid() {
}
void PixelFormatTest::mapTextureFormatImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
hasTextureFormat(Magnum::pixelFormatWrap(PixelFormat::RGBA));
@ -271,6 +295,10 @@ void PixelFormatTest::mapTextureFormatImplementationSpecific() {
}
void PixelFormatTest::mapTextureFormatUnsupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2)
CORRADE_SKIP("All pixel formats are supported on ES3+.");
#elif defined(MAGNUM_TARGET_GLES2)
@ -289,6 +317,10 @@ void PixelFormatTest::mapTextureFormatUnsupported() {
}
void PixelFormatTest::mapTextureFormatInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -320,6 +352,10 @@ void PixelFormatTest::size() {
}
void PixelFormatTest::sizeInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
pixelSize(PixelFormat::DepthStencil, PixelType::Float);
@ -400,6 +436,10 @@ void PixelFormatTest::mapCompressedFormatImplementationSpecific() {
}
void PixelFormatTest::mapCompressedFormatUnsupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
#ifdef MAGNUM_TARGET_GLES2
CORRADE_VERIFY(!hasCompressedPixelFormat(Magnum::CompressedPixelFormat::Etc2RGB8Unorm));
@ -420,6 +460,10 @@ void PixelFormatTest::mapCompressedFormatUnsupported() {
}
void PixelFormatTest::mapCompressedFormatInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -441,6 +485,10 @@ void PixelFormatTest::mapCompressedTextureFormatImplementationSpecific() {
}
void PixelFormatTest::mapCompressedTextureFormatUnsupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
#ifdef MAGNUM_TARGET_GLES2
CORRADE_VERIFY(!hasTextureFormat(Magnum::CompressedPixelFormat::Etc2RGB8Unorm));
@ -461,6 +509,10 @@ void PixelFormatTest::mapCompressedTextureFormatUnsupported() {
}
void PixelFormatTest::mapCompressedTextureFormatInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

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

@ -88,10 +88,10 @@ RendererGLTest::RendererGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef CORRADE_TARGET_APPLE

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

@ -85,6 +85,10 @@ void SamplerTest::mapFilter() {
}
void SamplerTest::mapFilterInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -100,6 +104,10 @@ void SamplerTest::mapMipmap() {
}
void SamplerTest::mapMipmapInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -134,6 +142,10 @@ void SamplerTest::mapWrappingArray() {
}
void SamplerTest::mapWrappingInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

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

@ -419,6 +419,10 @@ void ComplexTest::invertedNormalized() {
}
void ComplexTest::invertedNormalizedNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -456,6 +460,10 @@ void ComplexTest::angleNormalizedButOver1() {
}
void ComplexTest::angleNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
Math::angle(Complex(1.5f, -2.0f).normalized(), {-4.0f, 3.5f});
@ -489,6 +497,10 @@ void ComplexTest::matrix() {
}
void ComplexTest::matrixNotOrthogonal() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -513,6 +525,10 @@ void ComplexTest::lerp() {
}
void ComplexTest::lerpNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -539,6 +555,10 @@ void ComplexTest::slerp() {
}
void ComplexTest::slerpNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

32
src/Magnum/Math/Test/CubicHermiteTest.cpp

@ -845,6 +845,10 @@ void CubicHermiteTest::lerpComplex() {
}
void CubicHermiteTest::lerpComplexNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -886,6 +890,10 @@ void CubicHermiteTest::lerpQuaternion() {
}
void CubicHermiteTest::lerpQuaternionNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -926,6 +934,10 @@ void CubicHermiteTest::lerpQuaternionShortestPath() {
}
void CubicHermiteTest::lerpQuaternionShortestPathNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -962,6 +974,10 @@ void CubicHermiteTest::slerpComplex() {
}
void CubicHermiteTest::slerpComplexNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -1003,6 +1019,10 @@ void CubicHermiteTest::slerpQuaternion() {
}
void CubicHermiteTest::slerpQuaternionNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -1044,6 +1064,10 @@ void CubicHermiteTest::slerpQuaternionShortestPath() {
}
void CubicHermiteTest::slerpQuaternionShortestPathNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -1116,6 +1140,10 @@ void CubicHermiteTest::splerpComplex() {
}
void CubicHermiteTest::splerpComplexNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -1153,6 +1181,10 @@ void CubicHermiteTest::splerpQuaternion() {
}
void CubicHermiteTest::splerpQuaternionNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

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

@ -192,6 +192,10 @@ void DistanceTest::pointPlaneNormalized() {
}
void DistanceTest::pointPlaneNormalizedNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

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

@ -380,6 +380,10 @@ void DualComplexTest::invertedNormalized() {
}
void DualComplexTest::invertedNormalizedNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -430,6 +434,10 @@ void DualComplexTest::matrix() {
}
void DualComplexTest::matrixNotOrthogonal() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream o;
Error redirectError{&o};

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

@ -420,6 +420,10 @@ void DualQuaternionTest::invertedNormalized() {
}
void DualQuaternionTest::invertedNormalizedNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -446,6 +450,10 @@ void DualQuaternionTest::rotation() {
}
void DualQuaternionTest::rotationNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -487,6 +495,10 @@ void DualQuaternionTest::matrix() {
}
void DualQuaternionTest::matrixNotOrthogonal() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -522,6 +534,10 @@ void DualQuaternionTest::transformVectorNormalized() {
}
void DualQuaternionTest::transformVectorNormalizedNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -564,6 +580,10 @@ void DualQuaternionTest::transformPointNormalized() {
}
void DualQuaternionTest::transformPointNormalizedNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

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

@ -299,6 +299,10 @@ void FrustumTest::convert() {
}
void FrustumTest::data() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
/* Using default-constructed to verify that the planes are in correct order */
constexpr Frustum a;

8
src/Magnum/Math/Test/FunctionsTest.cpp

@ -466,6 +466,10 @@ void FunctionsTest::reflect() {
}
void FunctionsTest::reflectNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
Math::reflect(Vector3{}, Vector3{1.0f});
@ -491,6 +495,10 @@ void FunctionsTest::refract() {
}
void FunctionsTest::refractNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
Math::refract(Vector3{}, Vector3{1.0f}, 0.0f);

3
src/Magnum/Math/Test/InterpolationBenchmark.cpp

@ -25,7 +25,10 @@
#include <Corrade/TestSuite/Tester.h>
#ifndef CORRADE_NO_ASSERT
#define CORRADE_NO_ASSERT
#endif
#include "Magnum/Math/DualQuaternion.h"
namespace Magnum { namespace Math { namespace Test { namespace {

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

@ -383,6 +383,10 @@ void IntersectionTest::sphereConeView() {
}
void IntersectionTest::sphereConeViewNotRigid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

20
src/Magnum/Math/Test/Matrix3Test.cpp

@ -355,6 +355,10 @@ void Matrix3Test::reflection() {
}
void Matrix3Test::reflectionNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -466,6 +470,10 @@ void Matrix3Test::rotationPart() {
}
void Matrix3Test::rotationPartNotOrthogonal() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -510,6 +518,10 @@ void Matrix3Test::rotationNormalizedPart() {
}
void Matrix3Test::rotationNormalizedPartNotOrthogonal() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -570,6 +582,10 @@ void Matrix3Test::uniformScalingPart() {
}
void Matrix3Test::uniformScalingPartNotUniform() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
Matrix3::scaling(Vector2::yScale(3.0f)).uniformScaling();
@ -614,6 +630,10 @@ void Matrix3Test::invertedRigid() {
}
void Matrix3Test::invertedRigidNotRigid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
(Matrix3::rotation(60.0_degf)*2.0f).invertedRigid();

24
src/Magnum/Math/Test/Matrix4Test.cpp

@ -399,6 +399,10 @@ void Matrix4Test::rotation() {
}
void Matrix4Test::rotationNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -447,6 +451,10 @@ void Matrix4Test::reflection() {
}
void Matrix4Test::reflectionNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -691,6 +699,10 @@ void Matrix4Test::rotationPart() {
}
void Matrix4Test::rotationPartNotOrthogonal() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -743,6 +755,10 @@ void Matrix4Test::rotationNormalizedPart() {
}
void Matrix4Test::rotationNormalizedPartNotOrthogonal() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -804,6 +820,10 @@ void Matrix4Test::uniformScalingPart() {
}
void Matrix4Test::uniformScalingPartNotUniform() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out}; Matrix4::scaling(Vector3::yScale(3.0f)).uniformScaling();
CORRADE_COMPARE(out.str(), "Math::Matrix4::uniformScaling(): the matrix doesn't have uniform scaling:\n"
@ -886,6 +906,10 @@ void Matrix4Test::invertedRigid() {
}
void Matrix4Test::invertedRigidNotRigid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

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

@ -393,6 +393,10 @@ void MatrixTest::invertedOrthogonal() {
}
void MatrixTest::invertedOrthogonalNotOrthogonal() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream o;
Error redirectError{&o};

12
src/Magnum/Math/Test/PackingBatchTest.cpp

@ -575,6 +575,10 @@ template<class T> void PackingBatchTest::castSignedInteger() {
}
template<class T> void PackingBatchTest::assertionsPackUnpack() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Math::Vector2<T> data[2]{};
Vector2 resultWrongCount[1]{};
Vector3 resultWrongVectorSize[2]{};
@ -607,6 +611,10 @@ template<class T> void PackingBatchTest::assertionsPackUnpack() {
}
void PackingBatchTest::assertionsPackUnpackHalf() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Vector2us data[2]{};
Vector2 resultWrongCount[1]{};
Vector3 resultWrongVectorSize[2]{};
@ -639,6 +647,10 @@ void PackingBatchTest::assertionsPackUnpackHalf() {
}
template<class U, class T> void PackingBatchTest::assertionsCast() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
setTestCaseTemplateName(Corrade::Utility::formatString("{}, {}", TypeTraits<U>::name(), TypeTraits<T>::name()));
Math::Vector2<T> data[2]{};

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

@ -361,6 +361,10 @@ void QuaternionTest::axisAngle() {
}
void QuaternionTest::axisAngleNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -459,6 +463,10 @@ void QuaternionTest::invertedNormalized() {
}
void QuaternionTest::invertedNormalizedNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -487,6 +495,10 @@ void QuaternionTest::rotation() {
}
void QuaternionTest::rotationNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -527,6 +539,10 @@ void QuaternionTest::angleNormalizedButOver1() {
}
void QuaternionTest::angleNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -583,6 +599,10 @@ void QuaternionTest::matrix() {
}
void QuaternionTest::matrixNotOrthogonal() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -617,6 +637,10 @@ void QuaternionTest::euler() {
}
void QuaternionTest::eulerNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -652,6 +676,10 @@ void QuaternionTest::lerp2D() {
}
void QuaternionTest::lerpNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -682,6 +710,10 @@ void QuaternionTest::lerpShortestPath() {
}
void QuaternionTest::lerpShortestPathNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -765,6 +797,10 @@ void QuaternionTest::slerpNormalizedButOver1() {
}
void QuaternionTest::slerpNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -824,6 +860,10 @@ template<class T> void QuaternionTest::slerpShortestPathLinearFallbackIsNormaliz
}
void QuaternionTest::slerpShortestPathNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -856,6 +896,10 @@ void QuaternionTest::transformVectorNormalized() {
}
void QuaternionTest::transformVectorNormalizedNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

8
src/Magnum/Math/Test/VectorTest.cpp

@ -554,6 +554,10 @@ void VectorTest::projectedOntoNormalized() {
}
void VectorTest::projectedOntoNormalizedNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Vector3 vector(1.0f, 2.0f, 3.0f);
Vector3 line(1.0f, -1.0f, 0.5f);
@ -597,6 +601,10 @@ void VectorTest::angleNormalizedButOver1() {
}
void VectorTest::angleNotNormalized() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
Math::angle(Vector3(2.0f, 3.0f, 4.0f).normalized(), {1.0f, -2.0f, 3.0f});

2
src/Magnum/MeshTools/CompressIndices.cpp

@ -183,7 +183,7 @@ std::tuple<Containers::Array<char>, MeshIndexType, UnsignedInt, UnsignedInt> com
}
template<class T> Containers::Array<T> compressIndicesAs(const std::vector<UnsignedInt>& indices) {
#if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT)
#ifndef CORRADE_NO_ASSERT
const auto max = Math::max(indices);
CORRADE_ASSERT(Math::log(256, max) < sizeof(T), "MeshTools::compressIndicesAs(): type too small to represent value" << max, {});
#endif

6
src/Magnum/MeshTools/GenerateIndices.cpp

@ -52,8 +52,7 @@ UnsignedInt primitiveCount(const MeshPrimitive primitive, const UnsignedInt elem
if(primitive == MeshPrimitive::TriangleStrip ||
primitive == MeshPrimitive::TriangleFan)
return elementCount < 2 ? 0 : elementCount - 2;
CORRADE_ASSERT(false,
"MeshTools::primitiveCount(): invalid primitive" << primitive, {});
CORRADE_ASSERT_UNREACHABLE("MeshTools::primitiveCount(): invalid primitive" << primitive, {});
}
void generateLineStripIndicesInto(const UnsignedInt vertexCount, const Containers::StridedArrayView1D<UnsignedInt>& indices) {
@ -214,8 +213,7 @@ Trade::MeshData generateIndices(Trade::MeshData&& data) {
primitive = MeshPrimitive::Triangles;
indexData = Containers::Array<char>{Containers::NoInit, 3*(vertexCount - 2)*sizeof(UnsignedInt)};
generateTriangleFanIndicesInto(vertexCount, Containers::arrayCast<UnsignedInt>(indexData));
} else CORRADE_ASSERT(false,
"MeshTools::generateIndices(): invalid primitive" << data.primitive(),
} else CORRADE_ASSERT_UNREACHABLE("MeshTools::generateIndices(): invalid primitive" << data.primitive(),
(Trade::MeshData{MeshPrimitive::Triangles, 0}));
Trade::MeshIndexData indices{MeshIndexType::UnsignedInt, indexData};

4
src/Magnum/MeshTools/Interleave.h

@ -48,7 +48,7 @@ namespace Implementation {
cyclic dependencies) */
struct AttributeCount {
template<class T, class ...U> typename std::enable_if<!std::is_convertible<T, std::size_t>::value, std::size_t>::type operator()(const T& first, const U&...
#if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT)
#ifndef CORRADE_NO_ASSERT
next
#endif
) const {
@ -180,7 +180,7 @@ large enough to contain the interleaved data.
*/
template<class T, class ...U> void interleaveInto(Containers::ArrayView<char> buffer, const T& first, const U&... next) {
/* Verify expected buffer size */
#if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT)
#ifndef CORRADE_NO_ASSERT
const std::size_t attributeCount = Implementation::AttributeCount{}(first, next...);
#endif
const std::size_t stride = Implementation::Stride{}(first, next...);

4
src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp

@ -51,6 +51,10 @@ CombineIndexedArraysTest::CombineIndexedArraysTest() {
CORRADE_IGNORE_DEPRECATED_PUSH
void CombineIndexedArraysTest::wrongIndexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream ss;
Error redirectError{&ss};
std::vector<UnsignedInt> a{0, 1, 0};

36
src/Magnum/MeshTools/Test/CombineTest.cpp

@ -151,6 +151,10 @@ void CombineTest::combineIndexedAttributesIndicesOnly() {
}
void CombineTest::combineIndexedAttributesNoMeshes() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshTools::combineIndexedAttributes({});
@ -158,6 +162,10 @@ void CombineTest::combineIndexedAttributesNoMeshes() {
}
void CombineTest::combineIndexedAttributesNotIndexed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const UnsignedShort indices[5]{};
Trade::MeshData a{MeshPrimitive::Lines,
{}, indices, Trade::MeshIndexData{indices}, 1};
@ -172,6 +180,10 @@ void CombineTest::combineIndexedAttributesNotIndexed() {
}
void CombineTest::combineIndexedAttributesDifferentPrimitive() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const UnsignedShort indices[5]{};
Trade::MeshData a{MeshPrimitive::Lines,
{}, indices, Trade::MeshIndexData{indices}, 1};
@ -185,6 +197,10 @@ void CombineTest::combineIndexedAttributesDifferentPrimitive() {
}
void CombineTest::combineIndexedAttributesDifferentIndexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const UnsignedShort indices[5]{};
Trade::MeshData a{MeshPrimitive::Lines,
{}, indices, Trade::MeshIndexData{indices}, 1};
@ -322,6 +338,10 @@ void CombineTest::combineFaceAttributes() {
}
void CombineTest::combineFaceAttributesMeshNotIndexed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const Trade::MeshData mesh{MeshPrimitive::Triangles, 3};
const Trade::MeshData faceAttributes{MeshPrimitive::Faces, 0};
@ -333,6 +353,10 @@ void CombineTest::combineFaceAttributesMeshNotIndexed() {
}
void CombineTest::combineFaceAttributesUnexpectedPrimitive() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const UnsignedInt indices[] { 0, 0, 0 };
const Trade::MeshData a{MeshPrimitive::Triangles,
{}, indices, Trade::MeshIndexData{indices}, 1};
@ -351,6 +375,10 @@ void CombineTest::combineFaceAttributesUnexpectedPrimitive() {
}
void CombineTest::combineFaceAttributesUnexpectedFaceCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const UnsignedInt indices[] { 0, 0, 0 };
const Trade::MeshData mesh{MeshPrimitive::Triangles,
{}, indices, Trade::MeshIndexData{indices}, 1};
@ -364,6 +392,10 @@ void CombineTest::combineFaceAttributesUnexpectedFaceCount() {
}
void CombineTest::combineFaceAttributesFacesNotInterleaved() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
using namespace Math::Literals;
const UnsignedInt indices[] { 0, 0, 0, 0, 0, 0 };
@ -392,6 +424,10 @@ void CombineTest::combineFaceAttributesFacesNotInterleaved() {
}
void CombineTest::combineFaceAttributesFaceAttributeOffsetOnly() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshTools::combineFaceAttributes(Trade::MeshData{MeshPrimitive::Triangles, 0}, {

20
src/Magnum/MeshTools/Test/CompileGLTest.cpp

@ -272,10 +272,10 @@ CompileGLTest::CompileGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
/* Set up the rendering */
@ -1109,6 +1109,10 @@ void CompileGLTest::implementationSpecificAttributeFormat() {
}
void CompileGLTest::generateNormalsNoPosition() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Trade::MeshData data{MeshPrimitive::Triangles, 1};
std::ostringstream out;
@ -1119,6 +1123,10 @@ void CompileGLTest::generateNormalsNoPosition() {
}
void CompileGLTest::generateNormals2DPosition() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Trade::MeshData data{MeshPrimitive::Triangles,
nullptr, {Trade::MeshAttributeData{Trade::MeshAttribute::Position,
VertexFormat::Vector2, nullptr}}};
@ -1131,6 +1139,10 @@ void CompileGLTest::generateNormals2DPosition() {
}
void CompileGLTest::generateNormalsNoFloats() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Trade::MeshData data{MeshPrimitive::Triangles,
nullptr, {
Trade::MeshAttributeData{Trade::MeshAttribute::Position,
@ -1229,6 +1241,10 @@ void CompileGLTest::externalBuffers() {
}
void CompileGLTest::externalBuffersInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Trade::MeshData data{MeshPrimitive::Triangles, 5};
Trade::MeshData indexedData{MeshPrimitive::Triangles,
nullptr, Trade::MeshIndexData{MeshIndexType::UnsignedInt, nullptr},

16
src/Magnum/MeshTools/Test/CompressIndicesTest.cpp

@ -205,6 +205,10 @@ template<class T> void CompressIndicesTest::compressOffsetNegative() {
}
void CompressIndicesTest::compressErasedNonContiguous() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const char indices[6*4]{};
std::stringstream out;
@ -215,6 +219,10 @@ void CompressIndicesTest::compressErasedNonContiguous() {
}
void CompressIndicesTest::compressErasedWrongIndexSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const char indices[6*3]{};
std::stringstream out;
@ -316,6 +324,10 @@ void CompressIndicesTest::compressMeshDataMove() {
}
void CompressIndicesTest::compressMeshDataNonIndexed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
/* Test both r-value and l-value overload */
std::ostringstream out;
Error redirectError{&out};
@ -329,6 +341,10 @@ void CompressIndicesTest::compressMeshDataNonIndexed() {
#ifdef MAGNUM_BUILD_DEPRECATED
void CompressIndicesTest::compressAsShort() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
CORRADE_IGNORE_DEPRECATED_PUSH
CORRADE_COMPARE_AS(MeshTools::compressIndicesAs<UnsignedShort>({123, 456}),
Containers::arrayView<UnsignedShort>({123, 456}),

16
src/Magnum/MeshTools/Test/ConcatenateTest.cpp

@ -530,6 +530,10 @@ void ConcatenateTest::concatenateIntoNonOwnedAttributeArray() {
}
void ConcatenateTest::concatenateUnsupportedPrimitive() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Trade::MeshData a{MeshPrimitive::TriangleStrip, 0};
std::ostringstream out;
@ -542,6 +546,10 @@ void ConcatenateTest::concatenateUnsupportedPrimitive() {
}
void ConcatenateTest::concatenateInconsistentPrimitive() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
/* Things are a bit duplicated to test correct numbering */
Trade::MeshData a{MeshPrimitive::Triangles, 0};
Trade::MeshData b{MeshPrimitive::Lines, 0};
@ -556,6 +564,10 @@ void ConcatenateTest::concatenateInconsistentPrimitive() {
}
void ConcatenateTest::concatenateInconsistentAttributeType() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
/* Things are a bit duplicated to test correct numbering */
Trade::MeshData a{MeshPrimitive::Lines, nullptr, {
Trade::MeshAttributeData{Trade::MeshAttribute::Position,
@ -582,6 +594,10 @@ void ConcatenateTest::concatenateInconsistentAttributeType() {
}
void ConcatenateTest::concatenateIntoNoMeshes() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Trade::MeshData destination{MeshPrimitive::Triangles, 0};
std::ostringstream out;

36
src/Magnum/MeshTools/Test/DuplicateTest.cpp

@ -109,6 +109,10 @@ void DuplicateTest::duplicate() {
}
void DuplicateTest::duplicateOutOfBounds() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
constexpr UnsignedByte indices[]{1, 1, 0, 4, 2, 2};
constexpr Int data[]{-7, 35, 12, -18};
@ -141,6 +145,10 @@ void DuplicateTest::duplicateInto() {
}
void DuplicateTest::duplicateIntoWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
constexpr UnsignedByte indices[]{1, 1, 0, 3, 2, 2};
constexpr Int data[]{-7, 35, 12, -18};
Int output[5];
@ -170,6 +178,10 @@ template<class T> void DuplicateTest::duplicateIntoErased() {
}
void DuplicateTest::duplicateIntoErasedWrongTypeSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
constexpr UnsignedByte indices[]{1, 1, 0, 3, 2, 2};
constexpr Int data[]{-7, 35, 12, -18};
Short output[6];
@ -186,6 +198,10 @@ void DuplicateTest::duplicateIntoErasedWrongTypeSize() {
}
void DuplicateTest::duplicateIntoErasedNonContiguous() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
constexpr UnsignedByte indices[]{1, 1, 0, 3, 2, 2};
constexpr Int data[]{-7, 35, 12, -18};
Short output[6];
@ -218,6 +234,10 @@ template<class T> void DuplicateTest::duplicateErasedIndicesIntoErased() {
}
void DuplicateTest::duplicateErasedIndicesIntoErasedWrongTypeSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
constexpr char indices[6*3]{};
constexpr Int data[]{-7, 35, 12, -18};
Short output[6];
@ -234,6 +254,10 @@ void DuplicateTest::duplicateErasedIndicesIntoErasedWrongTypeSize() {
}
void DuplicateTest::duplicateErasedIndicesIntoErasedNonContiguous() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
constexpr char indices[3*6]{};
constexpr Int data[]{-7, 35, 12, -18};
Short output[6];
@ -286,6 +310,10 @@ template<class T> void DuplicateTest::duplicateMeshData() {
}
void DuplicateTest::duplicateMeshDataNotIndexed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshTools::duplicate(Trade::MeshData{MeshPrimitive::Points, 0});
@ -351,6 +379,10 @@ void DuplicateTest::duplicateMeshDataExtraEmpty() {
}
void DuplicateTest::duplicateMeshDataExtraWrongCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
UnsignedByte indices[]{0, 1, 2, 2, 1, 0};
Vector2 positions[]{{1.3f, 0.3f}, {0.87f, 1.1f}, {1.0f, -0.5f}};
Trade::MeshData data{MeshPrimitive::Lines,
@ -370,6 +402,10 @@ void DuplicateTest::duplicateMeshDataExtraWrongCount() {
}
void DuplicateTest::duplicateMeshDataExtraOffsetOnly() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
UnsignedByte indices[]{0, 1, 2, 2, 1, 0};
Trade::MeshData data{MeshPrimitive::TriangleFan,
{}, indices, Trade::MeshIndexData{indices}, 3};

4
src/Magnum/MeshTools/Test/FlipNormalsTest.cpp

@ -66,6 +66,10 @@ FlipNormalsTest::FlipNormalsTest() {
}
void FlipNormalsTest::wrongIndexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream ss;
Error redirectError{&ss};

44
src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp

@ -149,6 +149,10 @@ void GenerateIndicesTest::primitiveCount() {
}
void GenerateIndicesTest::primitiveCountInvalidPrimitive() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshTools::primitiveCount(MeshPrimitive(0xdead), 2);
@ -184,6 +188,10 @@ void GenerateIndicesTest::generateLineStripIndices() {
}
void GenerateIndicesTest::generateLineStripIndicesWrongVertexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshTools::generateLineStripIndicesInto(1, nullptr);
@ -192,6 +200,10 @@ void GenerateIndicesTest::generateLineStripIndicesWrongVertexCount() {
}
void GenerateIndicesTest::generateLineStripIndicesIntoWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
UnsignedInt indices[7];
std::ostringstream out;
@ -232,6 +244,10 @@ void GenerateIndicesTest::generateLineLoopIndices() {
}
void GenerateIndicesTest::generateLineLoopIndicesWrongVertexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshTools::generateLineLoopIndicesInto(1, nullptr);
@ -240,6 +256,10 @@ void GenerateIndicesTest::generateLineLoopIndicesWrongVertexCount() {
}
void GenerateIndicesTest::generateLineLoopIndicesIntoWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
UnsignedInt indices[9];
std::ostringstream out;
@ -279,6 +299,10 @@ void GenerateIndicesTest::generateTriangleStripIndices() {
}
void GenerateIndicesTest::generateTriangleStripIndicesWrongVertexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshTools::generateTriangleStripIndicesInto(2, nullptr);
@ -287,6 +311,10 @@ void GenerateIndicesTest::generateTriangleStripIndicesWrongVertexCount() {
}
void GenerateIndicesTest::generateTriangleStripIndicesIntoWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
UnsignedInt indices[8];
std::ostringstream out;
@ -326,6 +354,10 @@ void GenerateIndicesTest::generateTriangleFanIndices() {
}
void GenerateIndicesTest::generateTriangleFanIndicesWrongVertexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshTools::generateTriangleFanIndicesInto(2, nullptr);
@ -334,6 +366,10 @@ void GenerateIndicesTest::generateTriangleFanIndicesWrongVertexCount() {
}
void GenerateIndicesTest::generateTriangleFanIndicesIntoWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
UnsignedInt indices[8];
std::ostringstream out;
@ -441,6 +477,10 @@ void GenerateIndicesTest::generateIndicesMeshDataMove() {
}
void GenerateIndicesTest::generateIndicesMeshDataIndexed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
UnsignedByte indices[]{0};
Trade::MeshData mesh{MeshPrimitive::TriangleFan,
{}, indices, Trade::MeshIndexData{indices}, 0};
@ -457,6 +497,10 @@ void GenerateIndicesTest::generateIndicesMeshDataIndexed() {
}
void GenerateIndicesTest::generateIndicesMeshDataInvalidPrimitive() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Trade::MeshData mesh{MeshPrimitive::Triangles, 2};
std::ostringstream out;

28
src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp

@ -151,6 +151,10 @@ void GenerateNormalsTest::flatDeprecated() {
#endif
void GenerateNormalsTest::flatWrongCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
Error redirectError{&out};
@ -160,6 +164,10 @@ void GenerateNormalsTest::flatWrongCount() {
}
void GenerateNormalsTest::flatIntoWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
Error redirectError{&out};
@ -384,6 +392,10 @@ void GenerateNormalsTest::smoothNanPosition() {
}
void GenerateNormalsTest::smoothWrongCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
Error redirectError{&out};
@ -394,6 +406,10 @@ void GenerateNormalsTest::smoothWrongCount() {
}
void GenerateNormalsTest::smoothOutOfBounds() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
Error redirectError{&out};
@ -404,6 +420,10 @@ void GenerateNormalsTest::smoothOutOfBounds() {
}
void GenerateNormalsTest::smoothIntoWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
Error redirectError{&out};
@ -454,6 +474,10 @@ template<class T> void GenerateNormalsTest::smoothErased() {
}
void GenerateNormalsTest::smoothErasedNonContiguous() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const char indices[6*4]{};
const Vector3 positions[3];
@ -465,6 +489,10 @@ void GenerateNormalsTest::smoothErasedNonContiguous() {
}
void GenerateNormalsTest::smoothErasedWrongIndexSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const char indices[6*3]{};
const Vector3 positions[3];

37
src/Magnum/MeshTools/Test/InterleaveTest.cpp

@ -42,6 +42,8 @@ struct InterleaveTest: Corrade::TestSuite::Tester {
void attributeCount();
void attributeCountGaps();
void attributeCountInvalid();
void stride();
void strideGaps();
void interleave();
@ -91,6 +93,7 @@ struct InterleaveTest: Corrade::TestSuite::Tester {
InterleaveTest::InterleaveTest() {
addTests({&InterleaveTest::attributeCount,
&InterleaveTest::attributeCountGaps,
&InterleaveTest::attributeCountInvalid,
&InterleaveTest::stride,
&InterleaveTest::strideGaps,
&InterleaveTest::interleave,
@ -138,12 +141,6 @@ InterleaveTest::InterleaveTest() {
}
void InterleaveTest::attributeCount() {
std::stringstream ss;
Error redirectError{&ss};
CORRADE_COMPARE((Implementation::AttributeCount{}(std::vector<Byte>{0, 1, 2},
std::vector<Byte>{0, 1, 2, 3, 4, 5})), std::size_t(0));
CORRADE_COMPARE(ss.str(), "MeshTools::interleave(): attribute arrays don't have the same length, expected 3 but got 6\n");
CORRADE_COMPARE((Implementation::AttributeCount{}(std::vector<Byte>{0, 1, 2},
std::vector<Byte>{3, 4, 5})), std::size_t(3));
}
@ -156,6 +153,18 @@ void InterleaveTest::attributeCountGaps() {
CORRADE_COMPARE(Implementation::AttributeCount{}(3, 5), ~std::size_t(0));
}
void InterleaveTest::attributeCountInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream ss;
Error redirectError{&ss};
CORRADE_COMPARE((Implementation::AttributeCount{}(std::vector<Byte>{0, 1, 2},
std::vector<Byte>{0, 1, 2, 3, 4, 5})), std::size_t(0));
CORRADE_COMPARE(ss.str(), "MeshTools::interleave(): attribute arrays don't have the same length, expected 3 but got 6\n");
}
void InterleaveTest::stride() {
CORRADE_COMPARE(Implementation::Stride{}(std::vector<Byte>()), std::size_t(1));
CORRADE_COMPARE(Implementation::Stride{}(std::vector<Int>()), std::size_t(4));
@ -426,6 +435,10 @@ void InterleaveTest::interleavedDataNoVertices() {
}
void InterleaveTest::interleavedDataNotInterleaved() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{100 + 3*20};
Trade::MeshAttributeData positions{Trade::MeshAttribute::Position,
Containers::arrayCast<Vector2>(vertexData.suffix(100).prefix(3*8))};
@ -580,6 +593,10 @@ void InterleaveTest::interleavedLayoutExtraAliased() {
}
void InterleaveTest::interleavedLayoutExtraTooNegativePadding() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*12};
Trade::MeshAttributeData positions{Trade::MeshAttribute::Position,
Containers::StridedArrayView1D<Vector2>{vertexData, reinterpret_cast<Vector2*>(vertexData.data()), 3, 12}};
@ -909,6 +926,10 @@ void InterleaveTest::interleaveMeshDataExtraOriginalEmpty() {
}
void InterleaveTest::interleaveMeshDataExtraWrongCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Vector2 positions[]{{1.3f, 0.3f}, {0.87f, 1.1f}, {1.0f, -0.5f}};
Trade::MeshData data{MeshPrimitive::TriangleFan,
{}, Containers::arrayView(positions), {
@ -926,6 +947,10 @@ void InterleaveTest::interleaveMeshDataExtraWrongCount() {
}
void InterleaveTest::interleaveMeshDataExtraOffsetOnly() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Trade::MeshData data{MeshPrimitive::TriangleFan, 5};
std::ostringstream out;

16
src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp

@ -99,6 +99,10 @@ void RemoveDuplicatesTest::removeDuplicates() {
}
void RemoveDuplicatesTest::removeDuplicatesNonContiguous() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Int data[8]{};
std::ostringstream out;
@ -111,6 +115,10 @@ void RemoveDuplicatesTest::removeDuplicatesNonContiguous() {
}
void RemoveDuplicatesTest::removeDuplicatesIntoWrongOutputSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Int data[8]{};
UnsignedInt output[7];
@ -144,6 +152,10 @@ template<class T> void RemoveDuplicatesTest::removeDuplicatesIndexedInPlace() {
}
void RemoveDuplicatesTest::removeDuplicatesIndexedInPlaceSmallType() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
Error redirectError{&out};
@ -237,6 +249,10 @@ template<class T> void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlace
}
void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlaceSmallType() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
Error redirectError{&out};

12
src/Magnum/MeshTools/Test/SubdivideTest.cpp

@ -96,6 +96,10 @@ void SubdivideTest::subdivideStl() {
#endif
void SubdivideTest::subdivideWrongIndexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
Error redirectError{&out};
@ -122,6 +126,10 @@ template<class T> void SubdivideTest::subdivideInPlace() {
}
void SubdivideTest::subdivideInPlaceWrongIndexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
Error redirectError{&out};
@ -133,6 +141,10 @@ void SubdivideTest::subdivideInPlaceWrongIndexCount() {
}
void SubdivideTest::subdivideInPlaceSmallIndexType() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::stringstream out;
Error redirectError{&out};

2
src/Magnum/PixelFormat.cpp

@ -108,7 +108,7 @@ UnsignedInt pixelSize(const PixelFormat format) {
#pragma GCC diagnostic pop
#endif
CORRADE_ASSERT(false, "pixelSize(): invalid format" << format, {});
CORRADE_ASSERT_UNREACHABLE("pixelSize(): invalid format" << format, {});
}
namespace {

2
src/Magnum/Platform/GlfwApplication.cpp

@ -289,7 +289,7 @@ void GlfwApplication::setWindowIcon(std::initializer_list<ImageView2D> images) {
else if(image.format() == PixelFormat::RGBA8Snorm ||
image.format() == PixelFormat::RGBA8Unorm)
packPixels(image.pixels<Color4ub>(), out);
else CORRADE_ASSERT(false, "Platform::GlfwApplication::setWindowIcon(): unexpected format" << image.format(), );
else CORRADE_ASSERT_UNREACHABLE("Platform::GlfwApplication::setWindowIcon(): unexpected format" << image.format(), );
/* Specify the image metadata */
glfwImages[i].width = image.size().x();

4
src/Magnum/Platform/Sdl2Application.cpp

@ -343,7 +343,7 @@ void Sdl2Application::setWindowIcon(const ImageView2D& image) {
format = SDL_PIXELFORMAT_RGBA32;
break;
default:
CORRADE_ASSERT(false, "Platform::Sdl2Application::setWindowIcon(): unexpected format" << image.format(), );
CORRADE_ASSERT_UNREACHABLE("Platform::Sdl2Application::setWindowIcon(): unexpected format" << image.format(), );
}
/* Images are loaded with origin at bottom left, flip it to top left.
@ -1089,7 +1089,7 @@ void Sdl2Application::setMouseLocked(bool enabled) {
SDL_SetWindowGrab(_window, enabled ? SDL_TRUE : SDL_FALSE);
SDL_SetRelativeMouseMode(enabled ? SDL_TRUE : SDL_FALSE);
#else
CORRADE_ASSERT(false, "Sdl2Application::setMouseLocked(): not implemented", );
CORRADE_ASSERT_UNREACHABLE("Sdl2Application::setMouseLocked(): not implemented", );
static_cast<void>(enabled);
#endif
}

1
src/Magnum/Primitives/Implementation/Spheroid.h

@ -26,6 +26,7 @@
*/
#include <Corrade/Containers/Array.h>
#include <Corrade/Containers/EnumSet.h>
#include <Corrade/Containers/StridedArrayView.h>
#include "Magnum/Magnum.h"

2
src/Magnum/SceneGraph/Object.hpp

@ -220,7 +220,7 @@ template<class Transformation> std::vector<typename Transformation::DataType> Ob
}
std::vector<std::reference_wrapper<Object<Transformation>>> jointObjects(objects);
#if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT)
#ifndef CORRADE_NO_ASSERT
/* Scene object */
const Scene<Transformation>* scene = this->scene();
#endif

44
src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp

@ -44,8 +44,10 @@ struct DualComplexTransformationTest: TestSuite::Tester {
void inverted();
void setTransformation();
void setTransformationInvalid();
void resetTransformation();
void transform();
void transformInvalid();
void translate();
void rotate();
void normalizeRotation();
@ -58,8 +60,10 @@ DualComplexTransformationTest::DualComplexTransformationTest() {
&DualComplexTransformationTest::inverted,
&DualComplexTransformationTest::setTransformation,
&DualComplexTransformationTest::setTransformationInvalid,
&DualComplexTransformationTest::resetTransformation,
&DualComplexTransformationTest::transform,
&DualComplexTransformationTest::transformInvalid,
&DualComplexTransformationTest::translate,
&DualComplexTransformationTest::rotate,
&DualComplexTransformationTest::normalizeRotation});
@ -93,12 +97,6 @@ void DualComplexTransformationTest::inverted() {
void DualComplexTransformationTest::setTransformation() {
Object2D o;
/* Can't transform with non-rigid transformation */
std::ostringstream out;
Error redirectError{&out};
o.setTransformation(DualComplex({1.0f, 2.0f}, {}));
CORRADE_COMPARE(out.str(), "SceneGraph::DualComplexTransformation::setTransformation(): the dual complex number is not normalized\n");
/* Dirty after setting transformation */
o.setClean();
CORRADE_VERIFY(!o.isDirty());
@ -114,6 +112,20 @@ void DualComplexTransformationTest::setTransformation() {
CORRADE_COMPARE(s.transformationMatrix(), Matrix3());
}
void DualComplexTransformationTest::setTransformationInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Object2D o;
/* Can't transform with non-rigid transformation */
std::ostringstream out;
Error redirectError{&out};
o.setTransformation(DualComplex({1.0f, 2.0f}, {}));
CORRADE_COMPARE(out.str(), "SceneGraph::DualComplexTransformation::setTransformation(): the dual complex number is not normalized\n");
}
void DualComplexTransformationTest::resetTransformation() {
Object2D o;
o.setTransformation(DualComplex::rotation(Deg(17.0f)));
@ -124,13 +136,6 @@ void DualComplexTransformationTest::resetTransformation() {
void DualComplexTransformationTest::transform() {
{
/* Can't transform with non-rigid transformation */
Object2D o;
std::ostringstream out;
Error redirectError{&out};
o.transform(DualComplex({1.0f, 2.0f}, {}));
CORRADE_COMPARE(out.str(), "SceneGraph::DualComplexTransformation::transform(): the dual complex number is not normalized\n");
} {
Object2D o;
o.setTransformation(DualComplex::rotation(Deg(17.0f)));
o.transform(DualComplex::translation({1.0f, -0.3f}));
@ -143,6 +148,19 @@ void DualComplexTransformationTest::transform() {
}
}
void DualComplexTransformationTest::transformInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
/* Can't transform with non-rigid transformation */
Object2D o;
std::ostringstream out;
Error redirectError{&out};
o.transform(DualComplex({1.0f, 2.0f}, {}));
CORRADE_COMPARE(out.str(), "SceneGraph::DualComplexTransformation::transform(): the dual complex number is not normalized\n");
}
void DualComplexTransformationTest::translate() {
{
Object2D o;

62
src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp

@ -39,13 +39,16 @@ struct DualQuaternionTransformationTest: TestSuite::Tester {
explicit DualQuaternionTransformationTest();
void fromMatrix();
void fromMatrixInvalid();
void toMatrix();
void compose();
void inverted();
void setTransformation();
void setTransformationInvalid();
void resetTransformation();
void transform();
void transformInvalid();
void translate();
void rotate();
void normalizeRotation();
@ -53,13 +56,16 @@ struct DualQuaternionTransformationTest: TestSuite::Tester {
DualQuaternionTransformationTest::DualQuaternionTransformationTest() {
addTests({&DualQuaternionTransformationTest::fromMatrix,
&DualQuaternionTransformationTest::fromMatrixInvalid,
&DualQuaternionTransformationTest::toMatrix,
&DualQuaternionTransformationTest::compose,
&DualQuaternionTransformationTest::inverted,
&DualQuaternionTransformationTest::setTransformation,
&DualQuaternionTransformationTest::setTransformationInvalid,
&DualQuaternionTransformationTest::resetTransformation,
&DualQuaternionTransformationTest::transform,
&DualQuaternionTransformationTest::transformInvalid,
&DualQuaternionTransformationTest::translate,
&DualQuaternionTransformationTest::rotate,
&DualQuaternionTransformationTest::normalizeRotation});
@ -68,16 +74,22 @@ DualQuaternionTransformationTest::DualQuaternionTransformationTest() {
using namespace Math::Literals;
void DualQuaternionTransformationTest::fromMatrix() {
std::ostringstream o;
Error redirectError{&o};
Implementation::Transformation<DualQuaternionTransformation>::fromMatrix(Matrix4::scaling(Vector3(4.0f)));
CORRADE_COMPARE(o.str(), "SceneGraph::DualQuaternionTransformation: the matrix doesn't represent rigid transformation\n");
Matrix4 m = Matrix4::rotationX(Deg(17.0f))*Matrix4::translation({1.0f, -0.3f, 2.3f});
DualQuaternion q = DualQuaternion::rotation(Deg(17.0f), Vector3::xAxis())*DualQuaternion::translation({1.0f, -0.3f, 2.3f});
CORRADE_COMPARE(Implementation::Transformation<DualQuaternionTransformation>::fromMatrix(m), q);
}
void DualQuaternionTransformationTest::fromMatrixInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
Implementation::Transformation<DualQuaternionTransformation>::fromMatrix(Matrix4::scaling(Vector3(4.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::DualQuaternionTransformation: the matrix doesn't represent rigid transformation\n");
}
void DualQuaternionTransformationTest::toMatrix() {
DualQuaternion q = DualQuaternion::rotation(Deg(17.0f), Vector3::xAxis())*DualQuaternion::translation({1.0f, -0.3f, 2.3f});
Matrix4 m = Matrix4::rotationX(Deg(17.0f))*Matrix4::translation({1.0f, -0.3f, 2.3f});
@ -98,12 +110,6 @@ void DualQuaternionTransformationTest::inverted() {
void DualQuaternionTransformationTest::setTransformation() {
Object3D o;
/* Can't transform with non-rigid transformation */
std::ostringstream out;
Error redirectError{&out};
o.setTransformation(DualQuaternion({{1.0f, 2.0f, 3.0f}, 4.0f}, {}));
CORRADE_COMPARE(out.str(), "SceneGraph::DualQuaternionTransformation::setTransformation(): the dual quaternion is not normalized\n");
/* Dirty after setting transformation */
o.setClean();
CORRADE_VERIFY(!o.isDirty());
@ -120,6 +126,20 @@ void DualQuaternionTransformationTest::setTransformation() {
CORRADE_COMPARE(s.transformationMatrix(), Matrix4());
}
void DualQuaternionTransformationTest::setTransformationInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Object3D o;
/* Can't transform with non-rigid transformation */
std::ostringstream out;
Error redirectError{&out};
o.setTransformation(DualQuaternion({{1.0f, 2.0f, 3.0f}, 4.0f}, {}));
CORRADE_COMPARE(out.str(), "SceneGraph::DualQuaternionTransformation::setTransformation(): the dual quaternion is not normalized\n");
}
void DualQuaternionTransformationTest::resetTransformation() {
Object3D o;
o.setTransformation(DualQuaternion::rotation(Deg(17.0f), Vector3::xAxis()));
@ -130,13 +150,6 @@ void DualQuaternionTransformationTest::resetTransformation() {
void DualQuaternionTransformationTest::transform() {
{
/* Can't transform with non-rigid transformation */
Object3D o;
std::ostringstream out;
Error redirectError{&out};
o.transform(DualQuaternion({{1.0f, 2.0f, 3.0f}, 4.0f}, {}));
CORRADE_COMPARE(out.str(), "SceneGraph::DualQuaternionTransformation::transform(): the dual quaternion is not normalized\n");
} {
Object3D o;
o.setTransformation(DualQuaternion::rotation(Deg(17.0f), Vector3::xAxis()));
o.transform(DualQuaternion::translation({1.0f, -0.3f, 2.3f}));
@ -149,6 +162,19 @@ void DualQuaternionTransformationTest::transform() {
}
}
void DualQuaternionTransformationTest::transformInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
/* Can't transform with non-rigid transformation */
Object3D o;
std::ostringstream out;
Error redirectError{&out};
o.transform(DualQuaternion({{1.0f, 2.0f, 3.0f}, 4.0f}, {}));
CORRADE_COMPARE(out.str(), "SceneGraph::DualQuaternionTransformation::transform(): the dual quaternion is not normalized\n");
}
void DualQuaternionTransformationTest::translate() {
{
Object3D o;

32
src/Magnum/SceneGraph/Test/ObjectTest.cpp

@ -42,6 +42,7 @@ struct ObjectTest: TestSuite::Tester {
void addChild();
void scene();
void setParentKeepTransformation();
void setParentKeepTransformationInvalid();
void absoluteTransformation();
void transformations();
void transformationsRelative();
@ -79,6 +80,7 @@ ObjectTest::ObjectTest() {
&ObjectTest::addChild,
&ObjectTest::scene,
&ObjectTest::setParentKeepTransformation,
&ObjectTest::setParentKeepTransformationInvalid,
&ObjectTest::absoluteTransformation,
&ObjectTest::transformations,
&ObjectTest::transformationsRelative,
@ -176,14 +178,6 @@ void ObjectTest::setParentKeepTransformation() {
childOne->translate(Vector3::xAxis(2.0f));
childTwo->rotateY(Deg(90.0f));
/* Old parent and new parent must share the same scene */
std::ostringstream o;
Error redirectError{&o};
Scene3D scene;
childOne->setParentKeepTransformation(&scene);
CORRADE_COMPARE(o.str(), "SceneGraph::Object::setParentKeepTransformation(): both parents must be in the same scene\n");
CORRADE_COMPARE(childOne->parent(), &root);
/* Reparent to another and keep absolute transformation */
auto transformation = childOne->absoluteTransformation();
childOne->setParentKeepTransformation(childTwo);
@ -191,6 +185,24 @@ void ObjectTest::setParentKeepTransformation() {
CORRADE_COMPARE(childOne->absoluteTransformation(), transformation);
}
void ObjectTest::setParentKeepTransformationInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Object3D root;
root.rotateZ(Deg(35.0f));
Object3D* child = new Object3D(&root);
/* Old parent and new parent must share the same scene */
std::ostringstream o;
Error redirectError{&o};
Scene3D scene;
child->setParentKeepTransformation(&scene);
CORRADE_COMPARE(o.str(), "SceneGraph::Object::setParentKeepTransformation(): both parents must be in the same scene\n");
}
void ObjectTest::absoluteTransformation() {
Scene3D s;
@ -283,6 +295,10 @@ void ObjectTest::transformationsRelative() {
}
void ObjectTest::transformationsOrphan() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream o;
Error redirectError{&o};

62
src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp

@ -40,13 +40,16 @@ struct RigidMatrixTransformation2DTest: TestSuite::Tester {
explicit RigidMatrixTransformation2DTest();
void fromMatrix();
void fromMatrixInvalid();
void toMatrix();
void compose();
void inverted();
void setTransformation();
void setTransformationInvalid();
void resetTransformation();
void transform();
void transformInvalid();
void translate();
void rotate();
void reflect();
@ -55,13 +58,16 @@ struct RigidMatrixTransformation2DTest: TestSuite::Tester {
RigidMatrixTransformation2DTest::RigidMatrixTransformation2DTest() {
addTests({&RigidMatrixTransformation2DTest::fromMatrix,
&RigidMatrixTransformation2DTest::fromMatrixInvalid,
&RigidMatrixTransformation2DTest::toMatrix,
&RigidMatrixTransformation2DTest::compose,
&RigidMatrixTransformation2DTest::inverted,
&RigidMatrixTransformation2DTest::setTransformation,
&RigidMatrixTransformation2DTest::setTransformationInvalid,
&RigidMatrixTransformation2DTest::resetTransformation,
&RigidMatrixTransformation2DTest::transform,
&RigidMatrixTransformation2DTest::transformInvalid,
&RigidMatrixTransformation2DTest::translate,
&RigidMatrixTransformation2DTest::rotate,
&RigidMatrixTransformation2DTest::reflect,
@ -71,15 +77,21 @@ RigidMatrixTransformation2DTest::RigidMatrixTransformation2DTest() {
using namespace Math::Literals;
void RigidMatrixTransformation2DTest::fromMatrix() {
std::ostringstream o;
Error redirectError{&o};
Implementation::Transformation<RigidMatrixTransformation2D>::fromMatrix(Matrix3::scaling(Vector2(4.0f)));
CORRADE_COMPARE(o.str(), "SceneGraph::RigidMatrixTransformation2D: the matrix doesn't represent rigid transformation\n");
Matrix3 m = Matrix3::rotation(Deg(17.0f))*Matrix3::translation({1.0f, -0.3f});
CORRADE_COMPARE(Implementation::Transformation<RigidMatrixTransformation2D>::fromMatrix(m), m);
}
void RigidMatrixTransformation2DTest::fromMatrixInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
Implementation::Transformation<RigidMatrixTransformation2D>::fromMatrix(Matrix3::scaling(Vector2(4.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation2D: the matrix doesn't represent rigid transformation\n");
}
void RigidMatrixTransformation2DTest::toMatrix() {
Matrix3 m = Matrix3::rotation(Deg(17.0f))*Matrix3::translation({1.0f, -0.3f});
CORRADE_COMPARE(Implementation::Transformation<RigidMatrixTransformation2D>::toMatrix(m), m);
@ -99,12 +111,6 @@ void RigidMatrixTransformation2DTest::inverted() {
void RigidMatrixTransformation2DTest::setTransformation() {
Object2D o;
/* Can't transform with non-rigid transformation */
std::ostringstream out;
Error redirectError{&out};
o.setTransformation(Matrix3::scaling(Vector2(3.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation2D::setTransformation(): the matrix doesn't represent rigid transformation\n");
/* Dirty after setting transformation */
o.setClean();
CORRADE_VERIFY(!o.isDirty());
@ -120,6 +126,20 @@ void RigidMatrixTransformation2DTest::setTransformation() {
CORRADE_COMPARE(s.transformationMatrix(), Matrix3());
}
void RigidMatrixTransformation2DTest::setTransformationInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Object2D o;
/* Can't transform with non-rigid transformation */
std::ostringstream out;
Error redirectError{&out};
o.setTransformation(Matrix3::scaling(Vector2(3.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation2D::setTransformation(): the matrix doesn't represent rigid transformation\n");
}
void RigidMatrixTransformation2DTest::resetTransformation() {
Object2D o;
o.setTransformation(Matrix3::rotation(Deg(17.0f)));
@ -130,13 +150,6 @@ void RigidMatrixTransformation2DTest::resetTransformation() {
void RigidMatrixTransformation2DTest::transform() {
{
/* Can't transform with non-rigid transformation */
Object2D o;
std::ostringstream out;
Error redirectError{&out};
o.transform(Matrix3::scaling(Vector2(3.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation2D::transform(): the matrix doesn't represent rigid transformation\n");
} {
Object2D o;
o.setTransformation(Matrix3::rotation(Deg(17.0f)));
o.transform(Matrix3::translation({1.0f, -0.3f}));
@ -149,6 +162,19 @@ void RigidMatrixTransformation2DTest::transform() {
}
}
void RigidMatrixTransformation2DTest::transformInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
/* Can't transform with non-rigid transformation */
Object2D o;
std::ostringstream out;
Error redirectError{&out};
o.transform(Matrix3::scaling(Vector2(3.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation2D::transform(): the matrix doesn't represent rigid transformation\n");
}
void RigidMatrixTransformation2DTest::translate() {
{
Object2D o;

58
src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp

@ -40,13 +40,16 @@ struct RigidMatrixTransformation3DTest: TestSuite::Tester {
explicit RigidMatrixTransformation3DTest();
void fromMatrix();
void fromMatrixInvalid();
void toMatrix();
void compose();
void inverted();
void setTransformation();
void setTransformationInvalid();
void resetTransformation();
void transform();
void transformInvalid();
void translate();
void rotate();
void reflect();
@ -55,13 +58,16 @@ struct RigidMatrixTransformation3DTest: TestSuite::Tester {
RigidMatrixTransformation3DTest::RigidMatrixTransformation3DTest() {
addTests({&RigidMatrixTransformation3DTest::fromMatrix,
&RigidMatrixTransformation3DTest::fromMatrixInvalid,
&RigidMatrixTransformation3DTest::toMatrix,
&RigidMatrixTransformation3DTest::compose,
&RigidMatrixTransformation3DTest::inverted,
&RigidMatrixTransformation3DTest::setTransformation,
&RigidMatrixTransformation3DTest::setTransformationInvalid,
&RigidMatrixTransformation3DTest::resetTransformation,
&RigidMatrixTransformation3DTest::transform,
&RigidMatrixTransformation3DTest::transformInvalid,
&RigidMatrixTransformation3DTest::translate,
&RigidMatrixTransformation3DTest::rotate,
&RigidMatrixTransformation3DTest::reflect,
@ -71,13 +77,19 @@ RigidMatrixTransformation3DTest::RigidMatrixTransformation3DTest() {
using namespace Math::Literals;
void RigidMatrixTransformation3DTest::fromMatrix() {
Matrix4 m = Matrix4::rotationX(Deg(17.0f))*Matrix4::translation({1.0f, -0.3f, 2.3f});
CORRADE_COMPARE(Implementation::Transformation<RigidMatrixTransformation3D>::fromMatrix(m), m);
}
void RigidMatrixTransformation3DTest::fromMatrixInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream o;
Error redirectError{&o};
Implementation::Transformation<RigidMatrixTransformation3D>::fromMatrix(Matrix4::scaling(Vector3(4.0f)));
CORRADE_COMPARE(o.str(), "SceneGraph::RigidMatrixTransformation3D: the matrix doesn't represent rigid transformation\n");
Matrix4 m = Matrix4::rotationX(Deg(17.0f))*Matrix4::translation({1.0f, -0.3f, 2.3f});
CORRADE_COMPARE(Implementation::Transformation<RigidMatrixTransformation3D>::fromMatrix(m), m);
}
void RigidMatrixTransformation3DTest::toMatrix() {
@ -99,12 +111,6 @@ void RigidMatrixTransformation3DTest::inverted() {
void RigidMatrixTransformation3DTest::setTransformation() {
Object3D o;
/* Can't transform with non-rigid transformation */
std::ostringstream out;
Error redirectError{&out};
o.setTransformation(Matrix4::scaling(Vector3(3.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation3D::setTransformation(): the matrix doesn't represent rigid transformation\n");
/* Dirty after setting transformation */
o.setClean();
CORRADE_VERIFY(!o.isDirty());
@ -121,6 +127,20 @@ void RigidMatrixTransformation3DTest::setTransformation() {
CORRADE_COMPARE(s.transformationMatrix(), Matrix4());
}
void RigidMatrixTransformation3DTest::setTransformationInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Object3D o;
/* Can't transform with non-rigid transformation */
std::ostringstream out;
Error redirectError{&out};
o.setTransformation(Matrix4::scaling(Vector3(3.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation3D::setTransformation(): the matrix doesn't represent rigid transformation\n");
}
void RigidMatrixTransformation3DTest::resetTransformation() {
Object3D o;
o.setTransformation(Matrix4::rotationX(Deg(17.0f)));
@ -131,13 +151,6 @@ void RigidMatrixTransformation3DTest::resetTransformation() {
void RigidMatrixTransformation3DTest::transform() {
{
/* Can't transform with non-rigid transformation */
Object3D o;
std::ostringstream out;
Error redirectError{&out};
o.transform(Matrix4::scaling(Vector3(3.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation3D::transform(): the matrix doesn't represent rigid transformation\n");
} {
Object3D o;
o.setTransformation(Matrix4::rotationX(Deg(17.0f)));
o.transform(Matrix4::translation({1.0f, -0.3f, 2.3f}));
@ -150,6 +163,19 @@ void RigidMatrixTransformation3DTest::transform() {
}
}
void RigidMatrixTransformation3DTest::transformInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
/* Can't transform with non-rigid transformation */
Object3D o;
std::ostringstream out;
Error redirectError{&out};
o.transform(Matrix4::scaling(Vector3(3.0f)));
CORRADE_COMPARE(out.str(), "SceneGraph::RigidMatrixTransformation3D::transform(): the matrix doesn't represent rigid transformation\n");
}
void RigidMatrixTransformation3DTest::translate() {
{
Object3D o;

14
src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp

@ -40,6 +40,7 @@ struct TranslationTransformationTest: TestSuite::Tester {
explicit TranslationTransformationTest();
void fromMatrix();
void fromMatrixInvalid();
void toMatrix();
void compose();
void inverted();
@ -54,6 +55,7 @@ struct TranslationTransformationTest: TestSuite::Tester {
TranslationTransformationTest::TranslationTransformationTest() {
addTests({&TranslationTransformationTest::fromMatrix,
&TranslationTransformationTest::fromMatrixInvalid,
&TranslationTransformationTest::toMatrix,
&TranslationTransformationTest::compose,
&TranslationTransformationTest::inverted,
@ -67,13 +69,19 @@ TranslationTransformationTest::TranslationTransformationTest() {
}
void TranslationTransformationTest::fromMatrix() {
const Vector2 v(1.0f, -0.3f);
CORRADE_COMPARE(Implementation::Transformation<TranslationTransformation2D>::fromMatrix(Matrix3::translation(v)), v);
}
void TranslationTransformationTest::fromMatrixInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream o;
Error redirectError{&o};
Implementation::Transformation<TranslationTransformation2D>::fromMatrix(Matrix3::scaling(Vector2(4.0f)));
CORRADE_COMPARE(o.str(), "SceneGraph::TranslationTransformation: the matrix doesn't represent pure translation\n");
const Vector2 v(1.0f, -0.3f);
CORRADE_COMPARE(Implementation::Transformation<TranslationTransformation2D>::fromMatrix(Matrix3::translation(v)), v);
}
void TranslationTransformationTest::toMatrix() {

8
src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp

@ -153,10 +153,10 @@ DistanceFieldVectorGLTest::DistanceFieldVectorGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef CORRADE_TARGET_APPLE
@ -217,6 +217,10 @@ template<UnsignedInt dimensions> void DistanceFieldVectorGLTest::constructMove()
template<UnsignedInt dimensions> void DistanceFieldVectorGLTest::setTextureMatrixNotEnabled() {
setTestCaseTemplateName(std::to_string(dimensions));
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

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

@ -276,10 +276,10 @@ FlatGLTest::FlatGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef CORRADE_TARGET_APPLE
@ -340,6 +340,10 @@ template<UnsignedInt dimensions> void FlatGLTest::constructMove() {
template<UnsignedInt dimensions> void FlatGLTest::constructTextureTransformationNotTextured() {
setTestCaseTemplateName(std::to_string(dimensions));
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
Flat<dimensions>{Flat<dimensions>::Flag::TextureTransformation};
@ -350,6 +354,10 @@ template<UnsignedInt dimensions> void FlatGLTest::constructTextureTransformation
template<UnsignedInt dimensions> void FlatGLTest::bindTextureNotEnabled() {
setTestCaseTemplateName(std::to_string(dimensions));
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -363,6 +371,10 @@ template<UnsignedInt dimensions> void FlatGLTest::bindTextureNotEnabled() {
template<UnsignedInt dimensions> void FlatGLTest::setAlphaMaskNotEnabled() {
setTestCaseTemplateName(std::to_string(dimensions));
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -376,6 +388,10 @@ template<UnsignedInt dimensions> void FlatGLTest::setAlphaMaskNotEnabled() {
template<UnsignedInt dimensions> void FlatGLTest::setTextureMatrixNotEnabled() {
setTestCaseTemplateName(std::to_string(dimensions));
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -390,6 +406,10 @@ template<UnsignedInt dimensions> void FlatGLTest::setTextureMatrixNotEnabled() {
template<UnsignedInt dimensions> void FlatGLTest::setObjectIdNotEnabled() {
setTestCaseTemplateName(std::to_string(dimensions));
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

40
src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp

@ -480,10 +480,10 @@ MeshVisualizerGLTest::MeshVisualizerGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef CORRADE_TARGET_APPLE
@ -628,6 +628,10 @@ void MeshVisualizerGLTest::construct2DInvalid() {
auto&& data = ConstructInvalidData2D[testCaseInstanceId()];
setTestCaseDescription(data.name);
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshVisualizer2D{data.flags};
@ -638,6 +642,10 @@ void MeshVisualizerGLTest::construct3DInvalid() {
auto&& data = ConstructInvalidData3D[testCaseInstanceId()];
setTestCaseDescription(data.name);
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshVisualizer3D{data.flags};
@ -646,6 +654,10 @@ void MeshVisualizerGLTest::construct3DInvalid() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void MeshVisualizerGLTest::construct3DGeometryShaderDisabledButNeeded() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::geometry_shader4>())
CORRADE_SKIP(GL::Extensions::ARB::geometry_shader4::string() + std::string(" is not supported"));
@ -662,6 +674,10 @@ void MeshVisualizerGLTest::construct3DGeometryShaderDisabledButNeeded() {
}
void MeshVisualizerGLTest::construct3DConflictingBitangentInput() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::geometry_shader4>())
CORRADE_SKIP(GL::Extensions::ARB::geometry_shader4::string() + std::string(" is not supported"));
@ -717,6 +733,10 @@ void MeshVisualizerGLTest::constructMove3D() {
}
void MeshVisualizerGLTest::setWireframeNotEnabled2D() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -747,6 +767,10 @@ void MeshVisualizerGLTest::setWireframeNotEnabled2D() {
}
void MeshVisualizerGLTest::setWireframeNotEnabled3D() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -779,6 +803,10 @@ void MeshVisualizerGLTest::setWireframeNotEnabled3D() {
#ifndef MAGNUM_TARGET_GLES2
void MeshVisualizerGLTest::setColorMapNotEnabled2D() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -793,6 +821,10 @@ void MeshVisualizerGLTest::setColorMapNotEnabled2D() {
}
void MeshVisualizerGLTest::setColorMapNotEnabled3D() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -809,6 +841,10 @@ void MeshVisualizerGLTest::setColorMapNotEnabled3D() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void MeshVisualizerGLTest::setTangentBitangentNormalNotEnabled3D() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::geometry_shader4>())
CORRADE_SKIP(GL::Extensions::ARB::geometry_shader4::string() + std::string(" is not supported"));

32
src/Magnum/Shaders/Test/PhongGLTest.cpp

@ -396,10 +396,10 @@ PhongGLTest::PhongGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef CORRADE_TARGET_APPLE
@ -457,6 +457,10 @@ void PhongGLTest::constructMove() {
}
void PhongGLTest::constructTextureTransformationNotTextured() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
Phong{Phong::Flag::TextureTransformation};
@ -465,6 +469,10 @@ void PhongGLTest::constructTextureTransformationNotTextured() {
}
void PhongGLTest::bindTexturesNotEnabled() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -485,6 +493,10 @@ void PhongGLTest::bindTexturesNotEnabled() {
}
void PhongGLTest::setAlphaMaskNotEnabled() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -496,6 +508,10 @@ void PhongGLTest::setAlphaMaskNotEnabled() {
}
void PhongGLTest::setTextureMatrixNotEnabled() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -508,6 +524,10 @@ void PhongGLTest::setTextureMatrixNotEnabled() {
#ifndef MAGNUM_TARGET_GLES2
void PhongGLTest::setObjectIdNotEnabled() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -520,6 +540,10 @@ void PhongGLTest::setObjectIdNotEnabled() {
#endif
void PhongGLTest::setWrongLightCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -541,6 +565,10 @@ void PhongGLTest::setWrongLightCount() {
}
void PhongGLTest::setWrongLightId() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

8
src/Magnum/Shaders/Test/VectorGLTest.cpp

@ -148,10 +148,10 @@ VectorGLTest::VectorGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef CORRADE_TARGET_APPLE
@ -212,6 +212,10 @@ template<UnsignedInt dimensions> void VectorGLTest::constructMove() {
template<UnsignedInt dimensions> void VectorGLTest::setTextureMatrixNotEnabled() {
setTestCaseTemplateName(std::to_string(dimensions));
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

4
src/Magnum/Shaders/Test/VertexColorGLTest.cpp

@ -111,10 +111,10 @@ VertexColorGLTest::VertexColorGLTest() {
/* Load the plugins directly from the build tree. Otherwise they're either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef CORRADE_TARGET_APPLE

11
src/Magnum/Test/ImageTest.cpp

@ -150,6 +150,10 @@ namespace GL {
UnsignedInt pixelSize(PixelFormat format, PixelType type) {
CORRADE_INTERNAL_ASSERT(format == PixelFormat::RGB);
CORRADE_INTERNAL_ASSERT(type == PixelType::UnsignedShort);
#ifdef CORRADE_NO_ASSERT
static_cast<void>(format);
static_cast<void>(type);
#endif
return 6;
}
@ -163,6 +167,9 @@ namespace Vk {
UnsignedInt pixelSize(PixelFormat);
UnsignedInt pixelSize(PixelFormat format) {
CORRADE_INTERNAL_ASSERT(format == PixelFormat::R32G32B32F);
#ifdef CORRADE_NO_ASSERT
static_cast<void>(format);
#endif
return 12;
}
@ -415,6 +422,10 @@ void ImageTest::constructCompressedImplementationSpecific() {
}
void ImageTest::constructInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

19
src/Magnum/Test/ImageViewTest.cpp

@ -144,6 +144,10 @@ namespace GL {
UnsignedInt pixelSize(PixelFormat format, PixelType type) {
CORRADE_INTERNAL_ASSERT(format == PixelFormat::RGB);
CORRADE_INTERNAL_ASSERT(type == PixelType::UnsignedShort);
#ifdef CORRADE_NO_ASSERT
static_cast<void>(format);
static_cast<void>(type);
#endif
return 6;
}
@ -157,6 +161,9 @@ namespace Vk {
UnsignedInt pixelSize(PixelFormat);
UnsignedInt pixelSize(PixelFormat format) {
CORRADE_INTERNAL_ASSERT(format == PixelFormat::R32G32B32F);
#ifdef CORRADE_NO_ASSERT
static_cast<void>(format);
#endif
return 12;
}
@ -605,6 +612,10 @@ void ImageViewTest::constructNullptr() {
CORRADE_SKIP("This is still allowed on a deprecated build, can't test.");
#endif
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
ImageView2D{PixelFormat::RGB8Unorm, {1, 3}, nullptr};
@ -612,6 +623,10 @@ void ImageViewTest::constructNullptr() {
}
void ImageViewTest::constructInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -700,6 +715,10 @@ template<class T> void ImageViewTest::setDataCompressed() {
}
void ImageViewTest::setDataInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

12
src/Magnum/Test/MeshTest.cpp

@ -166,6 +166,10 @@ void MeshTest::primitiveWrap() {
}
void MeshTest::primitiveWrapInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -180,6 +184,10 @@ void MeshTest::primitiveUnwrap() {
}
void MeshTest::primitiveUnwrapInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -195,6 +203,10 @@ void MeshTest::indexTypeSize() {
}
void MeshTest::indexTypeSizeInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

32
src/Magnum/Test/PixelFormatTest.cpp

@ -201,6 +201,10 @@ void PixelFormatTest::size() {
}
void PixelFormatTest::sizeInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -213,6 +217,10 @@ void PixelFormatTest::sizeInvalid() {
}
void PixelFormatTest::sizeImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -235,6 +243,10 @@ void PixelFormatTest::compressedBlockSize() {
}
void PixelFormatTest::compressedBlockSizeInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -251,6 +263,10 @@ void PixelFormatTest::compressedBlockSizeInvalid() {
}
void PixelFormatTest::compressedBlockSizeImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -275,6 +291,10 @@ void PixelFormatTest::wrap() {
}
void PixelFormatTest::wrapInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -289,6 +309,10 @@ void PixelFormatTest::unwrap() {
}
void PixelFormatTest::unwrapInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -307,6 +331,10 @@ void PixelFormatTest::compressedWrap() {
}
void PixelFormatTest::compressedWrapInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -320,6 +348,10 @@ void PixelFormatTest::compressedUnwrap() {
}
void PixelFormatTest::compressedUnwrapInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

37
src/Magnum/Test/ResourceManagerTest.cpp

@ -46,6 +46,7 @@ struct ResourceManagerTest: TestSuite::Tester {
void stateFallback();
void stateDisallowed();
void basic();
void changeFinalResource();
void residentPolicy();
void referenceCountedPolicy();
void manualPolicy();
@ -82,6 +83,7 @@ ResourceManagerTest::ResourceManagerTest() {
&ResourceManagerTest::stateFallback,
&ResourceManagerTest::stateDisallowed,
&ResourceManagerTest::basic,
&ResourceManagerTest::changeFinalResource,
&ResourceManagerTest::residentPolicy,
&ResourceManagerTest::referenceCountedPolicy,
&ResourceManagerTest::manualPolicy,
@ -259,6 +261,10 @@ void ResourceManagerTest::stateFallback() {
}
void ResourceManagerTest::stateDisallowed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
ResourceManager rm;
std::ostringstream out;
@ -291,18 +297,33 @@ void ResourceManagerTest::basic() {
CORRADE_COMPARE(*theAnswer, 42);
CORRADE_COMPARE(rm.count<Int>(), 2);
/* Cannot change already final resource */
/* Non-final can be changed */
rm.set(questionKey, 20, ResourceDataState::Final, ResourcePolicy::Resident);
CORRADE_COMPARE(theQuestion.state(), ResourceState::Final);
CORRADE_COMPARE(*theQuestion, 20);
}
void ResourceManagerTest::changeFinalResource() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
ResourceManager rm;
ResourceKey answerKey("the-answer");
rm.set(answerKey, 42, ResourceDataState::Final, ResourcePolicy::Resident);
Resource<Int> theAnswer = rm.get<Int>(answerKey);
CORRADE_COMPARE(theAnswer.state(), ResourceState::Final);
CORRADE_COMPARE(*theAnswer, 42);
CORRADE_COMPARE(rm.count<Int>(), 1);
/* Final can not be changed */
std::ostringstream out;
Error redirectError{&out};
int a = 43; /* Done this way to prevent a memory leak on assert (yes, the code is bad) */
rm.set(answerKey, &a, ResourceDataState::Mutable, ResourcePolicy::Resident);
CORRADE_COMPARE(*theAnswer, 42);
CORRADE_COMPARE(out.str(), Utility::formatString("ResourceManager::set(): cannot change already final resource ResourceKey(0x{})\n", answerKey.hexString()));
/* But non-final can be changed */
rm.set(questionKey, 20, ResourceDataState::Final, ResourcePolicy::Resident);
CORRADE_COMPARE(theQuestion.state(), ResourceState::Final);
CORRADE_COMPARE(*theQuestion, 20);
}
void ResourceManagerTest::residentPolicy() {
@ -391,6 +412,10 @@ void ResourceManagerTest::clear() {
}
void ResourceManagerTest::clearWhileReferenced() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
/* Should cover also the destruction case */
std::ostringstream out;

80
src/Magnum/Test/VertexFormatTest.cpp

@ -227,6 +227,10 @@ void VertexFormatTest::wrap() {
}
void VertexFormatTest::wrapInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -241,6 +245,10 @@ void VertexFormatTest::unwrap() {
}
void VertexFormatTest::unwrapInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -263,6 +271,10 @@ void VertexFormatTest::size() {
}
void VertexFormatTest::sizeInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -275,6 +287,10 @@ void VertexFormatTest::sizeInvalid() {
}
void VertexFormatTest::sizeImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormatSize(vertexFormatWrap(0xdead));
@ -296,6 +312,10 @@ void VertexFormatTest::componentCount() {
}
void VertexFormatTest::componentCountInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -308,6 +328,10 @@ void VertexFormatTest::componentCountInvalid() {
}
void VertexFormatTest::componentCountImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormatComponentCount(vertexFormatWrap(0xdead));
@ -337,6 +361,10 @@ void VertexFormatTest::componentFormat() {
}
void VertexFormatTest::componentFormatInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -349,6 +377,10 @@ void VertexFormatTest::componentFormatInvalid() {
}
void VertexFormatTest::componentFormatImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormatComponentFormat(vertexFormatWrap(0xdead));
@ -369,6 +401,10 @@ void VertexFormatTest::vectorCount() {
}
void VertexFormatTest::vectorCountInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -381,6 +417,10 @@ void VertexFormatTest::vectorCountInvalid() {
}
void VertexFormatTest::vectorCountImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormatVectorCount(vertexFormatWrap(0xdead));
@ -403,6 +443,10 @@ void VertexFormatTest::vectorStride() {
}
void VertexFormatTest::vectorStrideInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -415,6 +459,10 @@ void VertexFormatTest::vectorStrideInvalid() {
}
void VertexFormatTest::vectorStrideImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormatVectorStride(vertexFormatWrap(0xdead));
@ -433,6 +481,10 @@ void VertexFormatTest::isNormalized() {
}
void VertexFormatTest::isNormalizedInvalid() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -445,6 +497,10 @@ void VertexFormatTest::isNormalizedInvalid() {
}
void VertexFormatTest::isNormalizedImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
isVertexFormatNormalized(vertexFormatWrap(0xdead));
@ -491,6 +547,10 @@ void VertexFormatTest::assembleRoundtrip() {
}
void VertexFormatTest::assembleCantNormalize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormat(VertexFormat::Vector2, 1, true);
@ -499,6 +559,10 @@ void VertexFormatTest::assembleCantNormalize() {
}
void VertexFormatTest::assembleInvalidComponentCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormat(VertexFormat::Vector3, 5, false);
@ -507,6 +571,10 @@ void VertexFormatTest::assembleInvalidComponentCount() {
}
void VertexFormatTest::assembleImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormat(vertexFormatWrap(0xdead), 1, true);
@ -556,6 +624,10 @@ void VertexFormatTest::assembleMatrixRoundtrip() {
}
void VertexFormatTest::assembleMatrixInvalidType() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormat(VertexFormat::UnsignedByte, 3, 2, false);
@ -570,6 +642,10 @@ void VertexFormatTest::assembleMatrixInvalidType() {
}
void VertexFormatTest::assembleMatrixInvalidCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormat(VertexFormat::Vector3, 2, 1, false);
@ -584,6 +660,10 @@ void VertexFormatTest::assembleMatrixInvalidCount() {
}
void VertexFormatTest::assembleMatrixImplementationSpecific() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
vertexFormat(vertexFormatWrap(0xdead), 2, 2, true);

10
src/Magnum/Text/AbstractFont.cpp

@ -112,8 +112,7 @@ bool AbstractFont::openData(Containers::ArrayView<const char> data, const Float
}
auto AbstractFont::doOpenData(Containers::ArrayView<const char>, Float) -> Metrics {
CORRADE_ASSERT(false, "Text::AbstractFont::openData(): feature advertised but not implemented", {});
return {};
CORRADE_ASSERT_UNREACHABLE("Text::AbstractFont::openData(): feature advertised but not implemented", {});
}
#ifdef MAGNUM_BUILD_DEPRECATED
@ -165,7 +164,7 @@ bool AbstractFont::openFile(const std::string& filename, const Float size) {
_fileCallback(filename, InputFileCallbackPolicy::Close, _fileCallbackUserData);
/* Shouldn't get here, the assert is fired already in setFileCallback() */
} else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */
} else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */
_size = metrics.size;
_ascent = metrics.ascent;
@ -255,7 +254,7 @@ void AbstractFont::fillGlyphCache(AbstractGlyphCache& cache, const std::string&
}
void AbstractFont::doFillGlyphCache(AbstractGlyphCache&, const std::u32string&) {
CORRADE_ASSERT(false, "Text::AbstractFont::fillGlyphCache(): feature advertised but not implemented", );
CORRADE_ASSERT_UNREACHABLE("Text::AbstractFont::fillGlyphCache(): feature advertised but not implemented", );
}
Containers::Pointer<AbstractGlyphCache> AbstractFont::createGlyphCache() {
@ -268,8 +267,7 @@ Containers::Pointer<AbstractGlyphCache> AbstractFont::createGlyphCache() {
}
Containers::Pointer<AbstractGlyphCache> AbstractFont::doCreateGlyphCache() {
CORRADE_ASSERT(false, "Text::AbstractFont::createGlyphCache(): feature advertised but not implemented", nullptr);
return nullptr;
CORRADE_ASSERT_UNREACHABLE("Text::AbstractFont::createGlyphCache(): feature advertised but not implemented", nullptr);
}
Containers::Pointer<AbstractLayouter> AbstractFont::layout(const AbstractGlyphCache& cache, const Float size, const std::string& text) {

12
src/Magnum/Text/AbstractFontConverter.cpp

@ -124,9 +124,7 @@ Containers::Array<char> AbstractFontConverter::exportFontToSingleData(AbstractFo
}
Containers::Array<char> AbstractFontConverter::doExportFontToSingleData(AbstractFont&, AbstractGlyphCache&, const std::u32string&) const {
CORRADE_ASSERT(false,
"Text::AbstractFontConverter::exportFontToSingleData(): feature advertised but not implemented", nullptr);
return nullptr;
CORRADE_ASSERT_UNREACHABLE("Text::AbstractFontConverter::exportFontToSingleData(): feature advertised but not implemented", {});
}
bool AbstractFontConverter::exportFontToFile(AbstractFont& font, AbstractGlyphCache& cache, const std::string& filename, const std::string& characters) const {
@ -178,9 +176,7 @@ Containers::Array<char> AbstractFontConverter::exportGlyphCacheToSingleData(Abst
}
Containers::Array<char> AbstractFontConverter::doExportGlyphCacheToSingleData(AbstractGlyphCache&) const {
CORRADE_ASSERT(false,
"Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature advertised but not implemented", nullptr);
return nullptr;
CORRADE_ASSERT_UNREACHABLE("Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature advertised but not implemented", {});
}
bool AbstractFontConverter::exportGlyphCacheToFile(AbstractGlyphCache& cache, const std::string& filename) const {
@ -234,9 +230,7 @@ Containers::Pointer<AbstractGlyphCache> AbstractFontConverter::importGlyphCacheF
}
Containers::Pointer<AbstractGlyphCache> AbstractFontConverter::doImportGlyphCacheFromSingleData(Containers::ArrayView<const char>) const {
CORRADE_ASSERT(false,
"Text::AbstractFontConverter::importGlyphCacheFromSingleData(): feature advertised but not implemented", nullptr);
return nullptr;
CORRADE_ASSERT_UNREACHABLE("Text::AbstractFontConverter::importGlyphCacheFromSingleData(): feature advertised but not implemented", {});
}
Containers::Pointer<AbstractGlyphCache> AbstractFontConverter::importGlyphCacheFromFile(const std::string& filename) const {

2
src/Magnum/Text/AbstractGlyphCache.cpp

@ -72,7 +72,7 @@ Image2D AbstractGlyphCache::image() {
}
Image2D AbstractGlyphCache::doImage() {
CORRADE_ASSERT(false, "Text::AbstractGlyphCache::image(): feature advertised but not implemented", Image2D{PixelFormat::R8Unorm});
CORRADE_ASSERT_UNREACHABLE("Text::AbstractGlyphCache::image(): feature advertised but not implemented", Image2D{PixelFormat::R8Unorm});
}
}}

4
src/Magnum/Text/DistanceFieldGlyphCache.cpp

@ -65,7 +65,9 @@ void DistanceFieldGlyphCache::doSetImage(const Vector2i& offset, const ImageView
.setMinificationFilter(GL::SamplerFilter::Linear)
.setMagnificationFilter(GL::SamplerFilter::Linear);
#ifndef CORRADE_NO_ASSERT
const GL::PixelFormat format = GL::pixelFormat(image.format());
#endif
#if !(defined(MAGNUM_TARGET_GLES) && defined(MAGNUM_TARGET_GLES2))
CORRADE_ASSERT(format == GL::PixelFormat::Red,
"Text::DistanceFieldGlyphCache::setImage(): expected"
@ -93,7 +95,9 @@ void DistanceFieldGlyphCache::doSetImage(const Vector2i& offset, const ImageView
}
void DistanceFieldGlyphCache::setDistanceFieldImage(const Vector2i& offset, const ImageView2D& image) {
#ifndef CORRADE_NO_ASSERT
const GL::PixelFormat format = GL::pixelFormat(image.format());
#endif
#if !(defined(MAGNUM_TARGET_GLES) && defined(MAGNUM_TARGET_GLES2))
CORRADE_ASSERT(format == GL::PixelFormat::Red,
"Text::DistanceFieldGlyphCache::setDistanceFieldImage(): expected" << GL::PixelFormat::Red << "but got" << format, );

60
src/Magnum/Text/Test/AbstractFontTest.cpp

@ -251,6 +251,10 @@ void AbstractFontTest::openFileAsDataNotFound() {
}
void AbstractFontTest::openFileNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractFont {
/* Supports neither file nor data opening */
FontFeatures doFeatures() const override { return {}; }
@ -271,6 +275,10 @@ void AbstractFontTest::openFileNotImplemented() {
}
void AbstractFontTest::openDataNotSupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractFont {
/* Supports neither file nor data opening */
FontFeatures doFeatures() const override { return {}; }
@ -291,6 +299,10 @@ void AbstractFontTest::openDataNotSupported() {
}
void AbstractFontTest::openDataNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractFont {
FontFeatures doFeatures() const override { return FontFeature::OpenData; }
bool doIsOpened() const override { return false; }
@ -492,6 +504,10 @@ void AbstractFontTest::setFileCallbackTemplateConst() {
}
void AbstractFontTest::setFileCallbackFileOpened() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractFont {
FontFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -537,6 +553,10 @@ void AbstractFontTest::setFileCallbackNotImplemented() {
}
void AbstractFontTest::setFileCallbackNotSupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractFont {
FontFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -811,6 +831,10 @@ void AbstractFontTest::properties() {
}
void AbstractFontTest::propertiesNoFont() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyFont: AbstractFont {
FontFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -853,6 +877,10 @@ void AbstractFontTest::glyphId() {
}
void AbstractFontTest::glyphIdNoFont() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyFont: AbstractFont {
FontFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -888,6 +916,10 @@ void AbstractFontTest::glyphAdvance() {
}
void AbstractFontTest::glyphAdvanceNoFont() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyFont: AbstractFont {
FontFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -937,6 +969,10 @@ void AbstractFontTest::layout() {
}
void AbstractFontTest::layoutNoFont() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyFont: AbstractFont {
FontFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -982,6 +1018,10 @@ void AbstractFontTest::fillGlyphCache() {
}
void AbstractFontTest::fillGlyphCacheNotSupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyFont: AbstractFont {
FontFeatures doFeatures() const override { return FontFeature::PreparedGlyphCache; }
bool doIsOpened() const override { return true; }
@ -1000,6 +1040,10 @@ void AbstractFontTest::fillGlyphCacheNotSupported() {
}
void AbstractFontTest::fillGlyphCacheNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyFont: AbstractFont {
FontFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1018,6 +1062,10 @@ void AbstractFontTest::fillGlyphCacheNotImplemented() {
}
void AbstractFontTest::fillGlyphCacheNoFont() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyFont: AbstractFont {
FontFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -1062,6 +1110,10 @@ void AbstractFontTest::createGlyphCache() {
}
void AbstractFontTest::createGlyphCacheNotSupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyFont: AbstractFont {
FontFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1079,6 +1131,10 @@ void AbstractFontTest::createGlyphCacheNotSupported() {
}
void AbstractFontTest::createGlyphCacheNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyFont: AbstractFont {
FontFeatures doFeatures() const override { return FontFeature::PreparedGlyphCache; }
bool doIsOpened() const override { return true; }
@ -1096,6 +1152,10 @@ void AbstractFontTest::createGlyphCacheNotImplemented() {
}
void AbstractFontTest::createGlyphCacheNoFont() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyFont: AbstractFont {
FontFeatures doFeatures() const override { return FontFeature::PreparedGlyphCache; }
bool doIsOpened() const override { return false; }

12
src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp

@ -134,6 +134,10 @@ void AbstractGlyphCacheTest::setImage() {
}
void AbstractGlyphCacheTest::setImageOutOfBounds() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
DummyGlyphCache cache{{100, 200}};
std::ostringstream out;
@ -162,6 +166,10 @@ void AbstractGlyphCacheTest::image() {
}
void AbstractGlyphCacheTest::imageNotSupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyGlyphCache: AbstractGlyphCache {
using AbstractGlyphCache::AbstractGlyphCache;
@ -176,6 +184,10 @@ void AbstractGlyphCacheTest::imageNotSupported() {
}
void AbstractGlyphCacheTest::imageNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct MyGlyphCache: AbstractGlyphCache {
using AbstractGlyphCache::AbstractGlyphCache;

4
src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp

@ -74,10 +74,10 @@ DistanceFieldGLTest::DistanceFieldGLTest() {
/* Load the plugin directly from the build tree. Otherwise it's either
static and already loaded or not present in the build tree */
#ifdef ANYIMAGEIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef TGAIMPORTER_PLUGIN_FILENAME
CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded);
#endif
#ifdef CORRADE_TARGET_APPLE

8
src/Magnum/Trade/AbstractImageConverter.cpp

@ -95,7 +95,7 @@ Containers::Optional<Image2D> AbstractImageConverter::exportToImage(const ImageV
}
Containers::Optional<Image2D> AbstractImageConverter::doExportToImage(const ImageView2D&) {
CORRADE_ASSERT(false, "Trade::AbstractImageConverter::exportToImage(): feature advertised but not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImageConverter::exportToImage(): feature advertised but not implemented", {});
}
Containers::Optional<CompressedImage2D> AbstractImageConverter::exportToCompressedImage(const ImageView2D& image) {
@ -108,7 +108,7 @@ Containers::Optional<CompressedImage2D> AbstractImageConverter::exportToCompress
}
Containers::Optional<CompressedImage2D> AbstractImageConverter::doExportToCompressedImage(const ImageView2D&) {
CORRADE_ASSERT(false, "Trade::AbstractImageConverter::exportToCompressedImage(): feature advertised but not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImageConverter::exportToCompressedImage(): feature advertised but not implemented", {});
}
Containers::Array<char> AbstractImageConverter::exportToData(const ImageView2D& image) {
@ -121,7 +121,7 @@ Containers::Array<char> AbstractImageConverter::exportToData(const ImageView2D&
}
Containers::Array<char> AbstractImageConverter::doExportToData(const ImageView2D&) {
CORRADE_ASSERT(false, "Trade::AbstractImageConverter::exportToData(): feature advertised but not implemented", nullptr);
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImageConverter::exportToData(): feature advertised but not implemented", nullptr);
}
Containers::Array<char> AbstractImageConverter::exportToData(const CompressedImageView2D& image) {
@ -134,7 +134,7 @@ Containers::Array<char> AbstractImageConverter::exportToData(const CompressedIma
}
Containers::Array<char> AbstractImageConverter::doExportToData(const CompressedImageView2D&) {
CORRADE_ASSERT(false, "Trade::AbstractImageConverter::exportToData(): feature advertised but not implemented", nullptr);
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImageConverter::exportToData(): feature advertised but not implemented", nullptr);
}
Containers::Array<char> AbstractImageConverter::exportToData(const ImageData2D& image) {

30
src/Magnum/Trade/AbstractImporter.cpp

@ -125,7 +125,7 @@ bool AbstractImporter::openData(Containers::ArrayView<const char> data) {
}
void AbstractImporter::doOpenData(Containers::ArrayView<const char>) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::openData(): feature advertised but not implemented", );
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::openData(): feature advertised but not implemented", );
}
bool AbstractImporter::openState(const void* state, const std::string& filePath) {
@ -138,7 +138,7 @@ bool AbstractImporter::openState(const void* state, const std::string& filePath)
}
void AbstractImporter::doOpenState(const void*, const std::string&) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::openState(): feature advertised but not implemented", );
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::openState(): feature advertised but not implemented", );
}
bool AbstractImporter::openFile(const std::string& filename) {
@ -245,7 +245,7 @@ Containers::Optional<SceneData> AbstractImporter::scene(const UnsignedInt id) {
}
Containers::Optional<SceneData> AbstractImporter::doScene(UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::scene(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::scene(): not implemented", {});
}
Containers::Optional<SceneData> AbstractImporter::scene(const std::string& name) {
@ -292,7 +292,7 @@ Containers::Optional<AnimationData> AbstractImporter::animation(const UnsignedIn
}
Containers::Optional<AnimationData> AbstractImporter::doAnimation(UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::animation(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::animation(): not implemented", {});
}
Containers::Optional<AnimationData> AbstractImporter::animation(const std::string& name) {
@ -334,7 +334,7 @@ Containers::Optional<LightData> AbstractImporter::light(const UnsignedInt id) {
}
Containers::Optional<LightData> AbstractImporter::doLight(UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::light(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::light(): not implemented", {});
}
Containers::Optional<LightData> AbstractImporter::light(const std::string& name) {
@ -376,7 +376,7 @@ Containers::Optional<CameraData> AbstractImporter::camera(const UnsignedInt id)
}
Containers::Optional<CameraData> AbstractImporter::doCamera(UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::camera(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::camera(): not implemented", {});
}
Containers::Optional<CameraData> AbstractImporter::camera(const std::string& name) {
@ -418,7 +418,7 @@ Containers::Pointer<ObjectData2D> AbstractImporter::object2D(const UnsignedInt i
}
Containers::Pointer<ObjectData2D> AbstractImporter::doObject2D(UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::object2D(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::object2D(): not implemented", {});
}
Containers::Pointer<ObjectData2D> AbstractImporter::object2D(const std::string& name) {
@ -460,7 +460,7 @@ Containers::Pointer<ObjectData3D> AbstractImporter::object3D(const UnsignedInt i
}
Containers::Pointer<ObjectData3D> AbstractImporter::doObject3D(UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::object3D(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::object3D(): not implemented", {});
}
Containers::Pointer<ObjectData3D> AbstractImporter::object3D(const std::string& name) {
@ -529,7 +529,7 @@ Containers::Optional<MeshData> AbstractImporter::mesh(const UnsignedInt id, cons
}
Containers::Optional<MeshData> AbstractImporter::doMesh(UnsignedInt, UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::mesh(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::mesh(): not implemented", {});
}
Containers::Optional<MeshData> AbstractImporter::mesh(const std::string& name, const UnsignedInt level) {
@ -598,7 +598,7 @@ Containers::Optional<MeshData2D> AbstractImporter::mesh2D(const UnsignedInt id)
}
Containers::Optional<MeshData2D> AbstractImporter::doMesh2D(UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::mesh2D(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::mesh2D(): not implemented", {});
}
CORRADE_IGNORE_DEPRECATED_POP
@ -680,7 +680,7 @@ Containers::Pointer<AbstractMaterialData> AbstractImporter::material(const Unsig
}
Containers::Pointer<AbstractMaterialData> AbstractImporter::doMaterial(UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::material(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::material(): not implemented", {});
}
Containers::Pointer<AbstractMaterialData> AbstractImporter::material(const std::string& name) {
@ -722,7 +722,7 @@ Containers::Optional<TextureData> AbstractImporter::texture(const UnsignedInt id
}
Containers::Optional<TextureData> AbstractImporter::doTexture(UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::texture(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::texture(): not implemented", {});
}
Containers::Optional<TextureData> AbstractImporter::texture(const std::string& name) {
@ -788,7 +788,7 @@ Containers::Optional<ImageData1D> AbstractImporter::image1D(const UnsignedInt id
}
Containers::Optional<ImageData1D> AbstractImporter::doImage1D(UnsignedInt, UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::image1D(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::image1D(): not implemented", {});
}
Containers::Optional<ImageData1D> AbstractImporter::image1D(const std::string& name, const UnsignedInt level) {
@ -855,7 +855,7 @@ Containers::Optional<ImageData2D> AbstractImporter::image2D(const UnsignedInt id
}
Containers::Optional<ImageData2D> AbstractImporter::doImage2D(UnsignedInt, UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::image2D(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::image2D(): not implemented", {});
}
Containers::Optional<ImageData2D> AbstractImporter::image2D(const std::string& name, const UnsignedInt level) {
@ -922,7 +922,7 @@ Containers::Optional<ImageData3D> AbstractImporter::image3D(const UnsignedInt id
}
Containers::Optional<ImageData3D> AbstractImporter::doImage3D(UnsignedInt, UnsignedInt) {
CORRADE_ASSERT(false, "Trade::AbstractImporter::image3D(): not implemented", {});
CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::image3D(): not implemented", {});
}
Containers::Optional<ImageData3D> AbstractImporter::image3D(const std::string& name, const UnsignedInt level) {

2
src/Magnum/Trade/AnimationData.h

@ -601,7 +601,6 @@ plugin binary to avoid dangling function pointers on plugin unload.
*/
template<class V, class R = Animation::ResultOf<V>> MAGNUM_TRADE_EXPORT auto animationInterpolatorFor(Animation::Interpolation interpolation) -> R(*)(const V&, const V&, Float);
#if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT)
namespace Implementation {
/* LCOV_EXCL_START */
template<class> constexpr AnimationTrackType animationTypeFor();
@ -649,7 +648,6 @@ namespace Implementation {
template<> constexpr AnimationTrackType animationTypeFor<CubicHermiteQuaternion>() { return AnimationTrackType::CubicHermiteQuaternion; }
/* LCOV_EXCL_STOP */
}
#endif
template<class V, class R> inline AnimationTrackData::AnimationTrackData(AnimationTrackTargetType targetType, UnsignedInt target, Animation::TrackView<const Float, const V, R> view) noexcept: AnimationTrackData{Implementation::animationTypeFor<V>(), Implementation::animationTypeFor<R>(), targetType, target, view} {}

4
src/Magnum/Trade/MeshData.cpp

@ -45,7 +45,7 @@ MeshIndexData::MeshIndexData(const Containers::StridedArrayView2D<const char>& d
if(data.size()[1] == 4) _type = MeshIndexType::UnsignedInt;
else if(data.size()[1] == 2) _type = MeshIndexType::UnsignedShort;
else if(data.size()[1] == 1) _type = MeshIndexType::UnsignedByte;
else CORRADE_ASSERT(false, "Trade::MeshIndexData: expected index type size 1, 2 or 4 but got" << data.size()[1], );
else CORRADE_ASSERT_UNREACHABLE("Trade::MeshIndexData: expected index type size 1, 2 or 4 but got" << data.size()[1], );
CORRADE_ASSERT(data.isContiguous(), "Trade::MeshIndexData: view is not contiguous", );
_data = data.asContiguous();
@ -619,7 +619,7 @@ void MeshData::bitangentSignsInto(const Containers::StridedArrayView1D<Float> de
Math::unpackInto(Containers::arrayCast<2, const Byte>(attributeData, 4).suffix({0, 3}), destination1f);
else if(attribute._format == VertexFormat::Vector4sNormalized)
Math::unpackInto(Containers::arrayCast<2, const Short>(attributeData, 4).suffix({0, 3}), destination1f);
else CORRADE_ASSERT(false, "Trade::MeshData::bitangentSignsInto(): expected four-component tangents, but got" << attribute._format, );
else CORRADE_ASSERT_UNREACHABLE("Trade::MeshData::bitangentSignsInto(): expected four-component tangents, but got" << attribute._format, );
}
Containers::Array<Float> MeshData::bitangentSignsAsArray(const UnsignedInt id) const {

12
src/Magnum/Trade/MeshData.h

@ -1804,7 +1804,6 @@ class MAGNUM_TRADE_EXPORT MeshData {
Containers::Array<char> _indexData, _vertexData;
};
#if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT)
namespace Implementation {
/* LCOV_EXCL_START */
template<class T> constexpr MeshIndexType meshIndexTypeFor() {
@ -1924,6 +1923,7 @@ namespace Implementation {
template<> constexpr VertexFormat vertexFormatFor<Matrix4>() { return VertexFormat::Matrix4x4; }
template<> constexpr VertexFormat vertexFormatFor<Matrix4d>() { return VertexFormat::Matrix4x4d; }
#ifndef CORRADE_NO_ASSERT
/* Check if enum is compatible with a format (1:n). Mostly just 1:1 mapping
tho, so reusing vertexFormatFor(), with a few exceptions. */
template<class T> constexpr bool isVertexFormatCompatible(VertexFormat type) {
@ -2070,8 +2070,8 @@ namespace Implementation {
constexpr bool isAttributeArrayAllowed(MeshAttribute name) {
return isMeshAttributeCustom(name);
}
#endif
}
#endif
constexpr MeshAttributeData::MeshAttributeData(const MeshAttribute name, const VertexFormat format, const UnsignedShort arraySize, const Containers::StridedArrayView1D<const void>& data, std::nullptr_t) noexcept:
_format{(CORRADE_CONSTEXPR_ASSERT(!arraySize || !isVertexFormatImplementationSpecific(format),
@ -2153,8 +2153,8 @@ template<class T, class> Containers::StridedArrayView2D<const typename std::remo
#ifdef CORRADE_GRACEFUL_ASSERT /* Sigh. Brittle. Better idea? */
if(!data.stride()[1]) return {};
#endif
const MeshAttributeData& attribute = _attributes[id];
#ifndef CORRADE_NO_ASSERT
const MeshAttributeData& attribute = _attributes[id];
if(!checkAttributeTypeCompatibility<T>(attribute, "Trade::MeshData::attribute():")) return {};
#endif
return Containers::arrayCast<2, const typename std::remove_extent<T>::type>(data);
@ -2176,8 +2176,8 @@ template<class T, class> Containers::StridedArrayView2D<typename std::remove_ext
#ifdef CORRADE_GRACEFUL_ASSERT /* Sigh. Brittle. Better idea? */
if(!data.stride()[1]) return {};
#endif
const MeshAttributeData& attribute = _attributes[id];
#ifndef CORRADE_NO_ASSERT
const MeshAttributeData& attribute = _attributes[id];
if(!checkAttributeTypeCompatibility<T>(attribute, "Trade::MeshData::mutableAttribute():")) return {};
#endif
return Containers::arrayCast<2, typename std::remove_extent<T>::type>(data);
@ -2199,8 +2199,8 @@ template<class T, class> Containers::StridedArrayView2D<const typename std::remo
#ifdef CORRADE_GRACEFUL_ASSERT /* Sigh. Brittle. Better idea? */
if(!data.stride()[1]) return {};
#endif
const MeshAttributeData& attribute = _attributes[attributeFor(name, id)];
#ifndef CORRADE_NO_ASSERT
const MeshAttributeData& attribute = _attributes[attributeFor(name, id)];
if(!checkAttributeTypeCompatibility<T>(attribute, "Trade::MeshData::attribute():")) return {};
#endif
return Containers::arrayCast<2, const typename std::remove_extent<T>::type>(data);
@ -2222,8 +2222,8 @@ template<class T, class> Containers::StridedArrayView2D<typename std::remove_ext
#ifdef CORRADE_GRACEFUL_ASSERT /* Sigh. Brittle. Better idea? */
if(!data.stride()[1]) return {};
#endif
const MeshAttributeData& attribute = _attributes[attributeFor(name, id)];
#ifndef CORRADE_NO_ASSERT
const MeshAttributeData& attribute = _attributes[attributeFor(name, id)];
if(!checkAttributeTypeCompatibility<T>(attribute, "Trade::MeshData::mutableAttribute():")) return {};
#endif
return Containers::arrayCast<2, typename std::remove_extent<T>::type>(data);

44
src/Magnum/Trade/Test/AbstractImageConverterTest.cpp

@ -149,6 +149,10 @@ void AbstractImageConverterTest::constructWithPluginManagerReference() {
}
void AbstractImageConverterTest::thingNotSupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return {}; }
} converter;
@ -185,6 +189,10 @@ void AbstractImageConverterTest::exportToImage() {
}
void AbstractImageConverterTest::exportToImageNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertImage; }
} converter;
@ -196,6 +204,10 @@ void AbstractImageConverterTest::exportToImageNotImplemented() {
}
void AbstractImageConverterTest::exportToImageCustomDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertImage; }
Containers::Optional<Image2D> doExportToImage(const ImageView2D&) override {
@ -224,6 +236,10 @@ void AbstractImageConverterTest::exportToCompressedImage() {
}
void AbstractImageConverterTest::exportToCompressedImageNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedImage; }
} converter;
@ -235,6 +251,10 @@ void AbstractImageConverterTest::exportToCompressedImageNotImplemented() {
}
void AbstractImageConverterTest::exportToCompressedImageCustomDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedImage; }
Containers::Optional<CompressedImage2D> doExportToCompressedImage(const ImageView2D&) override {
@ -261,6 +281,10 @@ void AbstractImageConverterTest::exportToData() {
}
void AbstractImageConverterTest::exportToDataNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData; }
} converter;
@ -272,6 +296,10 @@ void AbstractImageConverterTest::exportToDataNotImplemented() {
}
void AbstractImageConverterTest::exportToDataCustomDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData; }
Containers::Array<char> doExportToData(const ImageView2D&) override {
@ -298,6 +326,10 @@ void AbstractImageConverterTest::exportCompressedToData() {
}
void AbstractImageConverterTest::exportCompressedToDataNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData; }
} converter;
@ -309,6 +341,10 @@ void AbstractImageConverterTest::exportCompressedToDataNotImplemented() {
}
void AbstractImageConverterTest::exportCompressedToDataCustomDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedData; }
Containers::Array<char> doExportToData(const CompressedImageView2D&) override {
@ -409,6 +445,10 @@ void AbstractImageConverterTest::exportToFileThroughDataNotWritable() {
}
void AbstractImageConverterTest::exportToFileNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertFile; }
} converter;
@ -469,6 +509,10 @@ void AbstractImageConverterTest::exportCompressedToFileThroughDataNotWritable()
}
void AbstractImageConverterTest::exportCompressedToFileNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImageConverter {
ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedFile; }
} converter;

332
src/Magnum/Trade/Test/AbstractImporterTest.cpp

@ -533,6 +533,10 @@ void AbstractImporterTest::openFileAsDataNotFound() {
}
void AbstractImporterTest::openFileNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct Importer: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -547,6 +551,10 @@ void AbstractImporterTest::openFileNotImplemented() {
}
void AbstractImporterTest::openDataNotSupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -561,6 +569,10 @@ void AbstractImporterTest::openDataNotSupported() {
}
void AbstractImporterTest::openDataNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; }
bool doIsOpened() const override { return false; }
@ -575,6 +587,10 @@ void AbstractImporterTest::openDataNotImplemented() {
}
void AbstractImporterTest::openStateNotSupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -589,6 +605,10 @@ void AbstractImporterTest::openStateNotSupported() {
}
void AbstractImporterTest::openStateNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return ImporterFeature::OpenState; }
bool doIsOpened() const override { return false; }
@ -691,6 +711,10 @@ void AbstractImporterTest::setFileCallbackTemplateConst() {
}
void AbstractImporterTest::setFileCallbackFileOpened() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -724,6 +748,10 @@ void AbstractImporterTest::setFileCallbackNotImplemented() {
}
void AbstractImporterTest::setFileCallbackNotSupported() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -942,6 +970,10 @@ void AbstractImporterTest::thingCountNotImplemented() {
}
void AbstractImporterTest::thingCountNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -1017,6 +1049,10 @@ void AbstractImporterTest::thingForNameNotImplemented() {
}
void AbstractImporterTest::thingForNameNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -1113,6 +1149,10 @@ void AbstractImporterTest::thingByNameNotFound() {
}
void AbstractImporterTest::thingNameNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -1155,6 +1195,10 @@ void AbstractImporterTest::thingNameNoFile() {
}
void AbstractImporterTest::thingNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -1297,6 +1341,10 @@ void AbstractImporterTest::sceneNameNotImplemented() {
}
void AbstractImporterTest::sceneNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1313,6 +1361,10 @@ void AbstractImporterTest::sceneNameOutOfRange() {
}
void AbstractImporterTest::sceneNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1329,6 +1381,10 @@ void AbstractImporterTest::sceneNotImplemented() {
}
void AbstractImporterTest::sceneOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1398,6 +1454,10 @@ void AbstractImporterTest::animationNameNotImplemented() {
}
void AbstractImporterTest::animationNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1414,6 +1474,10 @@ void AbstractImporterTest::animationNameOutOfRange() {
}
void AbstractImporterTest::animationNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1430,6 +1494,10 @@ void AbstractImporterTest::animationNotImplemented() {
}
void AbstractImporterTest::animationOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1487,6 +1555,10 @@ void AbstractImporterTest::animationGrowableDeleters() {
}
void AbstractImporterTest::animationCustomDataDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1510,6 +1582,10 @@ void AbstractImporterTest::animationCustomDataDeleter() {
}
void AbstractImporterTest::animationCustomTrackDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1581,6 +1657,10 @@ void AbstractImporterTest::lightNameNotImplemented() {
}
void AbstractImporterTest::lightNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1597,6 +1677,10 @@ void AbstractImporterTest::lightNameOutOfRange() {
}
void AbstractImporterTest::lightNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1613,6 +1697,10 @@ void AbstractImporterTest::lightNotImplemented() {
}
void AbstractImporterTest::lightOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1677,6 +1765,10 @@ void AbstractImporterTest::cameraNameNotImplemented() {
}
void AbstractImporterTest::cameraNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1693,6 +1785,10 @@ void AbstractImporterTest::cameraNameOutOfRange() {
}
void AbstractImporterTest::cameraNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1709,6 +1805,10 @@ void AbstractImporterTest::cameraNotImplemented() {
}
void AbstractImporterTest::cameraOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1773,6 +1873,10 @@ void AbstractImporterTest::object2DNameNotImplemented() {
}
void AbstractImporterTest::object2DNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1789,6 +1893,10 @@ void AbstractImporterTest::object2DNameOutOfRange() {
}
void AbstractImporterTest::object2DNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1805,6 +1913,10 @@ void AbstractImporterTest::object2DNotImplemented() {
}
void AbstractImporterTest::object2DOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1869,6 +1981,10 @@ void AbstractImporterTest::object3DNameNotImplemented() {
}
void AbstractImporterTest::object3DNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1885,6 +2001,10 @@ void AbstractImporterTest::object3DNameOutOfRange() {
}
void AbstractImporterTest::object3DNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -1901,6 +2021,10 @@ void AbstractImporterTest::object3DNotImplemented() {
}
void AbstractImporterTest::object3DOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2010,6 +2134,10 @@ void AbstractImporterTest::meshLevelCountNotImplemented() {
}
void AbstractImporterTest::meshLevelCountOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2025,6 +2153,10 @@ void AbstractImporterTest::meshLevelCountOutOfRange() {
}
void AbstractImporterTest::meshLevelCountZero() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2061,6 +2193,10 @@ void AbstractImporterTest::meshNameNotImplemented() {
}
void AbstractImporterTest::meshNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2077,6 +2213,10 @@ void AbstractImporterTest::meshNameOutOfRange() {
}
void AbstractImporterTest::meshNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2093,6 +2233,10 @@ void AbstractImporterTest::meshNotImplemented() {
}
void AbstractImporterTest::meshOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2109,6 +2253,10 @@ void AbstractImporterTest::meshOutOfRange() {
}
void AbstractImporterTest::meshLevelOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2181,6 +2329,10 @@ void AbstractImporterTest::meshGrowableDeleters() {
}
void AbstractImporterTest::meshCustomIndexDataDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2206,6 +2358,10 @@ void AbstractImporterTest::meshCustomIndexDataDeleter() {
}
void AbstractImporterTest::meshCustomVertexDataDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2229,6 +2385,10 @@ void AbstractImporterTest::meshCustomVertexDataDeleter() {
}
void AbstractImporterTest::meshCustomAttributesDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2287,6 +2447,10 @@ void AbstractImporterTest::meshAttributeNameNotImplemented() {
}
void AbstractImporterTest::meshAttributeNameNotCustom() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -2354,6 +2518,10 @@ void AbstractImporterTest::mesh2DCountNotImplemented() {
}
void AbstractImporterTest::mesh2DCountNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -2382,6 +2550,10 @@ void AbstractImporterTest::mesh2DForNameNotImplemented() {
}
void AbstractImporterTest::mesh2DForNameNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -2412,6 +2584,10 @@ void AbstractImporterTest::mesh2DNameNotImplemented() {
}
void AbstractImporterTest::mesh2DNameNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -2428,6 +2604,10 @@ void AbstractImporterTest::mesh2DNameNoFile() {
}
void AbstractImporterTest::mesh2DNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2446,6 +2626,10 @@ void AbstractImporterTest::mesh2DNameOutOfRange() {
}
void AbstractImporterTest::mesh2DNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2464,6 +2648,10 @@ void AbstractImporterTest::mesh2DNotImplemented() {
}
void AbstractImporterTest::mesh2DNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -2480,6 +2668,10 @@ void AbstractImporterTest::mesh2DNoFile() {
}
void AbstractImporterTest::mesh2DOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2544,6 +2736,10 @@ void AbstractImporterTest::mesh3DCountNotImplemented() {
}
void AbstractImporterTest::mesh3DCountNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -2572,6 +2768,10 @@ void AbstractImporterTest::mesh3DForNameNotImplemented() {
}
void AbstractImporterTest::mesh3DForNameNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -2602,6 +2802,10 @@ void AbstractImporterTest::mesh3DNameNotImplemented() {
}
void AbstractImporterTest::mesh3DNameNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -2618,6 +2822,10 @@ void AbstractImporterTest::mesh3DNameNoFile() {
}
void AbstractImporterTest::mesh3DNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2636,6 +2844,10 @@ void AbstractImporterTest::mesh3DNameOutOfRange() {
}
void AbstractImporterTest::mesh3DNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2656,6 +2868,10 @@ void AbstractImporterTest::mesh3DNotImplemented() {
}
void AbstractImporterTest::mesh3DNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }
@ -2672,6 +2888,10 @@ void AbstractImporterTest::mesh3DNoFile() {
}
void AbstractImporterTest::mesh3DOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2742,6 +2962,10 @@ void AbstractImporterTest::materialNameNotImplemented() {
}
void AbstractImporterTest::materialNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2758,6 +2982,10 @@ void AbstractImporterTest::materialNameOutOfRange() {
}
void AbstractImporterTest::materialNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2774,6 +3002,10 @@ void AbstractImporterTest::materialNotImplemented() {
}
void AbstractImporterTest::materialOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2838,6 +3070,10 @@ void AbstractImporterTest::textureNameNotImplemented() {
}
void AbstractImporterTest::textureNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2854,6 +3090,10 @@ void AbstractImporterTest::textureNameOutOfRange() {
}
void AbstractImporterTest::textureNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2870,6 +3110,10 @@ void AbstractImporterTest::textureNotImplemented() {
}
void AbstractImporterTest::textureOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2939,6 +3183,10 @@ void AbstractImporterTest::image1DLevelCountNotImplemented() {
}
void AbstractImporterTest::image1DLevelCountOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2954,6 +3202,10 @@ void AbstractImporterTest::image1DLevelCountOutOfRange() {
}
void AbstractImporterTest::image1DLevelCountZero() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -2990,6 +3242,10 @@ void AbstractImporterTest::image1DNameNotImplemented() {
}
void AbstractImporterTest::image1DNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3006,6 +3262,10 @@ void AbstractImporterTest::image1DNameOutOfRange() {
}
void AbstractImporterTest::image1DNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3022,6 +3282,10 @@ void AbstractImporterTest::image1DNotImplemented() {
}
void AbstractImporterTest::image1DOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3038,6 +3302,10 @@ void AbstractImporterTest::image1DOutOfRange() {
}
void AbstractImporterTest::image1DLevelOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3096,6 +3364,10 @@ void AbstractImporterTest::image1DGrowableDeleter() {
}
void AbstractImporterTest::image1DCustomDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3172,6 +3444,10 @@ void AbstractImporterTest::image2DLevelCountNotImplemented() {
}
void AbstractImporterTest::image2DLevelCountOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3187,6 +3463,10 @@ void AbstractImporterTest::image2DLevelCountOutOfRange() {
}
void AbstractImporterTest::image2DLevelCountZero() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3223,6 +3503,10 @@ void AbstractImporterTest::image2DNameNotImplemented() {
}
void AbstractImporterTest::image2DNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3239,6 +3523,10 @@ void AbstractImporterTest::image2DNameOutOfRange() {
}
void AbstractImporterTest::image2DNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3255,6 +3543,10 @@ void AbstractImporterTest::image2DNotImplemented() {
}
void AbstractImporterTest::image2DOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3271,6 +3563,10 @@ void AbstractImporterTest::image2DOutOfRange() {
}
void AbstractImporterTest::image2DLevelOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3329,6 +3625,10 @@ void AbstractImporterTest::image2DGrowableDeleter() {
}
void AbstractImporterTest::image2DCustomDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3405,6 +3705,10 @@ void AbstractImporterTest::image3DLevelCountNotImplemented() {
}
void AbstractImporterTest::image3DLevelCountOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3420,6 +3724,10 @@ void AbstractImporterTest::image3DLevelCountOutOfRange() {
}
void AbstractImporterTest::image3DLevelCountZero() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3456,6 +3764,10 @@ void AbstractImporterTest::image3DNameNotImplemented() {
}
void AbstractImporterTest::image3DNameOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3472,6 +3784,10 @@ void AbstractImporterTest::image3DNameOutOfRange() {
}
void AbstractImporterTest::image3DNotImplemented() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3488,6 +3804,10 @@ void AbstractImporterTest::image3DNotImplemented() {
}
void AbstractImporterTest::image3DOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3504,6 +3824,10 @@ void AbstractImporterTest::image3DOutOfRange() {
}
void AbstractImporterTest::image3DLevelOutOfRange() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3562,6 +3886,10 @@ void AbstractImporterTest::image3DGrowableDeleter() {
}
void AbstractImporterTest::image3DCustomDeleter() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return true; }
@ -3607,6 +3935,10 @@ void AbstractImporterTest::importerStateNotImplemented() {
}
void AbstractImporterTest::importerStateNoFile() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
struct: AbstractImporter {
ImporterFeatures doFeatures() const override { return {}; }
bool doIsOpened() const override { return false; }

24
src/Magnum/Trade/Test/AnimationDataTest.cpp

@ -398,6 +398,10 @@ void AnimationDataTest::constructImplicitDurationNotOwned() {
}
void AnimationDataTest::constructNotOwnedFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
AnimationData data{DataFlag::Owned, nullptr, {}, {-1.0f, 7.0f}};
@ -406,6 +410,10 @@ void AnimationDataTest::constructNotOwnedFlagOwned() {
}
void AnimationDataTest::constructImplicitDurationNotOwnedFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
AnimationData data{DataFlag::Owned, nullptr, {}};
@ -516,6 +524,10 @@ void AnimationDataTest::constructMove() {
}
void AnimationDataTest::mutableAccessNotAllowed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const std::pair<Float, bool> keyframes[] {
{1.0f, true},
{5.0f, false}
@ -564,6 +576,10 @@ void AnimationDataTest::trackCustomResultType() {
}
void AnimationDataTest::trackWrongIndex() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -583,6 +599,10 @@ void AnimationDataTest::trackWrongIndex() {
}
void AnimationDataTest::trackWrongType() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -598,6 +618,10 @@ void AnimationDataTest::trackWrongType() {
}
void AnimationDataTest::trackWrongResultType() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

12
src/Magnum/Trade/Test/CameraDataTest.cpp

@ -105,6 +105,10 @@ void CameraDataTest::construct2D() {
}
void CameraDataTest::construct2DFoV() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -114,6 +118,10 @@ void CameraDataTest::construct2DFoV() {
}
void CameraDataTest::construct2DNearFar() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -156,6 +164,10 @@ void CameraDataTest::constructMove() {
}
void CameraDataTest::fovNonPerspective() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};

35
src/Magnum/Trade/Test/ImageDataTest.cpp

@ -172,6 +172,10 @@ namespace GL {
UnsignedInt pixelSize(PixelFormat format, PixelType type) {
CORRADE_INTERNAL_ASSERT(format == PixelFormat::RGB);
CORRADE_INTERNAL_ASSERT(type == PixelType::UnsignedShort);
#ifdef CORRADE_NO_ASSERT
static_cast<void>(format);
static_cast<void>(type);
#endif
return 6;
}
@ -185,6 +189,9 @@ namespace Vk {
UnsignedInt pixelSize(PixelFormat);
UnsignedInt pixelSize(PixelFormat format) {
CORRADE_INTERNAL_ASSERT(format == PixelFormat::R32G32B32F);
#ifdef CORRADE_NO_ASSERT
static_cast<void>(format);
#endif
return 12;
}
@ -566,6 +573,10 @@ void ImageDataTest::constructCompressedImplementationSpecificNotOwned() {
}
void ImageDataTest::constructGenericNotOwnedFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
char data[4*4];
std::ostringstream out;
@ -578,6 +589,10 @@ void ImageDataTest::constructGenericNotOwnedFlagOwned() {
}
void ImageDataTest::constructImplementationSpecificNotOwnedFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
char data[3*12];
std::ostringstream out;
@ -590,6 +605,10 @@ void ImageDataTest::constructImplementationSpecificNotOwnedFlagOwned() {
}
void ImageDataTest::constructCompressedGenericNotOwnedFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
char data[8];
std::ostringstream out;
@ -603,6 +622,10 @@ void ImageDataTest::constructCompressedGenericNotOwnedFlagOwned() {
}
void ImageDataTest::constructCompressedImplementationSpecificNotOwnedFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
char data[8];
std::ostringstream out;
@ -614,6 +637,10 @@ void ImageDataTest::constructCompressedImplementationSpecificNotOwnedFlagOwned()
}
void ImageDataTest::constructInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
@ -927,6 +954,10 @@ void ImageDataTest::dataRvalue() {
}
void ImageDataTest::mutableAccessNotAllowed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const char data[4*4]{};
ImageData2D a{PixelFormat::RGBA8Unorm, {2, 2}, DataFlags{}, data};
@ -1058,6 +1089,10 @@ void ImageDataTest::pixels3D() {
}
void ImageDataTest::pixelsCompressed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Trade::ImageData2D a{CompressedPixelFormat::Bc1RGBAUnorm, {4, 4}, Containers::Array<char>{8}};
std::ostringstream out;

8
src/Magnum/Trade/Test/MaterialDataTest.cpp

@ -152,6 +152,10 @@ void MaterialDataTest::constructPhongTexturedTextureTransform() {
}
void MaterialDataTest::constructPhongTextureTransformNoTextures() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
PhongMaterialData a{PhongMaterialData::Flag::TextureTransformation,
@ -226,6 +230,10 @@ void MaterialDataTest::constructMovePhong() {
}
void MaterialDataTest::accessInvalidTextures() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
PhongMaterialData a{{},
{}, {},
{}, {},

180
src/Magnum/Trade/Test/MeshDataTest.cpp

@ -407,6 +407,10 @@ void MeshDataTest::customAttributeName() {
}
void MeshDataTest::customAttributeNameTooLarge() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
meshAttributeCustom(32768);
@ -414,6 +418,10 @@ void MeshDataTest::customAttributeNameTooLarge() {
}
void MeshDataTest::customAttributeNameNotCustom() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
meshAttributeCustom(MeshAttribute::TextureCoordinates);
@ -477,6 +485,10 @@ void MeshDataTest::constructIndexTypeErased() {
}
void MeshDataTest::constructIndexTypeErasedWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const char indexData[3*2]{};
std::ostringstream out;
@ -505,6 +517,10 @@ void MeshDataTest::constructIndex2D() {
}
void MeshDataTest::constructIndex2DWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const char data[3*3]{};
std::ostringstream out;
@ -514,6 +530,10 @@ void MeshDataTest::constructIndex2DWrongSize() {
}
void MeshDataTest::constructIndex2DNonContiguous() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const char data[3*4]{};
std::ostringstream out;
@ -584,6 +604,10 @@ void MeshDataTest::constructAttribute2D() {
}
void MeshDataTest::constructAttribute2DWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
char positionData[4*sizeof(Vector2)]{};
std::ostringstream out;
@ -595,6 +619,10 @@ void MeshDataTest::constructAttribute2DWrongSize() {
}
void MeshDataTest::constructAttribute2DNonContiguous() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
char positionData[4*sizeof(Vector2)]{};
std::ostringstream out;
@ -687,6 +715,10 @@ void MeshDataTest::constructAttributeImplementationSpecificFormat() {
}
void MeshDataTest::constructAttributeWrongFormat() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Vector2 positionData[3];
std::ostringstream out;
@ -699,6 +731,10 @@ void MeshDataTest::constructAttributeWrongFormat() {
}
void MeshDataTest::constructAttributeWrongStride() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
char positionData[3*sizeof(Vector3)]{};
std::ostringstream out;
@ -719,6 +755,10 @@ void MeshDataTest::constructAttributeWrongStride() {
}
void MeshDataTest::constructAttributeWrongDataAccess() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Vector2 positionData[3];
MeshAttributeData a{MeshAttribute::Position, Containers::arrayView(positionData)};
MeshAttributeData b{MeshAttribute::Position, VertexFormat::Vector2, 0, 3, sizeof(Vector2)};
@ -763,6 +803,10 @@ void MeshDataTest::constructArrayAttribute() {
}
void MeshDataTest::constructArrayAttributeNonContiguous() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Vector2 vertexData[4*3]{};
std::ostringstream out;
@ -786,6 +830,10 @@ void MeshDataTest::constructArrayAttribute2D() {
}
void MeshDataTest::constructArrayAttribute2DWrongSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
char vertexData[3*4*sizeof(Vector2)]{};
std::ostringstream out;
@ -797,6 +845,10 @@ void MeshDataTest::constructArrayAttribute2DWrongSize() {
}
void MeshDataTest::constructArrayAttribute2DNonContiguous() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
char vertexData[4*3*sizeof(Vector2)]{};
std::ostringstream out;
@ -840,6 +892,10 @@ void MeshDataTest::constructArrayAttributeOffsetOnly() {
}
void MeshDataTest::constructArrayAttributeNotAllowed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Vector2 positionData[3*3];
Containers::ArrayView<Vector2> positions{positionData};
Containers::StridedArrayView2D<Vector2> positions2D{positionData, {3, 3}};
@ -1485,6 +1541,10 @@ void MeshDataTest::constructIndexlessAttributelessZeroVertices() {
}
void MeshDataTest::constructIndexDataButNotIndexed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> indexData{6};
std::ostringstream out;
@ -1495,6 +1555,10 @@ void MeshDataTest::constructIndexDataButNotIndexed() {
}
void MeshDataTest::constructAttributelessImplicitVertexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
std::ostringstream out;
Error redirectError{&out};
MeshData{MeshPrimitive::Points, nullptr, {}};
@ -1502,6 +1566,10 @@ void MeshDataTest::constructAttributelessImplicitVertexCount() {
}
void MeshDataTest::constructIndicesNotContained() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> indexData{reinterpret_cast<char*>(0xbadda9), 6, [](char*, std::size_t){}};
Containers::ArrayView<UnsignedShort> indexData2{reinterpret_cast<UnsignedShort*>(0xdead), 3};
MeshIndexData indices{indexData2};
@ -1516,6 +1584,10 @@ void MeshDataTest::constructIndicesNotContained() {
}
void MeshDataTest::constructAttributeNotContained() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{reinterpret_cast<char*>(0xbadda9), 24, [](char*, std::size_t){}};
Containers::ArrayView<Vector2> vertexData2{reinterpret_cast<Vector2*>(0xdead), 3};
MeshAttributeData positions{MeshAttribute::Position, Containers::arrayCast<Vector2>(vertexData)};
@ -1546,6 +1618,10 @@ void MeshDataTest::constructAttributeNotContained() {
}
void MeshDataTest::constructInconsitentVertexCount() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{136};
MeshAttributeData positions{MeshAttribute::Position, Containers::arrayCast<Vector2>(vertexData).prefix(3)};
MeshAttributeData positions2{MeshAttribute::Position, Containers::arrayCast<Vector2>(vertexData).prefix(2)};
@ -1563,6 +1639,10 @@ void MeshDataTest::constructInconsitentVertexCount() {
}
void MeshDataTest::constructNotOwnedIndexFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const UnsignedShort indexData[]{0, 1, 0};
const Vector2 vertexData[]{{0.1f, 0.2f}, {0.4f, 0.5f}};
@ -1577,6 +1657,10 @@ void MeshDataTest::constructNotOwnedIndexFlagOwned() {
}
void MeshDataTest::constructNotOwnedVertexFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const UnsignedShort indexData[]{0, 1, 0};
const Vector2 vertexData[]{{0.1f, 0.2f}, {0.4f, 0.5f}};
@ -1591,6 +1675,10 @@ void MeshDataTest::constructNotOwnedVertexFlagOwned() {
}
void MeshDataTest::constructIndicesNotOwnedFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
UnsignedShort indexData[]{0, 1, 0};
Containers::Array<char> vertexData{2*sizeof(Vector2)};
auto vertexView = Containers::arrayCast<Vector2>(vertexData);
@ -1608,6 +1696,10 @@ void MeshDataTest::constructIndicesNotOwnedFlagOwned() {
}
void MeshDataTest::constructVerticesNotOwnedFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> indexData{3*sizeof(UnsignedShort)};
auto indexView = Containers::arrayCast<UnsignedShort>(indexData);
indexView[0] = 0;
@ -1626,6 +1718,10 @@ void MeshDataTest::constructVerticesNotOwnedFlagOwned() {
}
void MeshDataTest::constructIndexlessNotOwnedFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const Vector2 vertexData[]{{0.1f, 0.2f}, {0.4f, 0.5f}};
MeshAttributeData positions{MeshAttribute::Position, Containers::arrayView(vertexData)};
@ -1637,6 +1733,10 @@ void MeshDataTest::constructIndexlessNotOwnedFlagOwned() {
}
void MeshDataTest::constructAttributelessNotOwnedFlagOwned() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const UnsignedShort indexData[]{0, 1, 0};
MeshIndexData indices{indexData};
@ -1648,6 +1748,10 @@ void MeshDataTest::constructAttributelessNotOwnedFlagOwned() {
}
void MeshDataTest::constructInvalidAttributeData() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
MeshAttributeData a;
MeshAttributeData b{3};
@ -1781,6 +1885,10 @@ template<class T> void MeshDataTest::indicesAsArray() {
}
void MeshDataTest::indicesIntoArrayInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> indexData{3*sizeof(UnsignedInt)};
MeshData data{MeshPrimitive::Points, std::move(indexData), MeshIndexData{Containers::arrayCast<UnsignedInt>(indexData)}, 1};
@ -1873,6 +1981,10 @@ template<class T> void MeshDataTest::positions2DAsArrayPackedSignedNormalized()
}
void MeshDataTest::positions2DIntoArrayInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*sizeof(Vector2)};
MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Position, Containers::arrayCast<Vector2>(vertexData)}}};
@ -1975,6 +2087,10 @@ template<class T> void MeshDataTest::positions3DAsArrayPackedSignedNormalized()
}
void MeshDataTest::positions3DIntoArrayInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*sizeof(Vector3)};
MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Position, Containers::arrayCast<Vector3>(vertexData)}}};
@ -2023,6 +2139,10 @@ template<class T> void MeshDataTest::tangentsAsArrayPackedSignedNormalized() {
}
void MeshDataTest::tangentsIntoArrayInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*sizeof(Vector3)};
MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Tangent, Containers::arrayCast<Vector3>(vertexData)}}};
@ -2069,6 +2189,10 @@ template<class T> void MeshDataTest::bitangentSignsAsArrayPackedSignedNormalized
}
void MeshDataTest::bitangentSignsAsArrayNotFourComponent() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*sizeof(Vector3s)};
MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Tangent, VertexFormat::Vector3sNormalized, Containers::arrayCast<Vector3s>(vertexData)}}};
@ -2081,6 +2205,10 @@ void MeshDataTest::bitangentSignsAsArrayNotFourComponent() {
}
void MeshDataTest::bitangentSignsIntoArrayInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*sizeof(Vector4)};
MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Tangent, Containers::arrayCast<Vector4>(vertexData)}}};
@ -2128,6 +2256,10 @@ template<class T> void MeshDataTest::bitangentsAsArrayPackedSignedNormalized() {
}
void MeshDataTest::bitangentsIntoArrayInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*sizeof(Vector3)};
MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Bitangent, Containers::arrayCast<Vector3>(vertexData)}}};
@ -2175,6 +2307,10 @@ template<class T> void MeshDataTest::normalsAsArrayPackedSignedNormalized() {
}
void MeshDataTest::normalsIntoArrayInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*sizeof(Vector3)};
MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Normal, Containers::arrayCast<Vector3>(vertexData)}}};
@ -2267,6 +2403,10 @@ template<class T> void MeshDataTest::textureCoordinates2DAsArrayPackedSignedNorm
}
void MeshDataTest::textureCoordinates2DIntoArrayInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*sizeof(Vector2)};
MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::TextureCoordinates, Containers::arrayCast<Vector2>(vertexData)}}};
@ -2312,6 +2452,10 @@ template<class T> void MeshDataTest::colorsAsArrayPackedUnsignedNormalized() {
}
void MeshDataTest::colorsIntoArrayInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*sizeof(Color4)};
MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Color, Containers::arrayCast<Color4>(vertexData)}}};
@ -2341,6 +2485,10 @@ template<class T> void MeshDataTest::objectIdsAsArray() {
}
void MeshDataTest::objectIdsIntoArrayInvalidSize() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{3*sizeof(UnsignedInt)};
MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::ObjectId, Containers::arrayCast<UnsignedInt>(vertexData)}}};
@ -2400,6 +2548,10 @@ void MeshDataTest::implementationSpecificVertexFormat() {
}
void MeshDataTest::implementationSpecificVertexFormatWrongAccess() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
VertexWithImplementationSpecificData vertexData[] {
{456.0l},
{456.0l}
@ -2463,6 +2615,10 @@ void MeshDataTest::implementationSpecificVertexFormatWrongAccess() {
}
void MeshDataTest::implementationSpecificVertexFormatNotContained() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> vertexData{reinterpret_cast<char*>(0xbadda9), 3, [](char*, std::size_t){}};
Containers::ArrayView<char> vertexData2{reinterpret_cast<char*>(0xdead), 3};
MeshAttributeData positions{MeshAttribute::Position, vertexFormatWrap(0x3a), vertexData};
@ -2536,6 +2692,10 @@ void MeshDataTest::arrayAttribute() {
}
void MeshDataTest::arrayAttributeWrongAccess() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Vector2 vertexData[3*4]{
{1.0f, 2.0f}, {3.0f, 4.0f}, {5.0f, 6.0f}, {7.0f, 8.0f},
{1.1f, 2.2f}, {3.3f, 4.4f}, {5.5f, 6.6f}, {7.7f, 8.8f},
@ -2571,6 +2731,10 @@ void MeshDataTest::arrayAttributeWrongAccess() {
}
void MeshDataTest::mutableAccessNotAllowed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
const UnsignedShort indexData[]{0, 1, 0};
const Vector2 vertexData[]{{0.1f, 0.2f}, {0.4f, 0.5f}};
@ -2602,6 +2766,10 @@ void MeshDataTest::mutableAccessNotAllowed() {
}
void MeshDataTest::indicesNotIndexed() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
MeshData data{MeshPrimitive::Triangles, 37};
std::ostringstream out;
@ -2625,6 +2793,10 @@ void MeshDataTest::indicesNotIndexed() {
}
void MeshDataTest::indicesWrongType() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
Containers::Array<char> indexData{sizeof(UnsignedShort)};
auto indexView = Containers::arrayCast<UnsignedShort>(indexData);
indexView[0] = 57616;
@ -2637,6 +2809,10 @@ void MeshDataTest::indicesWrongType() {
}
void MeshDataTest::attributeNotFound() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
MeshAttributeData colors1{MeshAttribute::Color, VertexFormat::Vector3, nullptr};
MeshAttributeData colors2{MeshAttribute::Color, VertexFormat::Vector4, nullptr};
MeshData data{MeshPrimitive::Points, nullptr, {colors1, colors2}};
@ -2707,6 +2883,10 @@ void MeshDataTest::attributeNotFound() {
}
void MeshDataTest::attributeWrongType() {
#ifdef CORRADE_NO_ASSERT
CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions");
#endif
MeshAttributeData positions{MeshAttribute::Position, VertexFormat::Vector3, nullptr};
MeshData data{MeshPrimitive::Points, nullptr, {positions}};

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save