diff --git a/src/Magnum/Animation/Test/InterpolationTest.cpp b/src/Magnum/Animation/Test/InterpolationTest.cpp index f6e99527d..443a9921f 100644 --- a/src/Magnum/Animation/Test/InterpolationTest.cpp +++ b/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(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(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>(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(Interpolation::Constant)(a, b, 0.8f), 3.0f); CORRADE_COMPARE(Animation::interpolatorFor(Interpolation::Linear)(a, b, 0.8f), -1.0f); CORRADE_COMPARE(Animation::interpolatorFor(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(Interpolation::Constant)(a, b, 0.8f), (Vector2{3.0f, 0.1f})); CORRADE_COMPARE(Animation::interpolatorFor(Interpolation::Linear)(a, b, 0.8f), (Vector2{-1.0f, 0.9f})); CORRADE_COMPARE(Animation::interpolatorFor(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(Interpolation::Constant)(a, b, 0.8f), (Complex{0.999445f, 0.0333148f})); CORRADE_COMPARE(Animation::interpolatorFor(Interpolation::Linear)(a, b, 0.8f), (Complex{-0.78747f, 0.616353f})); CORRADE_COMPARE(Animation::interpolatorFor(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(Interpolation::Constant)(a, b, 0.8f), (Quaternion{{0.780076f, 0.0260025f, 0.598059f}, 0.182018f})); CORRADE_COMPARE(Animation::interpolatorFor(Interpolation::Linear)(a, b, 0.8f), (Quaternion{{-0.533196f, 0.410685f, 0.521583f}, 0.524396f})); CORRADE_COMPARE(Animation::interpolatorFor(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}; diff --git a/src/Magnum/Animation/Test/PlayerTest.cpp b/src/Magnum/Animation/Test/PlayerTest.cpp index 2488a90d0..3b4ffeec8 100644 --- a/src/Magnum/Animation/Test/PlayerTest.cpp +++ b/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}; diff --git a/src/Magnum/Audio/AbstractImporter.cpp b/src/Magnum/Audio/AbstractImporter.cpp index 39052d1bb..3738d6fa3 100644 --- a/src/Magnum/Audio/AbstractImporter.cpp +++ b/src/Magnum/Audio/AbstractImporter.cpp @@ -90,7 +90,7 @@ bool AbstractImporter::openData(Containers::ArrayView data) { } void AbstractImporter::doOpenData(Containers::ArrayView) { - 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) { diff --git a/src/Magnum/Audio/Test/AbstractImporterTest.cpp b/src/Magnum/Audio/Test/AbstractImporterTest.cpp index 98f72c30f..9e24c35ec 100644 --- a/src/Magnum/Audio/Test/AbstractImporterTest.cpp +++ b/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; } diff --git a/src/Magnum/DebugTools/CompareImage.cpp b/src/Magnum/DebugTools/CompareImage.cpp index 0584210df..3d5b6a51f 100644 --- a/src/Magnum/DebugTools/CompareImage.cpp +++ b/src/Magnum/DebugTools/CompareImage.cpp @@ -99,6 +99,9 @@ std::tuple, 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(actualFormat); + #endif CORRADE_ASSERT(!isPixelFormatImplementationSpecific(expected.format()), "DebugTools::CompareImage: can't compare implementation-specific pixel formats", {}); @@ -167,8 +170,7 @@ std::tuple, 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(flags); + #endif out << "deltas" << _state->max << Debug::nospace << "/" << Debug::nospace << _state->mean << "below threshold" << _state->maxThreshold << Debug::nospace << "/" diff --git a/src/Magnum/DebugTools/Test/CompareImageTest.cpp b/src/Magnum/DebugTools/Test/CompareImageTest.cpp index ccd0c12bb..b63c0191c 100644 --- a/src/Magnum/DebugTools/Test/CompareImageTest.cpp +++ b/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 } diff --git a/src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp b/src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp index 7707e8cdb..f3c9c9081 100644 --- a/src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp +++ b/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 } diff --git a/src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp b/src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp index f69f06ef6..f08b2233c 100644 --- a/src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp +++ b/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 } diff --git a/src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp b/src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp index c4e0b72e9..9e7698ec1 100644 --- a/src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp +++ b/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 } diff --git a/src/Magnum/DebugTools/TextureImage.cpp b/src/Magnum/DebugTools/TextureImage.cpp index dc56c2485..f0d6b3ffb 100644 --- a/src/Magnum/DebugTools/TextureImage.cpp +++ b/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; diff --git a/src/Magnum/GL/AbstractTexture.cpp b/src/Magnum/GL/AbstractTexture.cpp index 0b75ca76b..8d883cd8e 100644 --- a/src/Magnum/GL/AbstractTexture.cpp +++ b/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 void AbstractTexture::compressedSubImage(const GLint level, const RangeTypeFor& range, const BasicMutableCompressedImageView& image) { - #ifndef CORRADE_NO_ASSERT CORRADE_ASSERT(image.data().data() != nullptr || !(Math::Vector(range.size()).product()), "GL::AbstractTexture::compressedSubImage(): image view is nullptr", ); CORRADE_ASSERT(image.size() == range.size(), @@ -1985,6 +1984,7 @@ template void AbstractTexture::compressedSubImage(const const Math::Vector size = range.size(); + #ifndef CORRADE_NO_ASSERT /* Internal texture format */ GLint format; (this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format); diff --git a/src/Magnum/GL/Attribute.cpp b/src/Magnum/GL/Attribute.cpp index 6f7b0d17c..0cf162e6d 100644 --- a/src/Magnum/GL/Attribute.cpp +++ b/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 */ diff --git a/src/Magnum/GL/CubeMapTexture.cpp b/src/Magnum/GL/CubeMapTexture.cpp index d258c50ce..978eca583 100644 --- a/src/Magnum/GL/CubeMapTexture.cpp +++ b/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; diff --git a/src/Magnum/GL/Mesh.cpp b/src/Magnum/GL/Mesh.cpp index bd622b2e0..ce5920145 100644 --- a/src/Magnum/GL/Mesh.cpp +++ b/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(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(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 */ diff --git a/src/Magnum/GL/PixelFormat.cpp b/src/Magnum/GL/PixelFormat.cpp index e8772651d..4d574a152 100644 --- a/src/Magnum/GL/PixelFormat.cpp +++ b/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 diff --git a/src/Magnum/GL/PixelFormat.h b/src/Magnum/GL/PixelFormat.h index 81f45d16a..94769e4fd 100644 --- a/src/Magnum/GL/PixelFormat.h +++ b/src/Magnum/GL/PixelFormat.h @@ -35,6 +35,10 @@ #include "Magnum/GL/OpenGL.h" #include "Magnum/GL/visibility.h" +#ifdef MAGNUM_BUILD_DEPRECATED +#include +#endif + namespace Magnum { namespace GL { /** diff --git a/src/Magnum/GL/Shader.cpp b/src/Magnum/GL/Shader.cpp index 525907fe6..12429dd65 100644 --- a/src/Magnum/GL/Shader.cpp +++ b/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() { diff --git a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp index 0c6122d74..f39a856b1 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp +++ b/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(); diff --git a/src/Magnum/GL/Test/AbstractTextureGLTest.cpp b/src/Magnum/GL/Test/AbstractTextureGLTest.cpp index 4944ca7c4..705ee92d2 100644 --- a/src/Magnum/GL/Test/AbstractTextureGLTest.cpp +++ b/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()) 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()) 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()) 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()) 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()) 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()) CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); if(!Context::current().isExtensionSupported()) @@ -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()) CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); if(!Context::current().isExtensionSupported()) @@ -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()) CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); if(!Context::current().isExtensionSupported()) @@ -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()) CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/GL/Test/AttributeTest.cpp b/src/Magnum/GL/Test/AttributeTest.cpp index 72751aacb..bae10f9d8 100644 --- a/src/Magnum/GL/Test/AttributeTest.cpp +++ b/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}; diff --git a/src/Magnum/GL/Test/BufferImageGLTest.cpp b/src/Magnum/GL/Test/BufferImageGLTest.cpp index 9e098a10c..7f9638325 100644 --- a/src/Magnum/GL/Test/BufferImageGLTest.cpp +++ b/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}; diff --git a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp index 60be71582..5d41e9aad 100644 --- a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp +++ b/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()) 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()) 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()) 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()) 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()) 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()) 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()) 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()) 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()) 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()) 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()) 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()) CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); diff --git a/src/Magnum/GL/Test/FramebufferGLTest.cpp b/src/Magnum/GL/Test/FramebufferGLTest.cpp index e0c17596f..39df1ee17 100644 --- a/src/Magnum/GL/Test/FramebufferGLTest.cpp +++ b/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()) 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()) CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); diff --git a/src/Magnum/GL/Test/MeshGLTest.cpp b/src/Magnum/GL/Test/MeshGLTest.cpp index 64e628046..17bee35e4 100644 --- a/src/Magnum/GL/Test/MeshGLTest.cpp +++ b/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; diff --git a/src/Magnum/GL/Test/MeshTest.cpp b/src/Magnum/GL/Test/MeshTest.cpp index 38505e1bf..383c66e68 100644 --- a/src/Magnum/GL/Test/MeshTest.cpp +++ b/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}; diff --git a/src/Magnum/GL/Test/PixelFormatTest.cpp b/src/Magnum/GL/Test/PixelFormatTest.cpp index 4f06e26bb..948bd0789 100644 --- a/src/Magnum/GL/Test/PixelFormatTest.cpp +++ b/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}; diff --git a/src/Magnum/GL/Test/RendererGLTest.cpp b/src/Magnum/GL/Test/RendererGLTest.cpp index 37aa595c8..166cb6e2e 100644 --- a/src/Magnum/GL/Test/RendererGLTest.cpp +++ b/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 diff --git a/src/Magnum/GL/Test/SamplerTest.cpp b/src/Magnum/GL/Test/SamplerTest.cpp index 1b31d5701..e286274cb 100644 --- a/src/Magnum/GL/Test/SamplerTest.cpp +++ b/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}; diff --git a/src/Magnum/Math/Test/ComplexTest.cpp b/src/Magnum/Math/Test/ComplexTest.cpp index 3dc6e55b4..0a3bee9f5 100644 --- a/src/Magnum/Math/Test/ComplexTest.cpp +++ b/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}; diff --git a/src/Magnum/Math/Test/CubicHermiteTest.cpp b/src/Magnum/Math/Test/CubicHermiteTest.cpp index b811a46f8..319e09d23 100644 --- a/src/Magnum/Math/Test/CubicHermiteTest.cpp +++ b/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}; diff --git a/src/Magnum/Math/Test/DistanceTest.cpp b/src/Magnum/Math/Test/DistanceTest.cpp index e78e3c8a8..632573f83 100644 --- a/src/Magnum/Math/Test/DistanceTest.cpp +++ b/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}; diff --git a/src/Magnum/Math/Test/DualComplexTest.cpp b/src/Magnum/Math/Test/DualComplexTest.cpp index b08338137..900d2fb5e 100644 --- a/src/Magnum/Math/Test/DualComplexTest.cpp +++ b/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}; diff --git a/src/Magnum/Math/Test/DualQuaternionTest.cpp b/src/Magnum/Math/Test/DualQuaternionTest.cpp index f0670e68d..f6dfd440f 100644 --- a/src/Magnum/Math/Test/DualQuaternionTest.cpp +++ b/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}; diff --git a/src/Magnum/Math/Test/FrustumTest.cpp b/src/Magnum/Math/Test/FrustumTest.cpp index 2bbe7917e..b8903a7c8 100644 --- a/src/Magnum/Math/Test/FrustumTest.cpp +++ b/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; diff --git a/src/Magnum/Math/Test/FunctionsTest.cpp b/src/Magnum/Math/Test/FunctionsTest.cpp index 5c080839d..eb24d12c9 100644 --- a/src/Magnum/Math/Test/FunctionsTest.cpp +++ b/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); diff --git a/src/Magnum/Math/Test/InterpolationBenchmark.cpp b/src/Magnum/Math/Test/InterpolationBenchmark.cpp index fb6c2fe38..8720b66ef 100644 --- a/src/Magnum/Math/Test/InterpolationBenchmark.cpp +++ b/src/Magnum/Math/Test/InterpolationBenchmark.cpp @@ -25,7 +25,10 @@ #include +#ifndef CORRADE_NO_ASSERT #define CORRADE_NO_ASSERT +#endif + #include "Magnum/Math/DualQuaternion.h" namespace Magnum { namespace Math { namespace Test { namespace { diff --git a/src/Magnum/Math/Test/IntersectionTest.cpp b/src/Magnum/Math/Test/IntersectionTest.cpp index d2e60b8b0..0163fdd2a 100644 --- a/src/Magnum/Math/Test/IntersectionTest.cpp +++ b/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}; diff --git a/src/Magnum/Math/Test/Matrix3Test.cpp b/src/Magnum/Math/Test/Matrix3Test.cpp index 3f008b687..875532094 100644 --- a/src/Magnum/Math/Test/Matrix3Test.cpp +++ b/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(); diff --git a/src/Magnum/Math/Test/Matrix4Test.cpp b/src/Magnum/Math/Test/Matrix4Test.cpp index 3feb71379..4fa808a52 100644 --- a/src/Magnum/Math/Test/Matrix4Test.cpp +++ b/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}; diff --git a/src/Magnum/Math/Test/MatrixTest.cpp b/src/Magnum/Math/Test/MatrixTest.cpp index a8c848d40..ac5f5f94f 100644 --- a/src/Magnum/Math/Test/MatrixTest.cpp +++ b/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}; diff --git a/src/Magnum/Math/Test/PackingBatchTest.cpp b/src/Magnum/Math/Test/PackingBatchTest.cpp index 3ee15cda4..e9a26e00f 100644 --- a/src/Magnum/Math/Test/PackingBatchTest.cpp +++ b/src/Magnum/Math/Test/PackingBatchTest.cpp @@ -575,6 +575,10 @@ template void PackingBatchTest::castSignedInteger() { } template void PackingBatchTest::assertionsPackUnpack() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Math::Vector2 data[2]{}; Vector2 resultWrongCount[1]{}; Vector3 resultWrongVectorSize[2]{}; @@ -607,6 +611,10 @@ template 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 void PackingBatchTest::assertionsCast() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + setTestCaseTemplateName(Corrade::Utility::formatString("{}, {}", TypeTraits::name(), TypeTraits::name())); Math::Vector2 data[2]{}; diff --git a/src/Magnum/Math/Test/QuaternionTest.cpp b/src/Magnum/Math/Test/QuaternionTest.cpp index 82d223e4e..7062b4b7f 100644 --- a/src/Magnum/Math/Test/QuaternionTest.cpp +++ b/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 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}; diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index 7c1ffcce9..f2835ac04 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/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}); diff --git a/src/Magnum/MeshTools/CompressIndices.cpp b/src/Magnum/MeshTools/CompressIndices.cpp index 96460fb50..c5579588b 100644 --- a/src/Magnum/MeshTools/CompressIndices.cpp +++ b/src/Magnum/MeshTools/CompressIndices.cpp @@ -183,7 +183,7 @@ std::tuple, MeshIndexType, UnsignedInt, UnsignedInt> com } template Containers::Array compressIndicesAs(const std::vector& 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 diff --git a/src/Magnum/MeshTools/GenerateIndices.cpp b/src/Magnum/MeshTools/GenerateIndices.cpp index 02bc409fb..1c6ebdcce 100644 --- a/src/Magnum/MeshTools/GenerateIndices.cpp +++ b/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& indices) { @@ -214,8 +213,7 @@ Trade::MeshData generateIndices(Trade::MeshData&& data) { primitive = MeshPrimitive::Triangles; indexData = Containers::Array{Containers::NoInit, 3*(vertexCount - 2)*sizeof(UnsignedInt)}; generateTriangleFanIndicesInto(vertexCount, Containers::arrayCast(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}; diff --git a/src/Magnum/MeshTools/Interleave.h b/src/Magnum/MeshTools/Interleave.h index 9c73e64c8..ccf8ec0ff 100644 --- a/src/Magnum/MeshTools/Interleave.h +++ b/src/Magnum/MeshTools/Interleave.h @@ -48,7 +48,7 @@ namespace Implementation { cyclic dependencies) */ struct AttributeCount { template typename std::enable_if::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 void interleaveInto(Containers::ArrayView 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...); diff --git a/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp b/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp index 24fe08f98..b4b2adfb2 100644 --- a/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp +++ b/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 a{0, 1, 0}; diff --git a/src/Magnum/MeshTools/Test/CombineTest.cpp b/src/Magnum/MeshTools/Test/CombineTest.cpp index 622ffcff1..9d2763234 100644 --- a/src/Magnum/MeshTools/Test/CombineTest.cpp +++ b/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}, { diff --git a/src/Magnum/MeshTools/Test/CompileGLTest.cpp b/src/Magnum/MeshTools/Test/CompileGLTest.cpp index 2705aa263..d93c57338 100644 --- a/src/Magnum/MeshTools/Test/CompileGLTest.cpp +++ b/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}, diff --git a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp index 655417594..00bd59df4 100644 --- a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp +++ b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp @@ -205,6 +205,10 @@ template 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({123, 456}), Containers::arrayView({123, 456}), diff --git a/src/Magnum/MeshTools/Test/ConcatenateTest.cpp b/src/Magnum/MeshTools/Test/ConcatenateTest.cpp index 393a4ce85..287877d3e 100644 --- a/src/Magnum/MeshTools/Test/ConcatenateTest.cpp +++ b/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; diff --git a/src/Magnum/MeshTools/Test/DuplicateTest.cpp b/src/Magnum/MeshTools/Test/DuplicateTest.cpp index 8f638a942..5a06bf0a5 100644 --- a/src/Magnum/MeshTools/Test/DuplicateTest.cpp +++ b/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 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 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 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}; diff --git a/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp b/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp index 626aa6040..a7782b981 100644 --- a/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp +++ b/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}; diff --git a/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp b/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp index bf8ed0a6b..d7a4c6734 100644 --- a/src/Magnum/MeshTools/Test/GenerateIndicesTest.cpp +++ b/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; diff --git a/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp b/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp index 38bbd3892..b60ea4ae2 100644 --- a/src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp +++ b/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 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]; diff --git a/src/Magnum/MeshTools/Test/InterleaveTest.cpp b/src/Magnum/MeshTools/Test/InterleaveTest.cpp index 383a80af1..86d40ef06 100644 --- a/src/Magnum/MeshTools/Test/InterleaveTest.cpp +++ b/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{0, 1, 2}, - std::vector{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{0, 1, 2}, std::vector{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{0, 1, 2}, + std::vector{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()), std::size_t(1)); CORRADE_COMPARE(Implementation::Stride{}(std::vector()), 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 vertexData{100 + 3*20}; Trade::MeshAttributeData positions{Trade::MeshAttribute::Position, Containers::arrayCast(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 vertexData{3*12}; Trade::MeshAttributeData positions{Trade::MeshAttribute::Position, Containers::StridedArrayView1D{vertexData, reinterpret_cast(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; diff --git a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp index 64a6cba7c..aa96b29f4 100644 --- a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp +++ b/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 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 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}; diff --git a/src/Magnum/MeshTools/Test/SubdivideTest.cpp b/src/Magnum/MeshTools/Test/SubdivideTest.cpp index f6f804a51..3f878899b 100644 --- a/src/Magnum/MeshTools/Test/SubdivideTest.cpp +++ b/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 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}; diff --git a/src/Magnum/PixelFormat.cpp b/src/Magnum/PixelFormat.cpp index 04c379065..7757cf9c0 100644 --- a/src/Magnum/PixelFormat.cpp +++ b/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 { diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index a58e3fa95..6d30f2233 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -289,7 +289,7 @@ void GlfwApplication::setWindowIcon(std::initializer_list images) { else if(image.format() == PixelFormat::RGBA8Snorm || image.format() == PixelFormat::RGBA8Unorm) packPixels(image.pixels(), 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(); diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index b4e75d4d7..b0e2f0e11 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/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(enabled); #endif } diff --git a/src/Magnum/Primitives/Implementation/Spheroid.h b/src/Magnum/Primitives/Implementation/Spheroid.h index da30b12fa..06fb462a0 100644 --- a/src/Magnum/Primitives/Implementation/Spheroid.h +++ b/src/Magnum/Primitives/Implementation/Spheroid.h @@ -26,6 +26,7 @@ */ #include +#include #include #include "Magnum/Magnum.h" diff --git a/src/Magnum/SceneGraph/Object.hpp b/src/Magnum/SceneGraph/Object.hpp index c6c4b071e..1b8535295 100644 --- a/src/Magnum/SceneGraph/Object.hpp +++ b/src/Magnum/SceneGraph/Object.hpp @@ -220,7 +220,7 @@ template std::vector Ob } std::vector>> jointObjects(objects); - #if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT) + #ifndef CORRADE_NO_ASSERT /* Scene object */ const Scene* scene = this->scene(); #endif diff --git a/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp b/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp index 5fe7ca870..5dd7e7c4b 100644 --- a/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp +++ b/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; diff --git a/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp b/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp index 2e8dc9005..5fdbfb681 100644 --- a/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp +++ b/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::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::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::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; diff --git a/src/Magnum/SceneGraph/Test/ObjectTest.cpp b/src/Magnum/SceneGraph/Test/ObjectTest.cpp index 606949657..9a6152837 100644 --- a/src/Magnum/SceneGraph/Test/ObjectTest.cpp +++ b/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}; diff --git a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp index 8798580f6..40b6c6c30 100644 --- a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp +++ b/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::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::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::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::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; diff --git a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp index e97a16ecb..9bfc22496 100644 --- a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp +++ b/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::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::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::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; diff --git a/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp b/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp index 8438d0f55..f4ab4bc3c 100644 --- a/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp +++ b/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::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::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::fromMatrix(Matrix3::translation(v)), v); } void TranslationTransformationTest::toMatrix() { diff --git a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp index 7e6b7a674..c65b984f6 100644 --- a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp +++ b/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 void DistanceFieldVectorGLTest::constructMove() template 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}; diff --git a/src/Magnum/Shaders/Test/FlatGLTest.cpp b/src/Magnum/Shaders/Test/FlatGLTest.cpp index 6355f4968..ac784ca76 100644 --- a/src/Magnum/Shaders/Test/FlatGLTest.cpp +++ b/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 void FlatGLTest::constructMove() { template 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{Flat::Flag::TextureTransformation}; @@ -350,6 +354,10 @@ template void FlatGLTest::constructTextureTransformation template 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 void FlatGLTest::bindTextureNotEnabled() { template 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 void FlatGLTest::setAlphaMaskNotEnabled() { template 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 void FlatGLTest::setTextureMatrixNotEnabled() { template 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}; diff --git a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp index 208f38470..093b346c0 100644 --- a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp +++ b/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()) 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()) 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()) CORRADE_SKIP(GL::Extensions::ARB::geometry_shader4::string() + std::string(" is not supported")); diff --git a/src/Magnum/Shaders/Test/PhongGLTest.cpp b/src/Magnum/Shaders/Test/PhongGLTest.cpp index 59b20b029..bf67b8287 100644 --- a/src/Magnum/Shaders/Test/PhongGLTest.cpp +++ b/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}; diff --git a/src/Magnum/Shaders/Test/VectorGLTest.cpp b/src/Magnum/Shaders/Test/VectorGLTest.cpp index 38af67072..1dacc53a4 100644 --- a/src/Magnum/Shaders/Test/VectorGLTest.cpp +++ b/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 void VectorGLTest::constructMove() { template 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}; diff --git a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp index a747be32f..1d18fb611 100644 --- a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp +++ b/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 diff --git a/src/Magnum/Test/ImageTest.cpp b/src/Magnum/Test/ImageTest.cpp index 64256f6dc..b192d8480 100644 --- a/src/Magnum/Test/ImageTest.cpp +++ b/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(format); + static_cast(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(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}; diff --git a/src/Magnum/Test/ImageViewTest.cpp b/src/Magnum/Test/ImageViewTest.cpp index d835439f0..231e5e2dd 100644 --- a/src/Magnum/Test/ImageViewTest.cpp +++ b/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(format); + static_cast(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(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 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}; diff --git a/src/Magnum/Test/MeshTest.cpp b/src/Magnum/Test/MeshTest.cpp index 10e2d9bf4..12ba2fdf6 100644 --- a/src/Magnum/Test/MeshTest.cpp +++ b/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}; diff --git a/src/Magnum/Test/PixelFormatTest.cpp b/src/Magnum/Test/PixelFormatTest.cpp index a0d56c5b1..425ccffce 100644 --- a/src/Magnum/Test/PixelFormatTest.cpp +++ b/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}; diff --git a/src/Magnum/Test/ResourceManagerTest.cpp b/src/Magnum/Test/ResourceManagerTest.cpp index 9e0dfed69..abc87c660 100644 --- a/src/Magnum/Test/ResourceManagerTest.cpp +++ b/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(), 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 theAnswer = rm.get(answerKey); + CORRADE_COMPARE(theAnswer.state(), ResourceState::Final); + CORRADE_COMPARE(*theAnswer, 42); + CORRADE_COMPARE(rm.count(), 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; diff --git a/src/Magnum/Test/VertexFormatTest.cpp b/src/Magnum/Test/VertexFormatTest.cpp index 71c6669a8..83da93c1b 100644 --- a/src/Magnum/Test/VertexFormatTest.cpp +++ b/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); diff --git a/src/Magnum/Text/AbstractFont.cpp b/src/Magnum/Text/AbstractFont.cpp index 404f17b63..d2e590454 100644 --- a/src/Magnum/Text/AbstractFont.cpp +++ b/src/Magnum/Text/AbstractFont.cpp @@ -112,8 +112,7 @@ bool AbstractFont::openData(Containers::ArrayView data, const Float } auto AbstractFont::doOpenData(Containers::ArrayView, 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 AbstractFont::createGlyphCache() { @@ -268,8 +267,7 @@ Containers::Pointer AbstractFont::createGlyphCache() { } Containers::Pointer 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 AbstractFont::layout(const AbstractGlyphCache& cache, const Float size, const std::string& text) { diff --git a/src/Magnum/Text/AbstractFontConverter.cpp b/src/Magnum/Text/AbstractFontConverter.cpp index c8e12b0ec..24e219eae 100644 --- a/src/Magnum/Text/AbstractFontConverter.cpp +++ b/src/Magnum/Text/AbstractFontConverter.cpp @@ -124,9 +124,7 @@ Containers::Array AbstractFontConverter::exportFontToSingleData(AbstractFo } Containers::Array 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 AbstractFontConverter::exportGlyphCacheToSingleData(Abst } Containers::Array 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 AbstractFontConverter::importGlyphCacheF } Containers::Pointer AbstractFontConverter::doImportGlyphCacheFromSingleData(Containers::ArrayView) 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 AbstractFontConverter::importGlyphCacheFromFile(const std::string& filename) const { diff --git a/src/Magnum/Text/AbstractGlyphCache.cpp b/src/Magnum/Text/AbstractGlyphCache.cpp index 4cac1e850..22894eb8c 100644 --- a/src/Magnum/Text/AbstractGlyphCache.cpp +++ b/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}); } }} diff --git a/src/Magnum/Text/DistanceFieldGlyphCache.cpp b/src/Magnum/Text/DistanceFieldGlyphCache.cpp index 00ebe46de..2c62c1b85 100644 --- a/src/Magnum/Text/DistanceFieldGlyphCache.cpp +++ b/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, ); diff --git a/src/Magnum/Text/Test/AbstractFontTest.cpp b/src/Magnum/Text/Test/AbstractFontTest.cpp index 329cc03b4..902736757 100644 --- a/src/Magnum/Text/Test/AbstractFontTest.cpp +++ b/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; } diff --git a/src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp b/src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp index c22459c42..1d6e95cd9 100644 --- a/src/Magnum/Text/Test/AbstractGlyphCacheTest.cpp +++ b/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; diff --git a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp index 3611c9e47..4c88b08cc 100644 --- a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp +++ b/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 diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index 718e4c3e6..6501e614a 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -95,7 +95,7 @@ Containers::Optional AbstractImageConverter::exportToImage(const ImageV } Containers::Optional 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 AbstractImageConverter::exportToCompressedImage(const ImageView2D& image) { @@ -108,7 +108,7 @@ Containers::Optional AbstractImageConverter::exportToCompress } Containers::Optional 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 AbstractImageConverter::exportToData(const ImageView2D& image) { @@ -121,7 +121,7 @@ Containers::Array AbstractImageConverter::exportToData(const ImageView2D& } Containers::Array 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 AbstractImageConverter::exportToData(const CompressedImageView2D& image) { @@ -134,7 +134,7 @@ Containers::Array AbstractImageConverter::exportToData(const CompressedIma } Containers::Array 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 AbstractImageConverter::exportToData(const ImageData2D& image) { diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index d9734a1c9..ff618d1e6 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -125,7 +125,7 @@ bool AbstractImporter::openData(Containers::ArrayView data) { } void AbstractImporter::doOpenData(Containers::ArrayView) { - 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 AbstractImporter::scene(const UnsignedInt id) { } Containers::Optional AbstractImporter::doScene(UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::scene(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::scene(): not implemented", {}); } Containers::Optional AbstractImporter::scene(const std::string& name) { @@ -292,7 +292,7 @@ Containers::Optional AbstractImporter::animation(const UnsignedIn } Containers::Optional AbstractImporter::doAnimation(UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::animation(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::animation(): not implemented", {}); } Containers::Optional AbstractImporter::animation(const std::string& name) { @@ -334,7 +334,7 @@ Containers::Optional AbstractImporter::light(const UnsignedInt id) { } Containers::Optional AbstractImporter::doLight(UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::light(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::light(): not implemented", {}); } Containers::Optional AbstractImporter::light(const std::string& name) { @@ -376,7 +376,7 @@ Containers::Optional AbstractImporter::camera(const UnsignedInt id) } Containers::Optional AbstractImporter::doCamera(UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::camera(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::camera(): not implemented", {}); } Containers::Optional AbstractImporter::camera(const std::string& name) { @@ -418,7 +418,7 @@ Containers::Pointer AbstractImporter::object2D(const UnsignedInt i } Containers::Pointer AbstractImporter::doObject2D(UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::object2D(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::object2D(): not implemented", {}); } Containers::Pointer AbstractImporter::object2D(const std::string& name) { @@ -460,7 +460,7 @@ Containers::Pointer AbstractImporter::object3D(const UnsignedInt i } Containers::Pointer AbstractImporter::doObject3D(UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::object3D(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::object3D(): not implemented", {}); } Containers::Pointer AbstractImporter::object3D(const std::string& name) { @@ -529,7 +529,7 @@ Containers::Optional AbstractImporter::mesh(const UnsignedInt id, cons } Containers::Optional AbstractImporter::doMesh(UnsignedInt, UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::mesh(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::mesh(): not implemented", {}); } Containers::Optional AbstractImporter::mesh(const std::string& name, const UnsignedInt level) { @@ -598,7 +598,7 @@ Containers::Optional AbstractImporter::mesh2D(const UnsignedInt id) } Containers::Optional 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 AbstractImporter::material(const Unsig } Containers::Pointer AbstractImporter::doMaterial(UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::material(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::material(): not implemented", {}); } Containers::Pointer AbstractImporter::material(const std::string& name) { @@ -722,7 +722,7 @@ Containers::Optional AbstractImporter::texture(const UnsignedInt id } Containers::Optional AbstractImporter::doTexture(UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::texture(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::texture(): not implemented", {}); } Containers::Optional AbstractImporter::texture(const std::string& name) { @@ -788,7 +788,7 @@ Containers::Optional AbstractImporter::image1D(const UnsignedInt id } Containers::Optional AbstractImporter::doImage1D(UnsignedInt, UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::image1D(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::image1D(): not implemented", {}); } Containers::Optional AbstractImporter::image1D(const std::string& name, const UnsignedInt level) { @@ -855,7 +855,7 @@ Containers::Optional AbstractImporter::image2D(const UnsignedInt id } Containers::Optional AbstractImporter::doImage2D(UnsignedInt, UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::image2D(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::image2D(): not implemented", {}); } Containers::Optional AbstractImporter::image2D(const std::string& name, const UnsignedInt level) { @@ -922,7 +922,7 @@ Containers::Optional AbstractImporter::image3D(const UnsignedInt id } Containers::Optional AbstractImporter::doImage3D(UnsignedInt, UnsignedInt) { - CORRADE_ASSERT(false, "Trade::AbstractImporter::image3D(): not implemented", {}); + CORRADE_ASSERT_UNREACHABLE("Trade::AbstractImporter::image3D(): not implemented", {}); } Containers::Optional AbstractImporter::image3D(const std::string& name, const UnsignedInt level) { diff --git a/src/Magnum/Trade/AnimationData.h b/src/Magnum/Trade/AnimationData.h index 50f7b51de..c186e4f43 100644 --- a/src/Magnum/Trade/AnimationData.h +++ b/src/Magnum/Trade/AnimationData.h @@ -601,7 +601,6 @@ plugin binary to avoid dangling function pointers on plugin unload. */ template> 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 constexpr AnimationTrackType animationTypeFor(); @@ -649,7 +648,6 @@ namespace Implementation { template<> constexpr AnimationTrackType animationTypeFor() { return AnimationTrackType::CubicHermiteQuaternion; } /* LCOV_EXCL_STOP */ } -#endif template inline AnimationTrackData::AnimationTrackData(AnimationTrackTargetType targetType, UnsignedInt target, Animation::TrackView view) noexcept: AnimationTrackData{Implementation::animationTypeFor(), Implementation::animationTypeFor(), targetType, target, view} {} diff --git a/src/Magnum/Trade/MeshData.cpp b/src/Magnum/Trade/MeshData.cpp index 7ab34dd42..a4a949bc2 100644 --- a/src/Magnum/Trade/MeshData.cpp +++ b/src/Magnum/Trade/MeshData.cpp @@ -45,7 +45,7 @@ MeshIndexData::MeshIndexData(const Containers::StridedArrayView2D& 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 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 MeshData::bitangentSignsAsArray(const UnsignedInt id) const { diff --git a/src/Magnum/Trade/MeshData.h b/src/Magnum/Trade/MeshData.h index 6d3274882..858f92225 100644 --- a/src/Magnum/Trade/MeshData.h +++ b/src/Magnum/Trade/MeshData.h @@ -1804,7 +1804,6 @@ class MAGNUM_TRADE_EXPORT MeshData { Containers::Array _indexData, _vertexData; }; -#if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT) namespace Implementation { /* LCOV_EXCL_START */ template constexpr MeshIndexType meshIndexTypeFor() { @@ -1924,6 +1923,7 @@ namespace Implementation { template<> constexpr VertexFormat vertexFormatFor() { return VertexFormat::Matrix4x4; } template<> constexpr VertexFormat vertexFormatFor() { 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 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& data, std::nullptr_t) noexcept: _format{(CORRADE_CONSTEXPR_ASSERT(!arraySize || !isVertexFormatImplementationSpecific(format), @@ -2153,8 +2153,8 @@ template Containers::StridedArrayView2D(attribute, "Trade::MeshData::attribute():")) return {}; #endif return Containers::arrayCast<2, const typename std::remove_extent::type>(data); @@ -2176,8 +2176,8 @@ template Containers::StridedArrayView2D(attribute, "Trade::MeshData::mutableAttribute():")) return {}; #endif return Containers::arrayCast<2, typename std::remove_extent::type>(data); @@ -2199,8 +2199,8 @@ template Containers::StridedArrayView2D(attribute, "Trade::MeshData::attribute():")) return {}; #endif return Containers::arrayCast<2, const typename std::remove_extent::type>(data); @@ -2222,8 +2222,8 @@ template Containers::StridedArrayView2D(attribute, "Trade::MeshData::mutableAttribute():")) return {}; #endif return Containers::arrayCast<2, typename std::remove_extent::type>(data); diff --git a/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp b/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp index 2ffaa212b..8bc6fa6ff 100644 --- a/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp +++ b/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 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 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 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 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; diff --git a/src/Magnum/Trade/Test/AbstractImporterTest.cpp b/src/Magnum/Trade/Test/AbstractImporterTest.cpp index 35a43a155..7a29eb75b 100644 --- a/src/Magnum/Trade/Test/AbstractImporterTest.cpp +++ b/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; } diff --git a/src/Magnum/Trade/Test/AnimationDataTest.cpp b/src/Magnum/Trade/Test/AnimationDataTest.cpp index 6cf570c5e..227aa4dfa 100644 --- a/src/Magnum/Trade/Test/AnimationDataTest.cpp +++ b/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 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}; diff --git a/src/Magnum/Trade/Test/CameraDataTest.cpp b/src/Magnum/Trade/Test/CameraDataTest.cpp index 1e7120ffc..941897daf 100644 --- a/src/Magnum/Trade/Test/CameraDataTest.cpp +++ b/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}; diff --git a/src/Magnum/Trade/Test/ImageDataTest.cpp b/src/Magnum/Trade/Test/ImageDataTest.cpp index bfe820723..d70e40319 100644 --- a/src/Magnum/Trade/Test/ImageDataTest.cpp +++ b/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(format); + static_cast(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(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{8}}; std::ostringstream out; diff --git a/src/Magnum/Trade/Test/MaterialDataTest.cpp b/src/Magnum/Trade/Test/MaterialDataTest.cpp index 2b323383e..a77c23d64 100644 --- a/src/Magnum/Trade/Test/MaterialDataTest.cpp +++ b/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{{}, {}, {}, {}, {}, diff --git a/src/Magnum/Trade/Test/MeshDataTest.cpp b/src/Magnum/Trade/Test/MeshDataTest.cpp index 911462cc7..301d305f4 100644 --- a/src/Magnum/Trade/Test/MeshDataTest.cpp +++ b/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 positions{positionData}; Containers::StridedArrayView2D 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 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 indexData{reinterpret_cast(0xbadda9), 6, [](char*, std::size_t){}}; Containers::ArrayView indexData2{reinterpret_cast(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 vertexData{reinterpret_cast(0xbadda9), 24, [](char*, std::size_t){}}; Containers::ArrayView vertexData2{reinterpret_cast(0xdead), 3}; MeshAttributeData positions{MeshAttribute::Position, Containers::arrayCast(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 vertexData{136}; MeshAttributeData positions{MeshAttribute::Position, Containers::arrayCast(vertexData).prefix(3)}; MeshAttributeData positions2{MeshAttribute::Position, Containers::arrayCast(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 vertexData{2*sizeof(Vector2)}; auto vertexView = Containers::arrayCast(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 indexData{3*sizeof(UnsignedShort)}; auto indexView = Containers::arrayCast(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 void MeshDataTest::indicesAsArray() { } void MeshDataTest::indicesIntoArrayInvalidSize() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Containers::Array indexData{3*sizeof(UnsignedInt)}; MeshData data{MeshPrimitive::Points, std::move(indexData), MeshIndexData{Containers::arrayCast(indexData)}, 1}; @@ -1873,6 +1981,10 @@ template void MeshDataTest::positions2DAsArrayPackedSignedNormalized() } void MeshDataTest::positions2DIntoArrayInvalidSize() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Containers::Array vertexData{3*sizeof(Vector2)}; MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Position, Containers::arrayCast(vertexData)}}}; @@ -1975,6 +2087,10 @@ template void MeshDataTest::positions3DAsArrayPackedSignedNormalized() } void MeshDataTest::positions3DIntoArrayInvalidSize() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Containers::Array vertexData{3*sizeof(Vector3)}; MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Position, Containers::arrayCast(vertexData)}}}; @@ -2023,6 +2139,10 @@ template void MeshDataTest::tangentsAsArrayPackedSignedNormalized() { } void MeshDataTest::tangentsIntoArrayInvalidSize() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Containers::Array vertexData{3*sizeof(Vector3)}; MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Tangent, Containers::arrayCast(vertexData)}}}; @@ -2069,6 +2189,10 @@ template void MeshDataTest::bitangentSignsAsArrayPackedSignedNormalized } void MeshDataTest::bitangentSignsAsArrayNotFourComponent() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Containers::Array vertexData{3*sizeof(Vector3s)}; MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Tangent, VertexFormat::Vector3sNormalized, Containers::arrayCast(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 vertexData{3*sizeof(Vector4)}; MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Tangent, Containers::arrayCast(vertexData)}}}; @@ -2128,6 +2256,10 @@ template void MeshDataTest::bitangentsAsArrayPackedSignedNormalized() { } void MeshDataTest::bitangentsIntoArrayInvalidSize() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Containers::Array vertexData{3*sizeof(Vector3)}; MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Bitangent, Containers::arrayCast(vertexData)}}}; @@ -2175,6 +2307,10 @@ template void MeshDataTest::normalsAsArrayPackedSignedNormalized() { } void MeshDataTest::normalsIntoArrayInvalidSize() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Containers::Array vertexData{3*sizeof(Vector3)}; MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Normal, Containers::arrayCast(vertexData)}}}; @@ -2267,6 +2403,10 @@ template void MeshDataTest::textureCoordinates2DAsArrayPackedSignedNorm } void MeshDataTest::textureCoordinates2DIntoArrayInvalidSize() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Containers::Array vertexData{3*sizeof(Vector2)}; MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::TextureCoordinates, Containers::arrayCast(vertexData)}}}; @@ -2312,6 +2452,10 @@ template void MeshDataTest::colorsAsArrayPackedUnsignedNormalized() { } void MeshDataTest::colorsIntoArrayInvalidSize() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Containers::Array vertexData{3*sizeof(Color4)}; MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::Color, Containers::arrayCast(vertexData)}}}; @@ -2341,6 +2485,10 @@ template void MeshDataTest::objectIdsAsArray() { } void MeshDataTest::objectIdsIntoArrayInvalidSize() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + Containers::Array vertexData{3*sizeof(UnsignedInt)}; MeshData data{MeshPrimitive::Points, std::move(vertexData), {MeshAttributeData{MeshAttribute::ObjectId, Containers::arrayCast(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 vertexData{reinterpret_cast(0xbadda9), 3, [](char*, std::size_t){}}; Containers::ArrayView vertexData2{reinterpret_cast(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 indexData{sizeof(UnsignedShort)}; auto indexView = Containers::arrayCast(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}}; diff --git a/src/Magnum/Trade/Test/ObjectData2DTest.cpp b/src/Magnum/Trade/Test/ObjectData2DTest.cpp index f999dc224..c52eb699b 100644 --- a/src/Magnum/Trade/Test/ObjectData2DTest.cpp +++ b/src/Magnum/Trade/Test/ObjectData2DTest.cpp @@ -224,6 +224,10 @@ void ObjectData2DTest::constructMoveMesh() { } void ObjectData2DTest::accessInvalidTransformations() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + std::ostringstream out; Error redirectOutput{&out}; diff --git a/src/Magnum/Trade/Test/ObjectData3DTest.cpp b/src/Magnum/Trade/Test/ObjectData3DTest.cpp index 51963e5c8..eb945b72c 100644 --- a/src/Magnum/Trade/Test/ObjectData3DTest.cpp +++ b/src/Magnum/Trade/Test/ObjectData3DTest.cpp @@ -238,6 +238,10 @@ void ObjectData3DTest::constructMoveMesh() { } void ObjectData3DTest::accessInvalidTransformations() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + std::ostringstream out; Error redirectOutput{&out}; diff --git a/src/Magnum/VertexFormat.cpp b/src/Magnum/VertexFormat.cpp index 657606f42..4a6abfb72 100644 --- a/src/Magnum/VertexFormat.cpp +++ b/src/Magnum/VertexFormat.cpp @@ -166,7 +166,7 @@ UnsignedInt vertexFormatSize(const VertexFormat format) { return 128; } - CORRADE_ASSERT(false, "vertexFormatSize(): invalid format" << format, {}); + CORRADE_ASSERT_UNREACHABLE("vertexFormatSize(): invalid format" << format, {}); } UnsignedInt vertexFormatComponentCount(const VertexFormat format) { @@ -292,7 +292,7 @@ UnsignedInt vertexFormatComponentCount(const VertexFormat format) { return 4; } - CORRADE_ASSERT(false, "vertexFormatComponentCount(): invalid format" << format, {}); + CORRADE_ASSERT_UNREACHABLE("vertexFormatComponentCount(): invalid format" << format, {}); } VertexFormat vertexFormatComponentFormat(const VertexFormat format) { @@ -428,7 +428,7 @@ VertexFormat vertexFormatComponentFormat(const VertexFormat format) { return VertexFormat::Int; } - CORRADE_ASSERT(false, "vertexFormatComponentType(): invalid format" << format, {}); + CORRADE_ASSERT_UNREACHABLE("vertexFormatComponentType(): invalid format" << format, {}); } UnsignedInt vertexFormatVectorCount(const VertexFormat format) { @@ -554,7 +554,7 @@ UnsignedInt vertexFormatVectorCount(const VertexFormat format) { return 4; } - CORRADE_ASSERT(false, "vertexFormatVectorCount(): invalid format" << format, {}); + CORRADE_ASSERT_UNREACHABLE("vertexFormatVectorCount(): invalid format" << format, {}); } UnsignedInt vertexFormatVectorStride(const VertexFormat format) { @@ -683,7 +683,7 @@ UnsignedInt vertexFormatVectorStride(const VertexFormat format) { return 32; } - CORRADE_ASSERT(false, "vertexFormatVectorStride(): invalid format" << format, {}); + CORRADE_ASSERT_UNREACHABLE("vertexFormatVectorStride(): invalid format" << format, {}); } bool isVertexFormatNormalized(const VertexFormat format) { @@ -805,7 +805,7 @@ bool isVertexFormatNormalized(const VertexFormat format) { return true; } - CORRADE_ASSERT(false, "isVertexFormatNormalized(): invalid format" << format, {}); + CORRADE_ASSERT_UNREACHABLE("isVertexFormatNormalized(): invalid format" << format, {}); } VertexFormat vertexFormat(const VertexFormat format, const UnsignedInt componentCount, const bool normalized) { @@ -829,8 +829,7 @@ VertexFormat vertexFormat(const VertexFormat format, const UnsignedInt component case VertexFormat::Short: componentFormat = VertexFormat::ShortNormalized; break; - default: CORRADE_ASSERT(false, - "vertexFormat():" << format << "can't be made normalized", {}); + default: CORRADE_ASSERT_UNREACHABLE("vertexFormat():" << format << "can't be made normalized", {}); } } @@ -847,10 +846,7 @@ VertexFormat vertexFormat(const VertexFormat format, const UnsignedInt component else if(componentCount == 4) return VertexFormat(UnsignedInt(VertexFormat::Vector4) + UnsignedInt(componentFormat) - UnsignedInt(VertexFormat::Float)); - else CORRADE_ASSERT(false, - "vertexFormat(): invalid component count" << componentCount, {}); - - CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + else CORRADE_ASSERT_UNREACHABLE("vertexFormat(): invalid component count" << componentCount, {}); } VertexFormat vertexFormat(const VertexFormat format, const UnsignedInt vectorCount, UnsignedInt componentCount, const bool aligned) { @@ -897,8 +893,7 @@ VertexFormat vertexFormat(const VertexFormat format, const UnsignedInt vectorCou else out = UnsignedInt(VertexFormat::Matrix2x2sNormalized) + componentDistance; break; - default: CORRADE_ASSERT(false, - "vertexFormat(): invalid matrix component type" << componentFormat << Debug::nospace << ", only floating-point or 8-/16-bit signed integer types are supported", {}); + default: CORRADE_ASSERT_UNREACHABLE("vertexFormat(): invalid matrix component type" << componentFormat << Debug::nospace << ", only floating-point or 8-/16-bit signed integer types are supported", {}); } return VertexFormat(out + vectorDistance); diff --git a/src/Magnum/Vk/Test/EnumsTest.cpp b/src/Magnum/Vk/Test/EnumsTest.cpp index e7a783b7c..16663badc 100644 --- a/src/Magnum/Vk/Test/EnumsTest.cpp +++ b/src/Magnum/Vk/Test/EnumsTest.cpp @@ -161,6 +161,10 @@ void EnumsTest::mapVkPrimitiveTopologyImplementationSpecific() { } void EnumsTest::mapVkPrimitiveTopologyUnsupported() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + CORRADE_VERIFY(!hasVkPrimitiveTopology(Magnum::MeshPrimitive::LineLoop)); std::ostringstream out; @@ -173,6 +177,10 @@ void EnumsTest::mapVkPrimitiveTopologyUnsupported() { } void EnumsTest::mapVkPrimitiveTopologyInvalid() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + std::ostringstream out; Error redirectError{&out}; @@ -218,6 +226,10 @@ void EnumsTest::mapVkIndexType() { } void EnumsTest::mapVkIndexTypeUnsupported() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + #if 1 CORRADE_SKIP("All index formats are supported."); #else @@ -233,6 +245,10 @@ void EnumsTest::mapVkIndexTypeUnsupported() { } void EnumsTest::mapVkIndexTypeInvalid() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + std::ostringstream out; Error redirectError{&out}; @@ -315,6 +331,10 @@ void EnumsTest::mapVkFormatVertexFormatImplementationSpecific() { } void EnumsTest::mapVkFormatVertexFormatUnsupported() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + #if 1 CORRADE_SKIP("All vertex formats are supported."); #else @@ -327,6 +347,10 @@ void EnumsTest::mapVkFormatVertexFormatUnsupported() { } void EnumsTest::mapVkFormatVertexFormatInvalid() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + std::ostringstream out; Error redirectError{&out}; @@ -408,6 +432,10 @@ void EnumsTest::mapVkFormatPixelFormatImplementationSpecific() { } void EnumsTest::mapVkFormatPixelFormatUnsupported() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + #if 1 CORRADE_SKIP("All pixel formats are supported."); #else @@ -420,6 +448,10 @@ void EnumsTest::mapVkFormatPixelFormatUnsupported() { } void EnumsTest::mapVkFormatPixelFormatInvalid() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + std::ostringstream out; Error redirectError{&out}; @@ -501,6 +533,10 @@ void EnumsTest::mapVkFormatCompressedPixelFormatImplementationSpecific() { } void EnumsTest::mapVkFormatCompressedPixelFormatUnsupported() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + CORRADE_VERIFY(!hasVkFormat(Magnum::CompressedPixelFormat::Astc3x3x3RGBAUnorm)); std::ostringstream out; @@ -510,6 +546,10 @@ void EnumsTest::mapVkFormatCompressedPixelFormatUnsupported() { } void EnumsTest::mapVkFormatCompressedPixelFormatInvalid() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + std::ostringstream out; Error redirectError{&out}; @@ -530,6 +570,10 @@ void EnumsTest::mapVkFilter() { } void EnumsTest::mapVkFilterInvalid() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + std::ostringstream out; Error redirectError{&out}; @@ -545,6 +589,10 @@ void EnumsTest::mapVkSamplerMipmapMode() { } void EnumsTest::mapVkSamplerMipmapModeInvalid() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + std::ostringstream out; Error redirectError{&out}; @@ -572,6 +620,10 @@ void EnumsTest::mapVkSamplerAddressModeArray() { } void EnumsTest::mapVkSamplerAddressModeUnsupported() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + CORRADE_VERIFY(!hasVkSamplerAddressMode(Magnum::SamplerWrapping::MirrorClampToEdge)); std::ostringstream out; { @@ -583,6 +635,10 @@ void EnumsTest::mapVkSamplerAddressModeUnsupported() { } void EnumsTest::mapVkSamplerAddressModeInvalid() { + #ifdef CORRADE_NO_ASSERT + CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); + #endif + std::ostringstream out; Error redirectError{&out}; diff --git a/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp b/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp index b6446cff7..3e567351f 100644 --- a/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp +++ b/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp @@ -77,11 +77,11 @@ AnyImporterTest::AnyImporterTest() { /* Load the plugin directly from the build tree. Otherwise it's static and already loaded. */ #ifdef ANYAUDIOIMPORTER_PLUGIN_FILENAME - CORRADE_INTERNAL_ASSERT(_manager.load(ANYAUDIOIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYAUDIOIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif /* Optional plugins that don't have to be here */ #ifdef WAVAUDIOIMPORTER_PLUGIN_FILENAME - CORRADE_INTERNAL_ASSERT(_manager.load(WAVAUDIOIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(WAVAUDIOIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif } diff --git a/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp b/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp index 6fc6916d7..91450f49f 100644 --- a/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp +++ b/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp @@ -84,15 +84,15 @@ AnyImageConverterTest::AnyImageConverterTest() { /* Load the plugin directly from the build tree. Otherwise it's static and already loaded. */ #ifdef ANYIMAGECONVERTER_PLUGIN_FILENAME - CORRADE_INTERNAL_ASSERT(_manager.load(ANYIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif /* Optional plugins that don't have to be here */ #ifdef TGAIMAGECONVERTER_PLUGIN_FILENAME - CORRADE_INTERNAL_ASSERT(_manager.load(TGAIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(TGAIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif /* Create the output directory if it doesn't exist yet */ - CORRADE_INTERNAL_ASSERT(Utility::Directory::mkpath(ANYIMAGECONVERTER_TEST_DIR)); + CORRADE_INTERNAL_ASSERT_OUTPUT(Utility::Directory::mkpath(ANYIMAGECONVERTER_TEST_DIR)); } constexpr const char Data[] = { diff --git a/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp b/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp index e1819865f..822da25b5 100644 --- a/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp +++ b/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp @@ -106,11 +106,11 @@ AnyImageImporterTest::AnyImageImporterTest() { /* Load the plugin directly from the build tree. Otherwise it's static and already loaded. */ #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 /* Optional plugins that don't have to be here */ #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 } diff --git a/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp b/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp index 79ec4bca1..c3d498104 100644 --- a/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp +++ b/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp @@ -99,11 +99,11 @@ AnySceneImporterTest::AnySceneImporterTest() { /* Load the plugin directly from the build tree. Otherwise it's static and already loaded. */ #ifdef ANYSCENEIMPORTER_PLUGIN_FILENAME - CORRADE_INTERNAL_ASSERT(_manager.load(ANYSCENEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(ANYSCENEIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif /* Optional plugins that don't have to be here */ #ifdef OBJIMPORTER_PLUGIN_FILENAME - CORRADE_INTERNAL_ASSERT(_manager.load(OBJIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(OBJIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif } diff --git a/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp b/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp index ada22e581..191082c15 100644 --- a/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp +++ b/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp @@ -51,8 +51,8 @@ MagnumFontGLTest::MagnumFontGLTest() { /* Load the plugins directly from the build tree. Otherwise they're static and already loaded. */ #if defined(TGAIMPORTER_PLUGIN_FILENAME) && defined(MAGNUMFONT_PLUGIN_FILENAME) - CORRADE_INTERNAL_ASSERT(_importerManager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); - CORRADE_INTERNAL_ASSERT(_fontManager.load(MAGNUMFONT_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_importerManager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_fontManager.load(MAGNUMFONT_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif } diff --git a/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp b/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp index 098f4a25f..be72bda16 100644 --- a/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp +++ b/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp @@ -65,8 +65,8 @@ MagnumFontTest::MagnumFontTest() { /* Load the plugins directly from the build tree. Otherwise they're static and already loaded. */ #if defined(TGAIMPORTER_PLUGIN_FILENAME) && defined(MAGNUMFONT_PLUGIN_FILENAME) - CORRADE_INTERNAL_ASSERT(_importerManager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); - CORRADE_INTERNAL_ASSERT(_fontManager.load(MAGNUMFONT_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_importerManager.load(TGAIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_fontManager.load(MAGNUMFONT_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif } diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp index 58dc9764e..e7a3c0de9 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp @@ -62,16 +62,16 @@ MagnumFontConverterTest::MagnumFontConverterTest() { /* Load the plugins directly from the build tree. Otherwise they are static and already loaded. */ #if defined(TGAIMAGECONVERTER_PLUGIN_FILENAME) && defined(MAGNUMFONTCONVERTER_PLUGIN_FILENAME) - CORRADE_INTERNAL_ASSERT(_imageConverterManager.load(TGAIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); - CORRADE_INTERNAL_ASSERT(_fontConverterManager.load(MAGNUMFONTCONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_imageConverterManager.load(TGAIMAGECONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_fontConverterManager.load(MAGNUMFONTCONVERTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif /* Optional plugins that don't have to be here */ #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 /* Create the output directory if it doesn't exist yet */ - CORRADE_INTERNAL_ASSERT(Utility::Directory::mkpath(MAGNUMFONTCONVERTER_TEST_WRITE_DIR)); + CORRADE_INTERNAL_ASSERT_OUTPUT(Utility::Directory::mkpath(MAGNUMFONTCONVERTER_TEST_WRITE_DIR)); } void MagnumFontConverterTest::exportFont() { diff --git a/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp b/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp index c8a02b302..32642044e 100644 --- a/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp +++ b/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp @@ -148,7 +148,7 @@ ObjImporterTest::ObjImporterTest() { &ObjImporterTest::unknownKeyword}); #ifdef OBJIMPORTER_PLUGIN_FILENAME - CORRADE_INTERNAL_ASSERT(_manager.load(OBJIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(OBJIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif } diff --git a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp index cf9270c29..3ac810468 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp +++ b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp @@ -89,11 +89,11 @@ TgaImageConverterTest::TgaImageConverterTest() { /* Load the plugin directly from the build tree. Otherwise it's static and already loaded. */ #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 /* Optional plugins that don't have to be here */ #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 } diff --git a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp index df073cca2..872fd660f 100644 --- a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp +++ b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp @@ -139,7 +139,7 @@ TgaImporterTest::TgaImporterTest() { /* Load the plugin directly from the build tree. Otherwise it's static and already loaded. */ #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 } diff --git a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp index 2aa573bdd..5306e4d95 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp +++ b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp @@ -124,7 +124,7 @@ WavImporterTest::WavImporterTest() { /* Load the plugin directly from the build tree. Otherwise it's static and already loaded. */ #ifdef WAVAUDIOIMPORTER_PLUGIN_FILENAME - CORRADE_INTERNAL_ASSERT(_manager.load(WAVAUDIOIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); + CORRADE_INTERNAL_ASSERT_OUTPUT(_manager.load(WAVAUDIOIMPORTER_PLUGIN_FILENAME) & PluginManager::LoadState::Loaded); #endif }