From 2149f7b869cc6e5d60be38917981c9765d3223f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 10 Jan 2019 23:36:36 +0100 Subject: [PATCH] Wrap all tests in unnamed namespaces. This makes the compiler warn about test cases that aren't ever used, which is a good thing. --- package/ci/leaksanitizer.conf | 2 +- src/Magnum/Animation/Test/Benchmark.cpp | 4 +- src/Magnum/Animation/Test/EasingTest.cpp | 16 +- .../Animation/Test/InterpolationTest.cpp | 28 +- .../Animation/Test/PlayerCustomTest.cpp | 18 +- src/Magnum/Animation/Test/PlayerTest.cpp | 80 ++- src/Magnum/Animation/Test/TrackTest.cpp | 18 +- src/Magnum/Animation/Test/TrackViewTest.cpp | 35 +- .../Audio/Test/AbstractImporterTest.cpp | 4 +- src/Magnum/Audio/Test/BufferALTest.cpp | 4 +- src/Magnum/Audio/Test/BufferFormatTest.cpp | 4 +- src/Magnum/Audio/Test/ContextALTest.cpp | 4 +- src/Magnum/Audio/Test/ContextTest.cpp | 4 +- src/Magnum/Audio/Test/ListenerALTest.cpp | 4 +- src/Magnum/Audio/Test/PlayableALTest.cpp | 4 +- src/Magnum/Audio/Test/RendererALTest.cpp | 4 +- src/Magnum/Audio/Test/RendererTest.cpp | 4 +- src/Magnum/Audio/Test/SourceALTest.cpp | 4 +- src/Magnum/Audio/Test/SourceTest.cpp | 4 +- .../DebugTools/Test/BufferDataGLTest.cpp | 8 +- .../DebugTools/Test/CapsuleRendererTest.cpp | 4 +- .../DebugTools/Test/CompareImageTest.cpp | 87 ++- .../DebugTools/Test/CylinderRendererTest.cpp | 4 +- .../DebugTools/Test/ForceRendererTest.cpp | 4 +- .../Test/LineSegmentRendererTest.cpp | 4 +- .../DebugTools/Test/TextureImageGLTest.cpp | 34 +- src/Magnum/GL/Test/AbstractObjectGLTest.cpp | 4 +- src/Magnum/GL/Test/AbstractQueryGLTest.cpp | 4 +- .../GL/Test/AbstractShaderProgramGLTest.cpp | 93 ++- .../GL/Test/AbstractShaderProgramTest.cpp | 4 +- src/Magnum/GL/Test/AbstractTextureGLTest.cpp | 4 +- src/Magnum/GL/Test/AttributeTest.cpp | 4 +- src/Magnum/GL/Test/BufferGLTest.cpp | 4 +- src/Magnum/GL/Test/BufferImageGLTest.cpp | 4 +- src/Magnum/GL/Test/BufferImageTest.cpp | 4 +- src/Magnum/GL/Test/BufferTest.cpp | 4 +- src/Magnum/GL/Test/BufferTextureGLTest.cpp | 4 +- src/Magnum/GL/Test/BufferTextureTest.cpp | 4 +- src/Magnum/GL/Test/ContextGLTest.cpp | 4 +- src/Magnum/GL/Test/ContextTest.cpp | 4 +- .../GL/Test/CubeMapTextureArrayGLTest.cpp | 570 +++++++++--------- .../GL/Test/CubeMapTextureArrayTest.cpp | 4 +- src/Magnum/GL/Test/CubeMapTextureGLTest.cpp | 409 ++++++------- src/Magnum/GL/Test/CubeMapTextureTest.cpp | 4 +- src/Magnum/GL/Test/DebugOutputGLTest.cpp | 4 +- src/Magnum/GL/Test/DebugOutputTest.cpp | 4 +- src/Magnum/GL/Test/DefaultFramebufferTest.cpp | 4 +- src/Magnum/GL/Test/FramebufferGLTest.cpp | 26 +- src/Magnum/GL/Test/FramebufferTest.cpp | 4 +- src/Magnum/GL/Test/MeshGLTest.cpp | 156 +++-- src/Magnum/GL/Test/MeshTest.cpp | 12 +- .../GL/Test/MultisampleTextureGLTest.cpp | 4 +- src/Magnum/GL/Test/MultisampleTextureTest.cpp | 4 +- src/Magnum/GL/Test/PixelFormatTest.cpp | 4 +- src/Magnum/GL/Test/PixelStorageGLTest.cpp | 222 ++++--- src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp | 4 +- src/Magnum/GL/Test/PrimitiveQueryTest.cpp | 4 +- src/Magnum/GL/Test/RectangleTextureGLTest.cpp | 86 ++- src/Magnum/GL/Test/RectangleTextureTest.cpp | 4 +- src/Magnum/GL/Test/RenderbufferGLTest.cpp | 4 +- src/Magnum/GL/Test/RenderbufferTest.cpp | 4 +- src/Magnum/GL/Test/RendererGLTest.cpp | 4 +- src/Magnum/GL/Test/RendererTest.cpp | 4 +- src/Magnum/GL/Test/SampleQueryGLTest.cpp | 14 +- src/Magnum/GL/Test/SampleQueryTest.cpp | 4 +- src/Magnum/GL/Test/SamplerTest.cpp | 4 +- src/Magnum/GL/Test/ShaderGLTest.cpp | 4 +- src/Magnum/GL/Test/ShaderTest.cpp | 4 +- src/Magnum/GL/Test/TextureArrayGLTest.cpp | 339 +++++------ src/Magnum/GL/Test/TextureArrayTest.cpp | 4 +- src/Magnum/GL/Test/TextureGLTest.cpp | 568 +++++++++-------- src/Magnum/GL/Test/TextureTest.cpp | 4 +- src/Magnum/GL/Test/TimeQueryGLTest.cpp | 4 +- src/Magnum/GL/Test/TimeQueryTest.cpp | 4 +- .../GL/Test/TransformFeedbackGLTest.cpp | 16 +- src/Magnum/GL/Test/TransformFeedbackTest.cpp | 4 +- src/Magnum/GL/Test/VersionTest.cpp | 4 +- .../Math/Algorithms/Test/GaussJordanTest.cpp | 4 +- .../Math/Algorithms/Test/GramSchmidtTest.cpp | 4 +- .../Math/Algorithms/Test/KahanSumTest.cpp | 8 +- src/Magnum/Math/Algorithms/Test/QrTest.cpp | 4 +- src/Magnum/Math/Algorithms/Test/SvdTest.cpp | 4 +- src/Magnum/Math/Test/AngleTest.cpp | 8 +- src/Magnum/Math/Test/BezierTest.cpp | 4 +- src/Magnum/Math/Test/BoolVectorTest.cpp | 4 +- src/Magnum/Math/Test/ColorTest.cpp | 8 +- src/Magnum/Math/Test/ComplexTest.cpp | 4 +- src/Magnum/Math/Test/ConstantsTest.cpp | 4 +- src/Magnum/Math/Test/CubicHermiteTest.cpp | 4 +- src/Magnum/Math/Test/DistanceTest.cpp | 4 +- src/Magnum/Math/Test/DualComplexTest.cpp | 20 +- src/Magnum/Math/Test/DualQuaternionTest.cpp | 20 +- src/Magnum/Math/Test/DualTest.cpp | 8 +- src/Magnum/Math/Test/FrustumTest.cpp | 4 +- src/Magnum/Math/Test/FunctionsTest.cpp | 4 +- src/Magnum/Math/Test/HalfTest.cpp | 12 +- .../Math/Test/InterpolationBenchmark.cpp | 4 +- .../Math/Test/IntersectionBenchmark.cpp | 4 +- src/Magnum/Math/Test/IntersectionTest.cpp | 4 +- src/Magnum/Math/Test/Matrix3Test.cpp | 4 +- src/Magnum/Math/Test/Matrix4Test.cpp | 4 +- src/Magnum/Math/Test/MatrixTest.cpp | 4 +- src/Magnum/Math/Test/PackingTest.cpp | 4 +- src/Magnum/Math/Test/QuaternionTest.cpp | 4 +- src/Magnum/Math/Test/RangeTest.cpp | 4 +- .../Math/Test/RectangularMatrixTest.cpp | 4 +- .../Math/Test/StrictWeakOrderingTest.cpp | 26 +- src/Magnum/Math/Test/SwizzleTest.cpp | 4 +- src/Magnum/Math/Test/TagsTest.cpp | 4 +- src/Magnum/Math/Test/TypeTraitsTest.cpp | 22 +- src/Magnum/Math/Test/UnitTest.cpp | 4 +- src/Magnum/Math/Test/Vector2Test.cpp | 4 +- src/Magnum/Math/Test/Vector3Test.cpp | 4 +- src/Magnum/Math/Test/Vector4Test.cpp | 4 +- src/Magnum/Math/Test/VectorTest.cpp | 4 +- .../Test/CombineIndexedArraysTest.cpp | 4 +- .../MeshTools/Test/CompressIndicesTest.cpp | 4 +- src/Magnum/MeshTools/Test/DuplicateTest.cpp | 4 +- src/Magnum/MeshTools/Test/FlipNormalsTest.cpp | 4 +- .../Test/GenerateFlatNormalsTest.cpp | 4 +- src/Magnum/MeshTools/Test/InterleaveTest.cpp | 4 +- .../MeshTools/Test/RemoveDuplicatesTest.cpp | 4 +- .../SubdivideRemoveDuplicatesBenchmark.cpp | 4 +- src/Magnum/MeshTools/Test/SubdivideTest.cpp | 8 +- src/Magnum/MeshTools/Test/TipsifyTest.cpp | 56 +- src/Magnum/MeshTools/Test/TransformTest.cpp | 4 +- .../Platform/Test/AndroidApplicationTest.cpp | 4 +- .../Platform/Test/GlfwApplicationTest.cpp | 4 +- .../Platform/Test/GlutApplicationTest.cpp | 4 +- .../Platform/Test/GlxApplicationTest.cpp | 4 +- .../Platform/Test/Sdl2ApplicationTest.cpp | 4 +- .../Test/WindowlessCglApplicationTest.cpp | 4 +- .../Test/WindowlessEglApplicationTest.cpp | 4 +- .../Test/WindowlessGlxApplicationTest.cpp | 4 +- .../Test/WindowlessIosApplicationTest.cpp | 4 +- .../Test/WindowlessWglApplicationTest.cpp | 4 +- .../WindowlessWindowsEglApplicationTest.cpp | 4 +- .../Platform/Test/XEglApplicationTest.cpp | 4 +- src/Magnum/Primitives/Test/AxisTest.cpp | 4 +- src/Magnum/Primitives/Test/CapsuleTest.cpp | 4 +- src/Magnum/Primitives/Test/CircleTest.cpp | 4 +- src/Magnum/Primitives/Test/ConeTest.cpp | 4 +- src/Magnum/Primitives/Test/CrosshairTest.cpp | 4 +- src/Magnum/Primitives/Test/CubeTest.cpp | 4 +- src/Magnum/Primitives/Test/CylinderTest.cpp | 4 +- src/Magnum/Primitives/Test/GradientTest.cpp | 4 +- src/Magnum/Primitives/Test/GridTest.cpp | 4 +- src/Magnum/Primitives/Test/IcosphereTest.cpp | 4 +- src/Magnum/Primitives/Test/LineTest.cpp | 4 +- src/Magnum/Primitives/Test/PlaneTest.cpp | 4 +- src/Magnum/Primitives/Test/SquareTest.cpp | 4 +- src/Magnum/Primitives/Test/UVSphereTest.cpp | 4 +- src/Magnum/SceneGraph/Test/AnimableTest.cpp | 4 +- src/Magnum/SceneGraph/Test/CameraTest.cpp | 4 +- .../Test/DualComplexTransformationTest.cpp | 4 +- .../Test/DualQuaternionTransformationTest.cpp | 4 +- .../Test/MatrixTransformation2DTest.cpp | 4 +- .../Test/MatrixTransformation3DTest.cpp | 4 +- src/Magnum/SceneGraph/Test/ObjectTest.cpp | 4 +- .../Test/RigidMatrixTransformation2DTest.cpp | 4 +- .../Test/RigidMatrixTransformation3DTest.cpp | 4 +- src/Magnum/SceneGraph/Test/SceneTest.cpp | 4 +- ...ionRotationScalingTransformation2DTest.cpp | 4 +- ...ionRotationScalingTransformation3DTest.cpp | 4 +- .../Test/TranslationTransformationTest.cpp | 4 +- .../Test/DistanceFieldVectorGLTest.cpp | 4 +- .../Shaders/Test/DistanceFieldVectorTest.cpp | 4 +- src/Magnum/Shaders/Test/FlatGLTest.cpp | 8 +- src/Magnum/Shaders/Test/FlatTest.cpp | 4 +- .../Shaders/Test/MeshVisualizerGLTest.cpp | 4 +- .../Shaders/Test/MeshVisualizerTest.cpp | 4 +- src/Magnum/Shaders/Test/PhongGLTest.cpp | 4 +- src/Magnum/Shaders/Test/PhongTest.cpp | 4 +- src/Magnum/Shaders/Test/VectorGLTest.cpp | 4 +- src/Magnum/Shaders/Test/VectorTest.cpp | 4 +- src/Magnum/Shaders/Test/VertexColorGLTest.cpp | 4 +- src/Magnum/Shaders/Test/VertexColorTest.cpp | 4 +- src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp | 4 +- src/Magnum/Shapes/Test/BoxTest.cpp | 4 +- src/Magnum/Shapes/Test/CapsuleTest.cpp | 4 +- src/Magnum/Shapes/Test/CollisionTest.cpp | 4 +- src/Magnum/Shapes/Test/CompositionTest.cpp | 4 +- src/Magnum/Shapes/Test/CylinderTest.cpp | 4 +- src/Magnum/Shapes/Test/LineTest.cpp | 4 +- src/Magnum/Shapes/Test/PlaneTest.cpp | 4 +- src/Magnum/Shapes/Test/PointTest.cpp | 4 +- .../Shapes/Test/ShapeImplementationTest.cpp | 4 +- src/Magnum/Shapes/Test/ShapeTest.cpp | 4 +- src/Magnum/Shapes/Test/ShapeTestBase.h | 4 +- src/Magnum/Shapes/Test/SphereTest.cpp | 4 +- src/Magnum/Test/ArrayTest.cpp | 4 +- src/Magnum/Test/ImageTest.cpp | 8 +- src/Magnum/Test/ImageViewTest.cpp | 8 +- src/Magnum/Test/MeshTest.cpp | 4 +- src/Magnum/Test/PixelFormatTest.cpp | 4 +- src/Magnum/Test/PixelStorageTest.cpp | 4 +- .../Test/ResourceManagerLocalInstanceTest.cpp | 4 +- src/Magnum/Test/ResourceManagerTest.cpp | 4 +- src/Magnum/Test/SamplerTest.cpp | 4 +- src/Magnum/Test/TagsTest.cpp | 4 +- .../Text/Test/AbstractFontConverterTest.cpp | 18 +- src/Magnum/Text/Test/AbstractFontTest.cpp | 8 +- src/Magnum/Text/Test/AbstractLayouterTest.cpp | 4 +- .../Test/DistanceFieldGlyphCacheGLTest.cpp | 4 +- src/Magnum/Text/Test/GlyphCacheGLTest.cpp | 4 +- src/Magnum/Text/Test/RendererGLTest.cpp | 8 +- src/Magnum/TextureTools/Test/AtlasTest.cpp | 4 +- .../TextureTools/Test/DistanceFieldGLTest.cpp | 4 +- .../Trade/Test/AbstractImageConverterTest.cpp | 8 +- .../Trade/Test/AbstractImporterTest.cpp | 8 +- src/Magnum/Trade/Test/AnimationDataTest.cpp | 4 +- src/Magnum/Trade/Test/CameraDataTest.cpp | 4 +- src/Magnum/Trade/Test/ImageDataTest.cpp | 8 +- src/Magnum/Trade/Test/LightDataTest.cpp | 4 +- src/Magnum/Trade/Test/MaterialDataTest.cpp | 4 +- src/Magnum/Trade/Test/MeshData2DTest.cpp | 4 +- src/Magnum/Trade/Test/MeshData3DTest.cpp | 4 +- src/Magnum/Trade/Test/ObjectData2DTest.cpp | 4 +- src/Magnum/Trade/Test/ObjectData3DTest.cpp | 4 +- src/Magnum/Trade/Test/SceneDataTest.cpp | 4 +- src/Magnum/Trade/Test/TextureDataTest.cpp | 4 +- src/Magnum/Vk/Test/EnumsTest.cpp | 4 +- .../Optional/Test/StdOptionalTest.cpp | 4 +- .../Test/AnyAudioImporterTest.cpp | 4 +- .../Test/AnyImageConverterTest.cpp | 18 +- .../Test/AnyImageImporterTest.cpp | 8 +- .../Test/AnySceneImporterTest.cpp | 4 +- .../MagnumFont/Test/MagnumFontGLTest.cpp | 4 +- .../Test/MagnumFontConverterGLTest.cpp | 4 +- .../ObjImporter/Test/ObjImporterTest.cpp | 4 +- .../Test/TgaImageConverterTest.cpp | 54 +- .../TgaImporter/Test/TgaImporterTest.cpp | 4 +- .../WavAudioImporter/Test/WavHeaderTest.cpp | 4 +- .../WavAudioImporter/Test/WavImporterTest.cpp | 4 +- 234 files changed, 1857 insertions(+), 2094 deletions(-) diff --git a/package/ci/leaksanitizer.conf b/package/ci/leaksanitizer.conf index 2a5e330ca..eac41744a 100644 --- a/package/ci/leaksanitizer.conf +++ b/package/ci/leaksanitizer.conf @@ -2,4 +2,4 @@ # The test case intentionally leaks because there is currently no other way to # trigger given behavior without asserting elsewhere -leak:Magnum::Test::ResourceManagerTest::clearWhileReferenced +leak:ResourceManagerTest::clearWhileReferenced diff --git a/src/Magnum/Animation/Test/Benchmark.cpp b/src/Magnum/Animation/Test/Benchmark.cpp index 3ad5f66d9..d10871227 100644 --- a/src/Magnum/Animation/Test/Benchmark.cpp +++ b/src/Magnum/Animation/Test/Benchmark.cpp @@ -27,7 +27,7 @@ #include "Magnum/Animation/Player.h" -namespace Magnum { namespace Animation { namespace Test { +namespace Magnum { namespace Animation { namespace Test { namespace { struct Benchmark: TestSuite::Tester { explicit Benchmark(); @@ -260,6 +260,6 @@ void Benchmark::playerAdvanceRawCallbackDirectInterpolator() { CORRADE_COMPARE(result, 125000); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Animation::Test::Benchmark) diff --git a/src/Magnum/Animation/Test/EasingTest.cpp b/src/Magnum/Animation/Test/EasingTest.cpp index 35cf83f14..c2c42df2e 100644 --- a/src/Magnum/Animation/Test/EasingTest.cpp +++ b/src/Magnum/Animation/Test/EasingTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Animation/Easing.h" -namespace Magnum { namespace Animation { namespace Test { +namespace Magnum { namespace Animation { namespace Test { namespace { struct EasingTest: TestSuite::Tester { explicit EasingTest(); @@ -44,8 +44,6 @@ struct EasingTest: TestSuite::Tester { void benchmark(); }; -namespace { - #define _c(name) #name, Easing::name constexpr struct { const char* name; @@ -188,8 +186,6 @@ constexpr struct { }; #undef _c -} - EasingTest::EasingTest() { addInstancedTests({&EasingTest::bounds}, Containers::arraySize(BoundsData)); @@ -207,9 +203,7 @@ EasingTest::EasingTest() { Containers::arraySize(ValueData)); } -namespace { - constexpr std::size_t PropertyVerificationStepCount = 50; -} +enum: std::size_t { PropertyVerificationStepCount = 50 }; void EasingTest::bounds() { auto&& data = BoundsData[testCaseInstanceId()]; @@ -264,9 +258,7 @@ void EasingTest::values() { CORRADE_COMPARE(data.function(0.75f), data.values[2]); } -namespace { - constexpr Int BenchmarkStepCount = 5000; -} +enum: Int { BenchmarkStepCount = 5000 }; void EasingTest::benchmark() { auto&& data = ValueData[testCaseInstanceId()]; @@ -284,6 +276,6 @@ void EasingTest::benchmark() { CORRADE_COMPARE_AS(result, -350.0f, TestSuite::Compare::Greater); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Animation::Test::EasingTest) diff --git a/src/Magnum/Animation/Test/InterpolationTest.cpp b/src/Magnum/Animation/Test/InterpolationTest.cpp index 4131a7ae2..df63a4a5a 100644 --- a/src/Magnum/Animation/Test/InterpolationTest.cpp +++ b/src/Magnum/Animation/Test/InterpolationTest.cpp @@ -33,7 +33,7 @@ #include "Magnum/Math/DualQuaternion.h" #include "Magnum/Math/Half.h" -namespace Magnum { namespace Animation { namespace Test { +namespace Magnum { namespace Animation { namespace Test { namespace { struct InterpolationTest: TestSuite::Tester { explicit InterpolationTest(); @@ -76,8 +76,6 @@ struct InterpolationTest: TestSuite::Tester { void debugExtrapolation(); }; -namespace { - using namespace Math::Literals; const struct { @@ -146,8 +144,6 @@ const struct { {"out of bounds", 405780454} }; -} - InterpolationTest::InterpolationTest() { addTests({&InterpolationTest::interpolatorFor, &InterpolationTest::interpolatorForBool, @@ -374,10 +370,8 @@ void InterpolationTest::interpolatorForCubicHermiteQuaternion() { "Animation::interpolatorFor(): can't deduce interpolator function for Animation::Interpolation(0xde)\n"); } -namespace { - constexpr Float Keys[]{0.0f, 2.0f, 4.0f, 5.0f}; - constexpr Float Values[]{3.0f, 1.0f, 2.5f, 0.5f}; -} +constexpr Float Keys[]{0.0f, 2.0f, 4.0f, 5.0f}; +constexpr Float Values[]{3.0f, 1.0f, 2.5f, 0.5f}; void InterpolationTest::interpolate() { const auto& data = Data[testCaseInstanceId()]; @@ -442,14 +436,12 @@ void InterpolationTest::interpolateStrictHint() { CORRADE_COMPARE(hint, 2); } -namespace { - using namespace Math::Literals; +using namespace Math::Literals; - const Half HalfValues[]{3.0_h, 1.0_h, 2.5_h, 0.5_h}; +const Half HalfValues[]{3.0_h, 1.0_h, 2.5_h, 0.5_h}; - Float lerpHalf(const Half& a, const Half& b, Float t) { - return Math::lerp(Float(a), Float(b), t); - } +Float lerpHalf(const Half& a, const Half& b, Float t) { + return Math::lerp(Float(a), Float(b), t); } void InterpolationTest::interpolateDifferentResultType() { @@ -466,9 +458,7 @@ void InterpolationTest::interpolateStrictDifferentResultType() { CORRADE_COMPARE(hint, 2); } -namespace { - constexpr Int IntegerKeys[]{0, 48, 96, 120}; -} +constexpr Int IntegerKeys[]{0, 48, 96, 120}; void InterpolationTest::interpolateIntegerKey() { std::size_t hint{}; @@ -581,6 +571,6 @@ void InterpolationTest::debugExtrapolation() { CORRADE_COMPARE(out.str(), "Animation::Extrapolation::DefaultConstructed Animation::Extrapolation(0xde)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Animation::Test::InterpolationTest) diff --git a/src/Magnum/Animation/Test/PlayerCustomTest.cpp b/src/Magnum/Animation/Test/PlayerCustomTest.cpp index ba8410aba..e975c9f3e 100644 --- a/src/Magnum/Animation/Test/PlayerCustomTest.cpp +++ b/src/Magnum/Animation/Test/PlayerCustomTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/Animation/Player.hpp" -namespace Magnum { namespace Animation { namespace Test { +namespace Magnum { namespace Animation { namespace Test { namespace { struct PlayerCustomTest: TestSuite::Tester { explicit PlayerCustomTest(); @@ -43,14 +43,12 @@ PlayerCustomTest::PlayerCustomTest() { typedef std::uint64_t UnsignedLong; /** @todo what about this? */ #endif -namespace { - const Animation::Track Track{{ - {24, 1.5f}, /* 1.0 sec */ - {60, 3.0f}, /* 2.5 sec */ - {72, 5.0f}, /* 3.0 sec */ - {96, 2.0f} /* 4.0 sec */ - }, Math::lerp}; -} +const Animation::Track Track{{ + {24, 1.5f}, /* 1.0 sec */ + {60, 3.0f}, /* 2.5 sec */ + {72, 5.0f}, /* 3.0 sec */ + {96, 2.0f} /* 4.0 sec */ +}, Math::lerp}; void PlayerCustomTest::test() { Player player{ @@ -75,6 +73,6 @@ void PlayerCustomTest::test() { CORRADE_COMPARE(value, 4.0f); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Animation::Test::PlayerCustomTest) diff --git a/src/Magnum/Animation/Test/PlayerTest.cpp b/src/Magnum/Animation/Test/PlayerTest.cpp index 0bfd3b8ee..707240b6e 100644 --- a/src/Magnum/Animation/Test/PlayerTest.cpp +++ b/src/Magnum/Animation/Test/PlayerTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Animation/Player.h" -namespace Magnum { namespace Animation { namespace Test { +namespace Magnum { namespace Animation { namespace Test { namespace { struct PlayerTest: TestSuite::Tester { explicit PlayerTest(); @@ -89,34 +89,32 @@ struct PlayerTest: TestSuite::Tester { void debugState(); }; -namespace { - const struct { - const char* name; - Float offsetFloat; - std::chrono::minutes offsetChrono; - bool failsFloat, failsFuzzyFloat; - } RunFor100YearsData[]{ - {"0", 0.0f, {}, false, false}, - {"1 minute", 60.0f, std::chrono::minutes(1), false, false}, - {"5 minutes", 5.0f*60.0f, std::chrono::minutes{5}, true, false}, - {"30 minutes", 30.0f*60.0f, std::chrono::minutes{30}, true, false}, - {"1 hour", 60.0f*60.0f, std::chrono::minutes{60}, true, false}, - {"1 day", 24.0f*60.0f*60.0f, std::chrono::minutes{24*60}, true, true}, - {"100 days", 100.0f*24.0f*60.0f*60.0f, std::chrono::minutes{100*24*60}, true, true}, - {"100 years", 100.0f*365.0f*24.0f*60.0f*60.0f, - /* MSVC 2017 (but not 2015) ICEs when assigning hours to minutes - (or just any other two different chrono types) in a struct array - initializer (not when there's just a struct and also not when - the struct is only a chrono member itself). Keeping at least one - instance here so I can monitor when this gets fixed. */ - #if !defined(CORRADE_MSVC2017_COMPATIBILITY) || defined(CORRADE_MSVC2015_COMPATIBLITY) - std::chrono::hours{100*365*24}, - #else - std::chrono::minutes{100*365*24*60}, - #endif - true, true}, - }; -} +const struct { + const char* name; + Float offsetFloat; + std::chrono::minutes offsetChrono; + bool failsFloat, failsFuzzyFloat; +} RunFor100YearsData[]{ + {"0", 0.0f, {}, false, false}, + {"1 minute", 60.0f, std::chrono::minutes(1), false, false}, + {"5 minutes", 5.0f*60.0f, std::chrono::minutes{5}, true, false}, + {"30 minutes", 30.0f*60.0f, std::chrono::minutes{30}, true, false}, + {"1 hour", 60.0f*60.0f, std::chrono::minutes{60}, true, false}, + {"1 day", 24.0f*60.0f*60.0f, std::chrono::minutes{24*60}, true, true}, + {"100 days", 100.0f*24.0f*60.0f*60.0f, std::chrono::minutes{100*24*60}, true, true}, + {"100 years", 100.0f*365.0f*24.0f*60.0f*60.0f, + /* MSVC 2017 (but not 2015) ICEs when assigning hours to minutes + (or just any other two different chrono types) in a struct array + initializer (not when there's just a struct and also not when + the struct is only a chrono member itself). Keeping at least one + instance here so I can monitor when this gets fixed. */ + #if !defined(CORRADE_MSVC2017_COMPATIBILITY) || defined(CORRADE_MSVC2015_COMPATIBLITY) + std::chrono::hours{100*365*24}, + #else + std::chrono::minutes{100*365*24*60}, + #endif + true, true}, +}; PlayerTest::PlayerTest() { addTests({&PlayerTest::constructEmpty, @@ -184,14 +182,12 @@ void PlayerTest::constructEmpty() { CORRADE_COMPARE(player.size(), 0); } -namespace { - const Animation::Track Track{{ - {1.0f, 1.5f}, - {2.5f, 3.0f}, - {3.0f, 5.0f}, - {4.0f, 2.0f} - }, Math::lerp}; -} +const Animation::Track Track{{ + {1.0f, 1.5f}, + {2.5f, 3.0f}, + {3.0f, 5.0f}, + {4.0f, 2.0f} +}, Math::lerp}; void PlayerTest::construct() { Animation::Track track2{{ @@ -1248,11 +1244,9 @@ void PlayerTest::addWithCallbackOnChangeTemplate() { CORRADE_COMPARE(data.called, 2); } -namespace { - /* Can't use raw lambdas because MSVC 2015 */ - void callback(std::vector& data, Int value) { - data.push_back(value); - } +/* Can't use raw lambdas because MSVC 2015 */ +void callback(std::vector& data, Int value) { + data.push_back(value); } void PlayerTest::addRawCallback() { @@ -1357,6 +1351,6 @@ void PlayerTest::debugState() { CORRADE_COMPARE(out.str(), "Animation::State::Playing Animation::State(0xde)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Animation::Test::PlayerTest) diff --git a/src/Magnum/Animation/Test/TrackTest.cpp b/src/Magnum/Animation/Test/TrackTest.cpp index c07a2f10d..f399bf983 100644 --- a/src/Magnum/Animation/Test/TrackTest.cpp +++ b/src/Magnum/Animation/Test/TrackTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Half.h" #include "Magnum/Math/Vector3.h" -namespace Magnum { namespace Animation { namespace Test { +namespace Magnum { namespace Animation { namespace Test { namespace { struct TrackTest: TestSuite::Tester { explicit TrackTest(); @@ -56,8 +56,6 @@ struct TrackTest: TestSuite::Tester { void atDifferentResultTypeStrict(); }; -namespace { - /* Reduced version from InterpolateTest, keep in sync with TrackViewTest */ const struct { const char* name; @@ -93,8 +91,6 @@ const struct { 6.0f, -1.5f, -1.5f, 2} }; -} - TrackTest::TrackTest() { addTests({&TrackTest::constructEmpty, &TrackTest::constructArrayInterpolator, @@ -217,9 +213,7 @@ void TrackTest::constructArrayInterpolationDefaults() { CORRADE_COMPARE(a.values()[0], (Vector3{3.0f, 1.0f, 0.1f})); } -namespace { - Vector3 customLerp(const Vector3&, const Vector3&, Float) { return {}; } -} +Vector3 customLerp(const Vector3&, const Vector3&, Float) { return {}; } void TrackTest::constructArrayInterpolationInterpolator() { const Track a{ @@ -437,10 +431,8 @@ void TrackTest::atStrict() { CORRADE_COMPARE(hint, data.expectedHint); } -namespace { - Float lerpHalf(const Half& a, const Half& b, Float t) { - return Math::lerp(Float(a), Float(b), t); - } +Float lerpHalf(const Half& a, const Half& b, Float t) { + return Math::lerp(Float(a), Float(b), t); } void TrackTest::atDifferentResultType() { @@ -472,6 +464,6 @@ void TrackTest::atDifferentResultTypeStrict() { CORRADE_COMPARE(hint, 2); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Animation::Test::TrackTest) diff --git a/src/Magnum/Animation/Test/TrackViewTest.cpp b/src/Magnum/Animation/Test/TrackViewTest.cpp index c569b3d36..e8c7e8a85 100644 --- a/src/Magnum/Animation/Test/TrackViewTest.cpp +++ b/src/Magnum/Animation/Test/TrackViewTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Half.h" #include "Magnum/Math/Vector3.h" -namespace Magnum { namespace Animation { namespace Test { +namespace Magnum { namespace Animation { namespace Test { namespace { struct TrackViewTest: TestSuite::Tester { explicit TrackViewTest(); @@ -56,8 +56,6 @@ struct TrackViewTest: TestSuite::Tester { void atDifferentResultTypeStrict(); }; -namespace { - /* Reduced version from InterpolateTest, keep in sync with TrackTest */ const struct { const char* name; @@ -93,8 +91,6 @@ const struct { 6.0f, -1.5f, -1.5f, 2} }; -} - TrackViewTest::TrackViewTest() { addTests({&TrackViewTest::constructEmpty, &TrackViewTest::constructInterpolator, @@ -204,9 +200,7 @@ void TrackViewTest::constructInterpolationDefaults() { CORRADE_COMPARE(a[1], (std::pair{5.0f, {0.3f, 0.6f, 1.0f}})); } -namespace { - Vector3 customLerp(const Vector3&, const Vector3&, Float) { return {}; } -} +Vector3 customLerp(const Vector3&, const Vector3&, Float) { return {}; } void TrackViewTest::constructInterpolationInterpolator() { constexpr Float keys[]{1.0f, 5.0f}; @@ -381,13 +375,12 @@ void TrackViewTest::constructCopyStorage() { CORRADE_COMPARE(bv[1], (std::pair{5.0f, {0.3f, 0.6f, 1.0f}})); } -namespace { - const std::pair Keyframes[]{ - {0.0f, 3.0f}, - {2.0f, 1.0f}, - {4.0f, 2.5f}, - {5.0f, 0.5f}}; -} +const std::pair Keyframes[]{ + {0.0f, 3.0f}, + {2.0f, 1.0f}, + {4.0f, 2.5f}, + {5.0f, 0.5f} +}; void TrackViewTest::at() { const auto& data = AtData[testCaseInstanceId()]; @@ -414,14 +407,12 @@ void TrackViewTest::atStrict() { CORRADE_COMPARE(hint, data.expectedHint); } -namespace { - using namespace Math::Literals; +using namespace Math::Literals; - const Half HalfValues[]{3.0_h, 1.0_h, 2.5_h, 0.5_h}; +const Half HalfValues[]{3.0_h, 1.0_h, 2.5_h, 0.5_h}; - Float lerpHalf(const Half& a, const Half& b, Float t) { - return Math::lerp(Float(a), Float(b), t); - } +Float lerpHalf(const Half& a, const Half& b, Float t) { + return Math::lerp(Float(a), Float(b), t); } void TrackViewTest::atDifferentResultType() { @@ -445,6 +436,6 @@ void TrackViewTest::atDifferentResultTypeStrict() { CORRADE_COMPARE(hint, 2); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Animation::Test::TrackViewTest) diff --git a/src/Magnum/Audio/Test/AbstractImporterTest.cpp b/src/Magnum/Audio/Test/AbstractImporterTest.cpp index d904b08ce..552f35430 100644 --- a/src/Magnum/Audio/Test/AbstractImporterTest.cpp +++ b/src/Magnum/Audio/Test/AbstractImporterTest.cpp @@ -31,7 +31,7 @@ #include "configure.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct AbstractImporterTest: TestSuite::Tester { explicit AbstractImporterTest(); @@ -71,6 +71,6 @@ void AbstractImporterTest::openFile() { CORRADE_VERIFY(importer.isOpened()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::AbstractImporterTest) diff --git a/src/Magnum/Audio/Test/BufferALTest.cpp b/src/Magnum/Audio/Test/BufferALTest.cpp index 958f3186b..850a4c989 100644 --- a/src/Magnum/Audio/Test/BufferALTest.cpp +++ b/src/Magnum/Audio/Test/BufferALTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Audio/Buffer.h" #include "Magnum/Audio/Context.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct BufferALTest: TestSuite::Tester { explicit BufferALTest(); @@ -47,6 +47,6 @@ void BufferALTest::construct() { CORRADE_VERIFY(buf.id() != 0); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::BufferALTest) diff --git a/src/Magnum/Audio/Test/BufferFormatTest.cpp b/src/Magnum/Audio/Test/BufferFormatTest.cpp index 64a931486..3410d8454 100644 --- a/src/Magnum/Audio/Test/BufferFormatTest.cpp +++ b/src/Magnum/Audio/Test/BufferFormatTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Audio/BufferFormat.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct BufferFormatTest: TestSuite::Tester { explicit BufferFormatTest(); @@ -46,6 +46,6 @@ void BufferFormatTest::debugFormat() { CORRADE_COMPARE(out.str(), "Audio::BufferFormat::Stereo16 Audio::BufferFormat(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::BufferFormatTest) diff --git a/src/Magnum/Audio/Test/ContextALTest.cpp b/src/Magnum/Audio/Test/ContextALTest.cpp index 5d9caefb0..b168e7c55 100644 --- a/src/Magnum/Audio/Test/ContextALTest.cpp +++ b/src/Magnum/Audio/Test/ContextALTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Audio/Extensions.h" #include "Magnum/Audio/Context.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct ContextALTest: TestSuite::Tester { explicit ContextALTest(); @@ -87,6 +87,6 @@ void ContextALTest::isExtensionEnabled() { CORRADE_VERIFY(Context::current().isExtensionSupported()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::ContextALTest) diff --git a/src/Magnum/Audio/Test/ContextTest.cpp b/src/Magnum/Audio/Test/ContextTest.cpp index 3a0b69b06..b5659c82b 100644 --- a/src/Magnum/Audio/Test/ContextTest.cpp +++ b/src/Magnum/Audio/Test/ContextTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Audio/Context.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct ContextTest: TestSuite::Tester { explicit ContextTest(); @@ -94,6 +94,6 @@ void ContextTest::debugHrtfStatus() { CORRADE_COMPARE(out.str(), "Audio::Context::HrtfStatus::Denied Audio::Context::HrtfStatus(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::ContextTest) diff --git a/src/Magnum/Audio/Test/ListenerALTest.cpp b/src/Magnum/Audio/Test/ListenerALTest.cpp index a8961c8e0..510c8262d 100644 --- a/src/Magnum/Audio/Test/ListenerALTest.cpp +++ b/src/Magnum/Audio/Test/ListenerALTest.cpp @@ -36,7 +36,7 @@ #include "Magnum/SceneGraph/MatrixTransformation2D.h" #include "Magnum/SceneGraph/MatrixTransformation3D.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { typedef SceneGraph::Scene Scene2D; typedef SceneGraph::Object Object2D; @@ -106,6 +106,6 @@ void ListenerALTest::updateGroups() { CORRADE_COMPARE(playable.source().position(), offset*13.0f); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::ListenerALTest) diff --git a/src/Magnum/Audio/Test/PlayableALTest.cpp b/src/Magnum/Audio/Test/PlayableALTest.cpp index 511078058..db15ea2df 100644 --- a/src/Magnum/Audio/Test/PlayableALTest.cpp +++ b/src/Magnum/Audio/Test/PlayableALTest.cpp @@ -33,7 +33,7 @@ #include "Magnum/SceneGraph/Object.h" #include "Magnum/SceneGraph/MatrixTransformation3D.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { typedef SceneGraph::Scene Scene3D; typedef SceneGraph::Object Object3D; @@ -100,6 +100,6 @@ void PlayableALTest::group() { group.stop(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::PlayableALTest) diff --git a/src/Magnum/Audio/Test/RendererALTest.cpp b/src/Magnum/Audio/Test/RendererALTest.cpp index 8d075caf7..ddf1e97ad 100644 --- a/src/Magnum/Audio/Test/RendererALTest.cpp +++ b/src/Magnum/Audio/Test/RendererALTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Audio/Context.h" #include "Magnum/Audio/Renderer.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct RendererALTest: TestSuite::Tester { explicit RendererALTest(); @@ -105,6 +105,6 @@ void RendererALTest::distanceModel() { CORRADE_COMPARE(Renderer::distanceModel(), model); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::RendererALTest) diff --git a/src/Magnum/Audio/Test/RendererTest.cpp b/src/Magnum/Audio/Test/RendererTest.cpp index 4311ac6c5..c49885b5e 100644 --- a/src/Magnum/Audio/Test/RendererTest.cpp +++ b/src/Magnum/Audio/Test/RendererTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Magnum.h" #include "Magnum/Audio/Renderer.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct RendererTest: TestSuite::Tester { explicit RendererTest(); @@ -55,6 +55,6 @@ void RendererTest::debugDistanceModel() { CORRADE_COMPARE(out.str(), "Audio::Renderer::DistanceModel::Inverse Audio::Renderer::DistanceModel(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::RendererTest) diff --git a/src/Magnum/Audio/Test/SourceALTest.cpp b/src/Magnum/Audio/Test/SourceALTest.cpp index ea836b6eb..66fe83cb3 100644 --- a/src/Magnum/Audio/Test/SourceALTest.cpp +++ b/src/Magnum/Audio/Test/SourceALTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Audio/Context.h" #include "Magnum/Audio/Source.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct SourceALTest: TestSuite::Tester { explicit SourceALTest(); @@ -168,6 +168,6 @@ void SourceALTest::rolloffFactor() { CORRADE_COMPARE(source.rolloffFactor(), fact); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::SourceALTest) diff --git a/src/Magnum/Audio/Test/SourceTest.cpp b/src/Magnum/Audio/Test/SourceTest.cpp index e8d69b9da..7dc574cba 100644 --- a/src/Magnum/Audio/Test/SourceTest.cpp +++ b/src/Magnum/Audio/Test/SourceTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Audio/Source.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct SourceTest: TestSuite::Tester { explicit SourceTest(); @@ -46,6 +46,6 @@ void SourceTest::debugState() { CORRADE_COMPARE(out.str(), "Audio::Source::State::Playing Audio::Source::State(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::SourceTest) diff --git a/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp b/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp index fb856582a..dd446a1ed 100644 --- a/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp +++ b/src/Magnum/DebugTools/Test/BufferDataGLTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/DebugTools/BufferData.h" #include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace DebugTools { namespace Test { +namespace Magnum { namespace DebugTools { namespace Test { namespace { struct BufferDataGLTest: Magnum::GL::OpenGLTester { explicit BufferDataGLTest(); @@ -42,9 +42,7 @@ BufferDataGLTest::BufferDataGLTest() { &BufferDataGLTest::subData}); } -namespace { - constexpr Int Data[] = {2, 7, 5, 13, 25}; -} +constexpr Int Data[] = {2, 7, 5, 13, 25}; void BufferDataGLTest::data() { GL::Buffer buffer; @@ -64,6 +62,6 @@ void BufferDataGLTest::subData() { TestSuite::Compare::Container); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::DebugTools::Test::BufferDataGLTest) diff --git a/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp b/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp index 4d8f84f5e..988e29bc0 100644 --- a/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h" -namespace Magnum { namespace DebugTools { namespace Test { +namespace Magnum { namespace DebugTools { namespace Test { namespace { struct CapsuleRendererTest: TestSuite::Tester { explicit CapsuleRendererTest(); @@ -174,6 +174,6 @@ void CapsuleRendererTest::common3D() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::DebugTools::Test::CapsuleRendererTest) diff --git a/src/Magnum/DebugTools/Test/CompareImageTest.cpp b/src/Magnum/DebugTools/Test/CompareImageTest.cpp index 26201cd86..c813e06a0 100644 --- a/src/Magnum/DebugTools/Test/CompareImageTest.cpp +++ b/src/Magnum/DebugTools/Test/CompareImageTest.cpp @@ -40,7 +40,7 @@ #include "configure.h" -namespace Magnum { namespace DebugTools { namespace Test { +namespace Magnum { namespace DebugTools { namespace Test { namespace { struct CompareImageTest: TestSuite::Tester { explicit CompareImageTest(); @@ -166,27 +166,26 @@ CompareImageTest::CompareImageTest() { &CompareImageTest::fileToImageActualIsCompressed}); } -namespace { - const Float ActualRedData[] = { - 0.3f, 1.0f, 0.9f, - 0.9f, 0.6f, 0.2f, - -0.1f, 1.0f, 0.0f - }; +const Float ActualRedData[] = { + 0.3f, 1.0f, 0.9f, + 0.9f, 0.6f, 0.2f, + -0.1f, 1.0f, 0.0f +}; - const Float ExpectedRedData[] = { - 0.65f, 1.0f, 0.6f, - 0.91f, 0.6f, 0.1f, - 0.02f, 0.0f, 0.0f - }; +const Float ExpectedRedData[] = { + 0.65f, 1.0f, 0.6f, + 0.91f, 0.6f, 0.1f, + 0.02f, 0.0f, 0.0f +}; - const std::vector DeltaRed{ - 0.35f, 0.0f, 0.3f, - 0.01f, 0.0f, 0.1f, - 0.12f, 1.0f, 0.0f}; +const std::vector DeltaRed{ + 0.35f, 0.0f, 0.3f, + 0.01f, 0.0f, 0.1f, + 0.12f, 1.0f, 0.0f +}; - const ImageView2D ActualRed{PixelFormat::R32F, {3, 3}, ActualRedData}; - const ImageView2D ExpectedRed{PixelFormat::R32F, {3, 3}, ExpectedRedData}; -} +const ImageView2D ActualRed{PixelFormat::R32F, {3, 3}, ActualRedData}; +const ImageView2D ExpectedRed{PixelFormat::R32F, {3, 3}, ExpectedRedData}; void CompareImageTest::formatUnknown() { std::ostringstream out; @@ -242,25 +241,23 @@ void CompareImageTest::calculateDelta() { CORRADE_COMPARE(mean, 0.208889f); } -namespace { - /* Different storage for each */ - const UnsignedByte ActualRgbData[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0x56, 0xf8, 0x3a, 0x56, 0x47, 0xec, 0, 0, - 0x23, 0x57, 0x10, 0xab, 0xcd, 0x85, 0, 0 - }; +/* Different storage for each */ +const UnsignedByte ActualRgbData[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0x56, 0xf8, 0x3a, 0x56, 0x47, 0xec, 0, 0, + 0x23, 0x57, 0x10, 0xab, 0xcd, 0x85, 0, 0 +}; - const UnsignedByte ExpectedRgbData[] = { - 0, 0, 0, 0x55, 0xf8, 0x3a, 0x56, 0x10, 0xed, 0, 0, 0, - 0, 0, 0, 0x23, 0x27, 0x10, 0xab, 0xcd, 0xfa, 0, 0, 0 - }; +const UnsignedByte ExpectedRgbData[] = { + 0, 0, 0, 0x55, 0xf8, 0x3a, 0x56, 0x10, 0xed, 0, 0, 0, + 0, 0, 0, 0x23, 0x27, 0x10, 0xab, 0xcd, 0xfa, 0, 0, 0 +}; - const ImageView2D ActualRgb{PixelStorage{}.setSkip({0, 1, 0}), - PixelFormat::RGB8Unorm, {2, 2}, ActualRgbData}; - const ImageView2D ExpectedRgb{ - PixelStorage{}.setSkip({1, 0, 0}).setRowLength(3), - PixelFormat::RGB8Unorm, {2, 2}, ExpectedRgbData}; -} +const ImageView2D ActualRgb{PixelStorage{}.setSkip({0, 1, 0}), + PixelFormat::RGB8Unorm, {2, 2}, ActualRgbData}; +const ImageView2D ExpectedRgb{ + PixelStorage{}.setSkip({1, 0, 0}).setRowLength(3), + PixelFormat::RGB8Unorm, {2, 2}, ExpectedRgbData}; void CompareImageTest::calculateDeltaStorage() { std::vector delta; @@ -489,15 +486,13 @@ void CompareImageTest::teardownExternalPluginManager() { _manager = Containers::NullOpt; } -namespace { - constexpr const char* ImageCompareError = - "Images a and b have both max and mean delta above threshold, actual 39/18.5 but at most 20/10 expected. Delta image:\n" - " |?M|\n" - " Pixels above max/mean threshold:\n" - " [1,1] #abcd85, expected #abcdfa (Δ = 39)\n" - " [1,0] #5647ec, expected #5610ed (Δ = 18.6667)\n" - " [0,1] #235710, expected #232710 (Δ = 16)\n"; -} +constexpr const char* ImageCompareError = + "Images a and b have both max and mean delta above threshold, actual 39/18.5 but at most 20/10 expected. Delta image:\n" + " |?M|\n" + " Pixels above max/mean threshold:\n" + " [1,1] #abcd85, expected #abcdfa (Δ = 39)\n" + " [1,0] #5647ec, expected #5610ed (Δ = 18.6667)\n" + " [0,1] #235710, expected #232710 (Δ = 16)\n"; void CompareImageTest::image() { CORRADE_COMPARE_WITH(ActualRgb, ExpectedRgb, (CompareImage{40.0f, 20.0f})); @@ -936,6 +931,6 @@ void CompareImageTest::fileToImageActualIsCompressed() { "Actual image a (.../CompareImageCompressed.dds) is compressed, comparison not possible.\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::DebugTools::Test::CompareImageTest) diff --git a/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp b/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp index 415fe0731..6564f2f9f 100644 --- a/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/DebugTools/Implementation/CylinderRendererTransformation.h" -namespace Magnum { namespace DebugTools { namespace Test { +namespace Magnum { namespace DebugTools { namespace Test { namespace { struct CylinderRendererTest: TestSuite::Tester { explicit CylinderRendererTest(); @@ -122,6 +122,6 @@ void CylinderRendererTest::common3D() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::DebugTools::Test::CylinderRendererTest) diff --git a/src/Magnum/DebugTools/Test/ForceRendererTest.cpp b/src/Magnum/DebugTools/Test/ForceRendererTest.cpp index 155f87a36..c2f75c7a4 100644 --- a/src/Magnum/DebugTools/Test/ForceRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/ForceRendererTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/DebugTools/Implementation/ForceRendererTransformation.h" -namespace Magnum { namespace DebugTools { namespace Implementation { namespace Test { +namespace Magnum { namespace DebugTools { namespace Implementation { namespace Test { namespace { struct ForceRendererTest: TestSuite::Tester { explicit ForceRendererTest(); @@ -115,6 +115,6 @@ void ForceRendererTest::arbitrary3D() { TestSuite::Compare::Less); } -}}}} +}}}}} CORRADE_TEST_MAIN(Magnum::DebugTools::Implementation::Test::ForceRendererTest) diff --git a/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp b/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp index aceb01551..0ff4c534b 100644 --- a/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/DebugTools/Implementation/LineSegmentRendererTransformation.h" -namespace Magnum { namespace DebugTools { namespace Test { +namespace Magnum { namespace DebugTools { namespace Test { namespace { struct LineSegmentRendererTest: TestSuite::Tester { explicit LineSegmentRendererTest(); @@ -65,6 +65,6 @@ void LineSegmentRendererTest::line3D() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::DebugTools::Test::LineSegmentRendererTest) diff --git a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp index 8aa879bd0..85861a504 100644 --- a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp +++ b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp @@ -40,7 +40,7 @@ #include "Magnum/GL/BufferImage.h" #endif -namespace Magnum { namespace DebugTools { namespace Test { +namespace Magnum { namespace DebugTools { namespace Test { namespace { struct TextureImageGLTest: GL::OpenGLTester { explicit TextureImageGLTest(); @@ -83,12 +83,10 @@ TextureImageGLTest::TextureImageGLTest() { }); } -namespace { - constexpr UnsignedByte Data2D[] = { 0x00, 0x01, 0x02, 0x03, - 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, - 0x0c, 0x0d, 0x0e, 0x0f }; -} +constexpr UnsignedByte Data2D[] = { 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f }; void TextureImageGLTest::subImage2D() { GL::Texture2D texture; @@ -199,12 +197,10 @@ void TextureImageGLTest::subImageCubeBuffer() { #endif #ifndef MAGNUM_TARGET_GLES2 -namespace { - constexpr UnsignedInt Data2DUInt[] = { 0xcafebabe, - 0xdeadbeef, - 0xbadf00d, - 0xdeadbabe }; -} +constexpr UnsignedInt Data2DUInt[] = { 0xcafebabe, + 0xdeadbeef, + 0xbadf00d, + 0xdeadbabe }; void TextureImageGLTest::subImage2DUInt() { GL::Texture2D texture; @@ -221,12 +217,10 @@ void TextureImageGLTest::subImage2DUInt() { TestSuite::Compare::Container); } -namespace { - constexpr Float Data2DFloat[] = { 1.0f, - 3.14159f, - 2.71828f, - 1.41421f }; -} +constexpr Float Data2DFloat[] = { 1.0f, + 3.14159f, + 2.71828f, + 1.41421f }; void TextureImageGLTest::subImage2DFloat() { GL::Texture2D texture; @@ -261,6 +255,6 @@ void TextureImageGLTest::subImage2DFloatGeneric() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::DebugTools::Test::TextureImageGLTest) diff --git a/src/Magnum/GL/Test/AbstractObjectGLTest.cpp b/src/Magnum/GL/Test/AbstractObjectGLTest.cpp index e3a867a70..a47214a00 100644 --- a/src/Magnum/GL/Test/AbstractObjectGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractObjectGLTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/Extensions.h" #include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct AbstractObjectGLTest: OpenGLTester { explicit AbstractObjectGLTest(); @@ -52,6 +52,6 @@ void AbstractObjectGLTest::labelNoOp() { MAGNUM_VERIFY_NO_GL_ERROR(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractObjectGLTest) diff --git a/src/Magnum/GL/Test/AbstractQueryGLTest.cpp b/src/Magnum/GL/Test/AbstractQueryGLTest.cpp index a98629c97..909e3bfe0 100644 --- a/src/Magnum/GL/Test/AbstractQueryGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractQueryGLTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/OpenGLTester.h" #include "Magnum/GL/SampleQuery.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct AbstractQueryGLTest: OpenGLTester { explicit AbstractQueryGLTest(); @@ -143,6 +143,6 @@ void AbstractQueryGLTest::label() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractQueryGLTest) diff --git a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp index 40b3c78e2..8932697b2 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp @@ -43,7 +43,7 @@ #include "Magnum/Math/Vector4.h" #include "Magnum/Math/Color.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct AbstractShaderProgramGLTest: OpenGLTester { explicit AbstractShaderProgramGLTest(); @@ -126,12 +126,10 @@ AbstractShaderProgramGLTest::AbstractShaderProgramGLTest() { }); } -namespace { - class DummyShader: public AbstractShaderProgram { - public: - explicit DummyShader() {} - }; -} +class DummyShader: public AbstractShaderProgram { + public: + explicit DummyShader() {} +}; void AbstractShaderProgramGLTest::construct() { { @@ -183,21 +181,19 @@ void AbstractShaderProgramGLTest::label() { } #endif -namespace { - struct MyPublicShader: AbstractShaderProgram { - using AbstractShaderProgram::attachShaders; - using AbstractShaderProgram::bindAttributeLocation; - #ifndef MAGNUM_TARGET_GLES - using AbstractShaderProgram::bindFragmentDataLocationIndexed; - using AbstractShaderProgram::bindFragmentDataLocation; - #endif - using AbstractShaderProgram::link; - using AbstractShaderProgram::uniformLocation; - #ifndef MAGNUM_TARGET_GLES2 - using AbstractShaderProgram::uniformBlockIndex; - #endif - }; -} +struct MyPublicShader: AbstractShaderProgram { + using AbstractShaderProgram::attachShaders; + using AbstractShaderProgram::bindAttributeLocation; + #ifndef MAGNUM_TARGET_GLES + using AbstractShaderProgram::bindFragmentDataLocationIndexed; + using AbstractShaderProgram::bindFragmentDataLocation; + #endif + using AbstractShaderProgram::link; + using AbstractShaderProgram::uniformLocation; + #ifndef MAGNUM_TARGET_GLES2 + using AbstractShaderProgram::uniformBlockIndex; + #endif +}; void AbstractShaderProgramGLTest::create() { Utility::Resource rs("AbstractShaderProgramGLTest"); @@ -440,18 +436,16 @@ void AbstractShaderProgramGLTest::uniformNotFound() { "GL::AbstractShaderProgram: location of uniform 'another' cannot be retrieved\n"); } -namespace { - struct MyShader: AbstractShaderProgram { - explicit MyShader(); +struct MyShader: AbstractShaderProgram { + explicit MyShader(); - using AbstractShaderProgram::setUniform; + using AbstractShaderProgram::setUniform; - Int matrixUniform, - multiplierUniform, - colorUniform, - additionsUniform; - }; -} + Int matrixUniform, + multiplierUniform, + colorUniform, + additionsUniform; +}; #ifndef DOXYGEN_GENERATING_OUTPUT MyShader::MyShader() { @@ -546,19 +540,16 @@ void AbstractShaderProgramGLTest::uniformArray() { } #ifndef MAGNUM_TARGET_GLES +struct MyDoubleShader: AbstractShaderProgram { + explicit MyDoubleShader(); -namespace { - struct MyDoubleShader: AbstractShaderProgram { - explicit MyDoubleShader(); - - using AbstractShaderProgram::setUniform; + using AbstractShaderProgram::setUniform; - Int matrixUniform, - multiplierUniform, - colorUniform, - additionsUniform; - }; -} + Int matrixUniform, + multiplierUniform, + colorUniform, + additionsUniform; +}; #ifndef DOXYGEN_GENERATING_OUTPUT MyDoubleShader::MyDoubleShader() { @@ -720,16 +711,14 @@ void AbstractShaderProgramGLTest::uniformBlockIndexNotFound() { "GL::AbstractShaderProgram: index of uniform block 'another' cannot be retrieved\n"); } -namespace { - struct UniformBlockShader: AbstractShaderProgram { - explicit UniformBlockShader(); +struct UniformBlockShader: AbstractShaderProgram { + explicit UniformBlockShader(); - using AbstractShaderProgram::setUniformBlockBinding; + using AbstractShaderProgram::setUniformBlockBinding; - Int matricesUniformBlock, - materialUniformBlock; - }; -} + Int matricesUniformBlock, + materialUniformBlock; +}; #ifndef DOXYGEN_GENERATING_OUTPUT UniformBlockShader::UniformBlockShader() { @@ -854,6 +843,6 @@ void AbstractShaderProgramGLTest::compute() { #endif #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractShaderProgramGLTest) diff --git a/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp index 71c6af3fc..ac142662e 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp +++ b/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/AbstractShaderProgram.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct AbstractShaderProgramTest: TestSuite::Tester { explicit AbstractShaderProgramTest(); @@ -63,6 +63,6 @@ void AbstractShaderProgramTest::constructCopy() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractShaderProgramTest) diff --git a/src/Magnum/GL/Test/AbstractTextureGLTest.cpp b/src/Magnum/GL/Test/AbstractTextureGLTest.cpp index 5c4659d7e..7a95be5a5 100644 --- a/src/Magnum/GL/Test/AbstractTextureGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractTextureGLTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/Texture.h" #include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct AbstractTextureGLTest: OpenGLTester { explicit AbstractTextureGLTest(); @@ -103,6 +103,6 @@ void AbstractTextureGLTest::label() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractTextureGLTest) diff --git a/src/Magnum/GL/Test/AttributeTest.cpp b/src/Magnum/GL/Test/AttributeTest.cpp index e909bd1cc..a8dfc02a2 100644 --- a/src/Magnum/GL/Test/AttributeTest.cpp +++ b/src/Magnum/GL/Test/AttributeTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/AbstractShaderProgram.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct AttributeTest: TestSuite::Tester { explicit AttributeTest(); @@ -463,6 +463,6 @@ void AttributeTest::debugDataTypeVector4() { CORRADE_COMPARE(out.str(), "GL::Attribute::DataType::HalfFloat GL::Attribute::DataType(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::AttributeTest) diff --git a/src/Magnum/GL/Test/BufferGLTest.cpp b/src/Magnum/GL/Test/BufferGLTest.cpp index 8f43e50b9..f16baf096 100644 --- a/src/Magnum/GL/Test/BufferGLTest.cpp +++ b/src/Magnum/GL/Test/BufferGLTest.cpp @@ -33,7 +33,7 @@ #include "Magnum/GL/Extensions.h" #include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct BufferGLTest: OpenGLTester { explicit BufferGLTest(); @@ -410,6 +410,6 @@ void BufferGLTest::invalidate() { MAGNUM_VERIFY_NO_GL_ERROR(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::BufferGLTest) diff --git a/src/Magnum/GL/Test/BufferImageGLTest.cpp b/src/Magnum/GL/Test/BufferImageGLTest.cpp index a37f1160b..296fb9440 100644 --- a/src/Magnum/GL/Test/BufferImageGLTest.cpp +++ b/src/Magnum/GL/Test/BufferImageGLTest.cpp @@ -32,7 +32,7 @@ #include "Magnum/GL/PixelFormat.h" #include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct BufferImageGLTest: OpenGLTester { explicit BufferImageGLTest(); @@ -606,6 +606,6 @@ void BufferImageGLTest::releaseCompressed() { CORRADE_COMPARE(b.id(), id); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::BufferImageGLTest) diff --git a/src/Magnum/GL/Test/BufferImageTest.cpp b/src/Magnum/GL/Test/BufferImageTest.cpp index ba52459a4..04956a80a 100644 --- a/src/Magnum/GL/Test/BufferImageTest.cpp +++ b/src/Magnum/GL/Test/BufferImageTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/BufferImage.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct BufferImageTest: TestSuite::Tester { explicit BufferImageTest(); @@ -75,6 +75,6 @@ void BufferImageTest::constructCopyCompressed() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::BufferImageTest) diff --git a/src/Magnum/GL/Test/BufferTest.cpp b/src/Magnum/GL/Test/BufferTest.cpp index 2ea7202a8..740e0141e 100644 --- a/src/Magnum/GL/Test/BufferTest.cpp +++ b/src/Magnum/GL/Test/BufferTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/GL/Buffer.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct BufferTest: TestSuite::Tester { explicit BufferTest(); @@ -82,6 +82,6 @@ void BufferTest::debugTarget() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::BufferTest) diff --git a/src/Magnum/GL/Test/BufferTextureGLTest.cpp b/src/Magnum/GL/Test/BufferTextureGLTest.cpp index aca6ed026..d69b2ca8e 100644 --- a/src/Magnum/GL/Test/BufferTextureGLTest.cpp +++ b/src/Magnum/GL/Test/BufferTextureGLTest.cpp @@ -33,7 +33,7 @@ #include "Magnum/GL/ImageFormat.h" #include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct BufferTextureGLTest: OpenGLTester { explicit BufferTextureGLTest(); @@ -215,6 +215,6 @@ void BufferTextureGLTest::setBufferOffset() { MAGNUM_VERIFY_NO_GL_ERROR(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::BufferTextureGLTest) diff --git a/src/Magnum/GL/Test/BufferTextureTest.cpp b/src/Magnum/GL/Test/BufferTextureTest.cpp index e28781463..7e1901443 100644 --- a/src/Magnum/GL/Test/BufferTextureTest.cpp +++ b/src/Magnum/GL/Test/BufferTextureTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/BufferTexture.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct BufferTextureTest: TestSuite::Tester { explicit BufferTextureTest(); @@ -55,6 +55,6 @@ void BufferTextureTest::constructCopy() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::BufferTextureTest) diff --git a/src/Magnum/GL/Test/ContextGLTest.cpp b/src/Magnum/GL/Test/ContextGLTest.cpp index 057d8724b..63c234f0b 100644 --- a/src/Magnum/GL/Test/ContextGLTest.cpp +++ b/src/Magnum/GL/Test/ContextGLTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/GL/Extensions.h" #include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct ContextGLTest: OpenGLTester { explicit ContextGLTest(); @@ -127,6 +127,6 @@ void ContextGLTest::isExtensionDisabled() { #endif } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::ContextGLTest) diff --git a/src/Magnum/GL/Test/ContextTest.cpp b/src/Magnum/GL/Test/ContextTest.cpp index e55eb9397..4ef6811bd 100644 --- a/src/Magnum/GL/Test/ContextTest.cpp +++ b/src/Magnum/GL/Test/ContextTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/GL/Context.h" #include "Magnum/GL/Version.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct ContextTest: TestSuite::Tester { explicit ContextTest(); @@ -154,6 +154,6 @@ void ContextTest::debugDetectedDrivers() { #endif } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::ContextTest) diff --git a/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp index 3456ed01f..7279574eb 100644 --- a/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp @@ -37,7 +37,7 @@ #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct CubeMapTextureArrayGLTest: OpenGLTester { explicit CubeMapTextureArrayGLTest(); @@ -83,196 +83,194 @@ struct CubeMapTextureArrayGLTest: OpenGLTester { void invalidateSubImage(); }; -namespace { - struct GenericSampler { - typedef Magnum::SamplerFilter Filter; - typedef Magnum::SamplerMipmap Mipmap; - typedef Magnum::SamplerWrapping Wrapping; - }; - struct GLSampler { - typedef GL::SamplerFilter Filter; - typedef GL::SamplerMipmap Mipmap; - typedef GL::SamplerWrapping Wrapping; - }; - - constexpr UnsignedByte Data[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x16, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x1e, 0x4f, - - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f - }; - - enum: std::size_t { PixelStorageDataCount = 2 }; - - const struct { - const char* name; - Containers::ArrayView data; - PixelStorage storage; - Containers::ArrayView dataSparse; - std::size_t offset; - } PixelStorageData[PixelStorageDataCount]{ - {"default pixel storage", - Containers::arrayView(Data).suffix(16), {}, - Containers::arrayView(Data).suffix(16), 0}, - {"skip Z", - Containers::arrayView(Data).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), - Containers::arrayView(Data), 16} - }; - - /* Just 4x4 0x00 - 0x3f compressed using RGBA DXT3 by the driver, repeated - six times */ - constexpr UnsignedByte CompressedData[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2 - }; - - enum: std::size_t { CompressedPixelStorageDataCount = - #ifndef MAGNUM_TARGET_GLES - 2 - #else - 1 - #endif - }; +struct GenericSampler { + typedef Magnum::SamplerFilter Filter; + typedef Magnum::SamplerMipmap Mipmap; + typedef Magnum::SamplerWrapping Wrapping; +}; +struct GLSampler { + typedef GL::SamplerFilter Filter; + typedef GL::SamplerMipmap Mipmap; + typedef GL::SamplerWrapping Wrapping; +}; - const struct { - const char* name; - Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES - CompressedPixelStorage storage; - #endif - Containers::ArrayView dataSparse; - std::size_t offset; - } CompressedPixelStorageData[CompressedPixelStorageDataCount]{ - {"default pixel storage", - Containers::arrayView(CompressedData).suffix(16*4), - #ifndef MAGNUM_TARGET_GLES - {}, - #endif - Containers::arrayView(CompressedData).suffix(16*4), 0}, - #ifndef MAGNUM_TARGET_GLES - {"skip Z", - Containers::arrayView(CompressedData).suffix(16*4), - CompressedPixelStorage{} - .setCompressedBlockSize({4, 4, 1}) - .setCompressedBlockDataSize(16) - .setSkip({0, 0, 4}), - Containers::arrayView(CompressedData), 16*4} - #endif - }; - - constexpr UnsignedByte SubData[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f - }; - - enum: std::size_t { SubPixelStorageDataCount = 2 }; - - const struct { - const char* name; - Containers::ArrayView data; - PixelStorage storage; - Containers::ArrayView dataSparse; - std::size_t offset; - } SubPixelStorageData[SubPixelStorageDataCount]{ - {"default pixel storage", - Containers::arrayView(SubData).suffix(16), {}, - Containers::arrayView(SubData).suffix(16), 0}, - {"skip Z", - Containers::arrayView(SubData).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), - Containers::arrayView(SubData), 16} - }; - - /* Just 4x4x4 0x00 - 0xff compressed using RGBA DXT3 by the driver */ - constexpr UnsignedByte CompressedSubData[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 68, 84, 85, 101, 102, 118, 119, 119, - 239, 123, 8, 66, 213, 255, 170, 2, - 136, 136, 153, 153, 170, 170, 187, 187, - 247, 189, 16, 132, 213, 255, 170, 2, - 203, 204, 220, 221, 237, 238, 254, 255, - 255, 255, 24, 190, 213, 255, 170, 2 - }; - - enum: std::size_t { CompressedSubPixelStorageDataCount = - #ifndef MAGNUM_TARGET_GLES - 2 - #else - 1 - #endif - }; +constexpr UnsignedByte Data[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x16, 0x47, + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x1e, 0x4f, + + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f +}; - const struct { - const char* name; - Containers::ArrayView data; +enum: std::size_t { PixelStorageDataCount = 2 }; + +const struct { + const char* name; + Containers::ArrayView data; + PixelStorage storage; + Containers::ArrayView dataSparse; + std::size_t offset; +} PixelStorageData[PixelStorageDataCount]{ + {"default pixel storage", + Containers::arrayView(Data).suffix(16), {}, + Containers::arrayView(Data).suffix(16), 0}, + {"skip Z", + Containers::arrayView(Data).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), + Containers::arrayView(Data), 16} +}; + +/* Just 4x4 0x00 - 0x3f compressed using RGBA DXT3 by the driver, repeated + six times */ +constexpr UnsignedByte CompressedData[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2 +}; + +enum: std::size_t { CompressedPixelStorageDataCount = + #ifndef MAGNUM_TARGET_GLES + 2 + #else + 1 + #endif +}; + +const struct { + const char* name; + Containers::ArrayView data; + #ifndef MAGNUM_TARGET_GLES + CompressedPixelStorage storage; + #endif + Containers::ArrayView dataSparse; + std::size_t offset; +} CompressedPixelStorageData[CompressedPixelStorageDataCount]{ + {"default pixel storage", + Containers::arrayView(CompressedData).suffix(16*4), #ifndef MAGNUM_TARGET_GLES - CompressedPixelStorage storage; + {}, #endif - Containers::ArrayView dataSparse; - std::size_t offset; - } CompressedSubPixelStorageData[CompressedSubPixelStorageDataCount]{ - {"default pixel storage", - Containers::arrayView(CompressedSubData).suffix(16*4), - #ifndef MAGNUM_TARGET_GLES - {}, - #endif - Containers::arrayView(CompressedSubData).suffix(16*4), 0}, + Containers::arrayView(CompressedData).suffix(16*4), 0}, + #ifndef MAGNUM_TARGET_GLES + {"skip Z", + Containers::arrayView(CompressedData).suffix(16*4), + CompressedPixelStorage{} + .setCompressedBlockSize({4, 4, 1}) + .setCompressedBlockDataSize(16) + .setSkip({0, 0, 4}), + Containers::arrayView(CompressedData), 16*4} + #endif +}; + +constexpr UnsignedByte SubData[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f +}; + +enum: std::size_t { SubPixelStorageDataCount = 2 }; + +const struct { + const char* name; + Containers::ArrayView data; + PixelStorage storage; + Containers::ArrayView dataSparse; + std::size_t offset; +} SubPixelStorageData[SubPixelStorageDataCount]{ + {"default pixel storage", + Containers::arrayView(SubData).suffix(16), {}, + Containers::arrayView(SubData).suffix(16), 0}, + {"skip Z", + Containers::arrayView(SubData).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), + Containers::arrayView(SubData), 16} +}; + +/* Just 4x4x4 0x00 - 0xff compressed using RGBA DXT3 by the driver */ +constexpr UnsignedByte CompressedSubData[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 68, 84, 85, 101, 102, 118, 119, 119, + 239, 123, 8, 66, 213, 255, 170, 2, + 136, 136, 153, 153, 170, 170, 187, 187, + 247, 189, 16, 132, 213, 255, 170, 2, + 203, 204, 220, 221, 237, 238, 254, 255, + 255, 255, 24, 190, 213, 255, 170, 2 +}; + +enum: std::size_t { CompressedSubPixelStorageDataCount = + #ifndef MAGNUM_TARGET_GLES + 2 + #else + 1 + #endif +}; + +const struct { + const char* name; + Containers::ArrayView data; + #ifndef MAGNUM_TARGET_GLES + CompressedPixelStorage storage; + #endif + Containers::ArrayView dataSparse; + std::size_t offset; +} CompressedSubPixelStorageData[CompressedSubPixelStorageDataCount]{ + {"default pixel storage", + Containers::arrayView(CompressedSubData).suffix(16*4), #ifndef MAGNUM_TARGET_GLES - {"skip Z", - Containers::arrayView(CompressedSubData).suffix(16*4), - CompressedPixelStorage{} - .setCompressedBlockSize({4, 4, 1}) - .setCompressedBlockDataSize(16) - .setSkip({0, 0, 4}), - Containers::arrayView(CompressedSubData), 16*4} + {}, #endif - }; -} + Containers::arrayView(CompressedSubData).suffix(16*4), 0}, + #ifndef MAGNUM_TARGET_GLES + {"skip Z", + Containers::arrayView(CompressedSubData).suffix(16*4), + CompressedPixelStorage{} + .setCompressedBlockSize({4, 4, 1}) + .setCompressedBlockDataSize(16) + .setSkip({0, 0, 4}), + Containers::arrayView(CompressedSubData), 16*4} + #endif +}; CubeMapTextureArrayGLTest::CubeMapTextureArrayGLTest() { addTests({&CubeMapTextureArrayGLTest::construct, @@ -725,42 +723,40 @@ void CubeMapTextureArrayGLTest::compressedImageBuffer() { #endif } -namespace { - constexpr UnsignedByte Zero[4*4*4*6]{}; - #ifndef MAGNUM_TARGET_GLES - constexpr UnsignedByte SubDataComplete[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, - 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0, 0, 0, 0, - 0, 0, 0, 0, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0, 0, 0, 0, - 0, 0, 0, 0, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0, 0, 0, 0, - 0, 0, 0, 0, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - #endif -} +constexpr UnsignedByte Zero[4*4*4*6]{}; +#ifndef MAGNUM_TARGET_GLES +constexpr UnsignedByte SubDataComplete[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, + 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0, 0, 0, 0, + 0, 0, 0, 0, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0, 0, 0, 0, + 0, 0, 0, 0, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0, 0, 0, 0, + 0, 0, 0, 0, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif void CubeMapTextureArrayGLTest::subImage() { setTestCaseDescription(SubPixelStorageData[testCaseInstanceId()].name); @@ -886,73 +882,71 @@ void CubeMapTextureArrayGLTest::subImageQueryBuffer() { } #endif -namespace { - /* Just 12x12x6 zeros compressed using RGBA DXT3 by the driver */ - constexpr UnsignedByte CompressedZero[9*16*6]{}; +/* Just 12x12x6 zeros compressed using RGBA DXT3 by the driver */ +constexpr UnsignedByte CompressedZero[9*16*6]{}; - #ifndef MAGNUM_TARGET_GLES - /* Combination of CompressedZero and CompressedSubData */ - constexpr UnsignedByte CompressedSubDataComplete[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 68, 84, 85, 101, 102, 118, 119, 119, - 239, 123, 8, 66, 213, 255, 170, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 136, 136, 153, 153, 170, 170, 187, 187, - 247, 189, 16, 132, 213, 255, 170, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 203, 204, 220, 221, 237, 238, 254, 255, - 255, 255, 24, 190, 213, 255, 170, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - #endif -} +#ifndef MAGNUM_TARGET_GLES +/* Combination of CompressedZero and CompressedSubData */ +constexpr UnsignedByte CompressedSubDataComplete[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 84, 85, 101, 102, 118, 119, 119, + 239, 123, 8, 66, 213, 255, 170, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 136, 153, 153, 170, 170, 187, 187, + 247, 189, 16, 132, 213, 255, 170, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 203, 204, 220, 221, 237, 238, 254, 255, + 255, 255, 24, 190, 213, 255, 170, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif void CubeMapTextureArrayGLTest::compressedSubImage() { setTestCaseDescription(CompressedSubPixelStorageData[testCaseInstanceId()].name); @@ -1173,6 +1167,6 @@ void CubeMapTextureArrayGLTest::invalidateSubImage() { MAGNUM_VERIFY_NO_GL_ERROR(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::CubeMapTextureArrayGLTest) diff --git a/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp b/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp index 7513e484a..8f5e7c984 100644 --- a/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/CubeMapTextureArray.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct CubeMapTextureArrayTest: TestSuite::Tester { explicit CubeMapTextureArrayTest(); @@ -55,6 +55,6 @@ void CubeMapTextureArrayTest::constructCopy() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::CubeMapTextureArrayTest) diff --git a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp index ea6479e8d..be1eca08d 100644 --- a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp @@ -41,7 +41,7 @@ #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct CubeMapTextureGLTest: OpenGLTester { explicit CubeMapTextureGLTest(); @@ -117,185 +117,182 @@ struct CubeMapTextureGLTest: OpenGLTester { void invalidateSubImage(); }; -namespace { - struct GenericSampler { - typedef Magnum::SamplerFilter Filter; - typedef Magnum::SamplerMipmap Mipmap; - typedef Magnum::SamplerWrapping Wrapping; - }; - struct GLSampler { - typedef GL::SamplerFilter Filter; - typedef GL::SamplerMipmap Mipmap; - typedef GL::SamplerWrapping Wrapping; - }; - - constexpr UnsignedByte Data[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; - - enum: std::size_t { PixelStorageDataCount = - #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) - 2 - #else - 1 - #endif - }; - - const struct { - const char* name; - Containers::ArrayView data; - PixelStorage storage; - Containers::ArrayView dataSparse; - std::size_t offset; - } PixelStorageData[PixelStorageDataCount]{ - {"default pixel storage", - Containers::arrayView(Data).suffix(8), {}, - Containers::arrayView(Data).suffix(8), 0}, - #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) - {"skip Y", - Containers::arrayView(Data).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), - Containers::arrayView(Data), 8} - #endif - }; +struct GenericSampler { + typedef Magnum::SamplerFilter Filter; + typedef Magnum::SamplerMipmap Mipmap; + typedef Magnum::SamplerWrapping Wrapping; +}; +struct GLSampler { + typedef GL::SamplerFilter Filter; + typedef GL::SamplerMipmap Mipmap; + typedef GL::SamplerWrapping Wrapping; +}; - /* Just 4x4 0x00 - 0x3f compressed using RGBA DXT3 by the driver */ - constexpr UnsignedByte CompressedData[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2 - }; +constexpr UnsignedByte Data[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; - enum: std::size_t { CompressedPixelStorageDataCount = - #ifndef MAGNUM_TARGET_GLES - 2 - #else - 1 - #endif - }; +enum: std::size_t { PixelStorageDataCount = + #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) + 2 + #else + 1 + #endif +}; - const struct { - const char* name; - Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES - CompressedPixelStorage storage; - #endif - Containers::ArrayView dataSparse; - std::size_t offset; - } CompressedPixelStorageData[CompressedPixelStorageDataCount]{ - {"default pixel storage", - Containers::arrayView(CompressedData).suffix(16), - #ifndef MAGNUM_TARGET_GLES - {}, - #endif - Containers::arrayView(CompressedData).suffix(16), 0}, +const struct { + const char* name; + Containers::ArrayView data; + PixelStorage storage; + Containers::ArrayView dataSparse; + std::size_t offset; +} PixelStorageData[PixelStorageDataCount]{ + {"default pixel storage", + Containers::arrayView(Data).suffix(8), {}, + Containers::arrayView(Data).suffix(8), 0}, + #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) + {"skip Y", + Containers::arrayView(Data).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), + Containers::arrayView(Data), 8} + #endif +}; + +/* Just 4x4 0x00 - 0x3f compressed using RGBA DXT3 by the driver */ +constexpr UnsignedByte CompressedData[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2 +}; + +enum: std::size_t { CompressedPixelStorageDataCount = + #ifndef MAGNUM_TARGET_GLES + 2 + #else + 1 + #endif +}; + +const struct { + const char* name; + Containers::ArrayView data; + #ifndef MAGNUM_TARGET_GLES + CompressedPixelStorage storage; + #endif + Containers::ArrayView dataSparse; + std::size_t offset; +} CompressedPixelStorageData[CompressedPixelStorageDataCount]{ + {"default pixel storage", + Containers::arrayView(CompressedData).suffix(16), #ifndef MAGNUM_TARGET_GLES - {"skip Y", - Containers::arrayView(CompressedData).suffix(16), - CompressedPixelStorage{} - .setCompressedBlockSize({4, 4, 1}) - .setCompressedBlockDataSize(16) - .setSkip({0, 4, 0}), - Containers::arrayView(CompressedData), 16} + {}, #endif - }; - + Containers::arrayView(CompressedData).suffix(16), 0}, #ifndef MAGNUM_TARGET_GLES - constexpr UnsignedByte FullData[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + {"skip Y", + Containers::arrayView(CompressedData).suffix(16), + CompressedPixelStorage{} + .setCompressedBlockSize({4, 4, 1}) + .setCompressedBlockDataSize(16) + .setSkip({0, 4, 0}), + Containers::arrayView(CompressedData), 16} + #endif +}; - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, +#ifndef MAGNUM_TARGET_GLES +constexpr UnsignedByte FullData[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f - }; + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - enum: std::size_t { FullPixelStorageDataCount = 2 }; + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f +}; - const struct { - const char* name; - Containers::ArrayView data; - PixelStorage storage; - std::size_t offset; - } FullPixelStorageData[FullPixelStorageDataCount]{ - {"default pixel storage", - Containers::arrayView(FullData).suffix(16), {}, 0}, - #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) - {"skip Z", - Containers::arrayView(FullData).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), 16} - #endif - }; - - /* Just 4x4 0x00 - 0x3f compressed using RGBA DXT3 by the driver, repeated - six times */ - constexpr UnsignedByte CompressedFullData[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2 - }; - - enum: std::size_t { CompressedFullPixelStorageDataCount = - #ifndef MAGNUM_TARGET_GLES - 2 - #else - 1 - #endif - }; +enum: std::size_t { FullPixelStorageDataCount = 2 }; + +const struct { + const char* name; + Containers::ArrayView data; + PixelStorage storage; + std::size_t offset; +} FullPixelStorageData[FullPixelStorageDataCount]{ + {"default pixel storage", + Containers::arrayView(FullData).suffix(16), {}, 0}, + #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) + {"skip Z", + Containers::arrayView(FullData).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), 16} + #endif +}; - const struct { - const char* name; - Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES - CompressedPixelStorage storage; - #endif - std::size_t offset; - } CompressedFullPixelStorageData[CompressedFullPixelStorageDataCount]{ - {"default pixel storage", - Containers::arrayView(CompressedFullData).suffix(16*4), - #ifndef MAGNUM_TARGET_GLES - {}, - #endif - 0}, +/* Just 4x4 0x00 - 0x3f compressed using RGBA DXT3 by the driver, repeated + six times */ +constexpr UnsignedByte CompressedFullData[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2 +}; + +enum: std::size_t { CompressedFullPixelStorageDataCount = + #ifndef MAGNUM_TARGET_GLES + 2 + #else + 1 + #endif +}; + +const struct { + const char* name; + Containers::ArrayView data; + #ifndef MAGNUM_TARGET_GLES + CompressedPixelStorage storage; + #endif + std::size_t offset; +} CompressedFullPixelStorageData[CompressedFullPixelStorageDataCount]{ + {"default pixel storage", + Containers::arrayView(CompressedFullData).suffix(16*4), #ifndef MAGNUM_TARGET_GLES - {"skip Z", - Containers::arrayView(CompressedFullData).suffix(16*4), - CompressedPixelStorage{} - .setCompressedBlockSize({4, 4, 1}) - .setCompressedBlockDataSize(16) - .setSkip({0, 0, 4}), 16*4} + {}, #endif - }; + 0}, + #ifndef MAGNUM_TARGET_GLES + {"skip Z", + Containers::arrayView(CompressedFullData).suffix(16*4), + CompressedPixelStorage{} + .setCompressedBlockSize({4, 4, 1}) + .setCompressedBlockDataSize(16) + .setSkip({0, 0, 4}), 16*4} #endif - -} +}; +#endif CubeMapTextureGLTest::CubeMapTextureGLTest() { addTests({&CubeMapTextureGLTest::construct, @@ -374,11 +371,9 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() { &CubeMapTextureGLTest::invalidateSubImage}); } -namespace { - template Containers::ArrayView unsafeSuffix(const T(&data)[size], std::size_t offset) { - static_assert(sizeof(T) == 1, ""); - return {data - offset, size + offset}; - } +template Containers::ArrayView unsafeSuffix(const T(&data)[size], std::size_t offset) { + static_assert(sizeof(T) == 1, ""); + return {data - offset, size + offset}; } void CubeMapTextureGLTest::construct() { @@ -627,9 +622,7 @@ void CubeMapTextureGLTest::storage() { #endif } -namespace { - constexpr UnsignedByte Zero[4*4*4]{}; -} +constexpr UnsignedByte Zero[4*4*4]{}; void CubeMapTextureGLTest::image() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); @@ -721,16 +714,14 @@ void CubeMapTextureGLTest::imageBuffer() { } #endif -namespace { - #ifndef MAGNUM_TARGET_GLES - constexpr UnsignedByte SubDataComplete[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, - 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - #endif -} +#ifndef MAGNUM_TARGET_GLES +constexpr UnsignedByte SubDataComplete[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, + 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif void CubeMapTextureGLTest::subImage() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); @@ -1037,36 +1028,34 @@ void CubeMapTextureGLTest::immutableCompressedImage() { } #endif -namespace { - /* Just 12x12 zeros compressed using RGBA DXT3 by the driver */ - constexpr UnsignedByte CompressedZero[9*16]{}; +/* Just 12x12 zeros compressed using RGBA DXT3 by the driver */ +constexpr UnsignedByte CompressedZero[9*16]{}; - #ifndef MAGNUM_TARGET_GLES - /* Combination of CompressedZero and CompressedData */ - constexpr UnsignedByte CompressedSubDataComplete[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 - }; - #endif -} +#ifndef MAGNUM_TARGET_GLES +/* Combination of CompressedZero and CompressedData */ +constexpr UnsignedByte CompressedSubDataComplete[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif void CubeMapTextureGLTest::compressedSubImage() { setTestCaseDescription(CompressedPixelStorageData[testCaseInstanceId()].name); @@ -1458,6 +1447,6 @@ void CubeMapTextureGLTest::invalidateSubImage() { } } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::CubeMapTextureGLTest) diff --git a/src/Magnum/GL/Test/CubeMapTextureTest.cpp b/src/Magnum/GL/Test/CubeMapTextureTest.cpp index 7d5e25a95..3c7e80a8f 100644 --- a/src/Magnum/GL/Test/CubeMapTextureTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/CubeMapTexture.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct CubeMapTextureTest: TestSuite::Tester { explicit CubeMapTextureTest(); @@ -55,6 +55,6 @@ void CubeMapTextureTest::constructCopy() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::CubeMapTextureTest) diff --git a/src/Magnum/GL/Test/DebugOutputGLTest.cpp b/src/Magnum/GL/Test/DebugOutputGLTest.cpp index f6ee7ae4d..6a5db1ad3 100644 --- a/src/Magnum/GL/Test/DebugOutputGLTest.cpp +++ b/src/Magnum/GL/Test/DebugOutputGLTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/GL/Extensions.h" #include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct DebugOutputGLTest: OpenGLTester { explicit DebugOutputGLTest(); @@ -173,6 +173,6 @@ void DebugOutputGLTest::groupFallback() { MAGNUM_VERIFY_NO_GL_ERROR(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::DebugOutputGLTest) diff --git a/src/Magnum/GL/Test/DebugOutputTest.cpp b/src/Magnum/GL/Test/DebugOutputTest.cpp index 34f7ad01e..d9c8bd31e 100644 --- a/src/Magnum/GL/Test/DebugOutputTest.cpp +++ b/src/Magnum/GL/Test/DebugOutputTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/DebugOutput.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct DebugOutputTest: TestSuite::Tester { explicit DebugOutputTest(); @@ -90,6 +90,6 @@ void DebugOutputTest::debugGroupSource() { CORRADE_COMPARE(o.str(), "GL::DebugGroup::Source::ThirdParty GL::DebugGroup::Source(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::DebugOutputTest) diff --git a/src/Magnum/GL/Test/DefaultFramebufferTest.cpp b/src/Magnum/GL/Test/DefaultFramebufferTest.cpp index 7b3b8f3de..9ff0fa23a 100644 --- a/src/Magnum/GL/Test/DefaultFramebufferTest.cpp +++ b/src/Magnum/GL/Test/DefaultFramebufferTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/DefaultFramebuffer.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct DefaultFramebufferTest: TestSuite::Tester { explicit DefaultFramebufferTest(); @@ -47,6 +47,6 @@ void DefaultFramebufferTest::debugStatus() { CORRADE_COMPARE(out.str(), "GL::DefaultFramebuffer::Status::Complete GL::DefaultFramebuffer::Status(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::DefaultFramebufferTest) diff --git a/src/Magnum/GL/Test/FramebufferGLTest.cpp b/src/Magnum/GL/Test/FramebufferGLTest.cpp index fd5bf2b01..b3c97b768 100644 --- a/src/Magnum/GL/Test/FramebufferGLTest.cpp +++ b/src/Magnum/GL/Test/FramebufferGLTest.cpp @@ -50,7 +50,7 @@ #include "Magnum/GL/RectangleTexture.h" #endif -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct FramebufferGLTest: OpenGLTester { explicit FramebufferGLTest(); @@ -1368,10 +1368,8 @@ void FramebufferGLTest::invalidateSub() { } #endif -namespace { - const auto DataStorage = PixelStorage{}.setSkip({0, 16, 0}); - const std::size_t DataOffset = 16*8; -} +const auto DataStorage = PixelStorage{}.setSkip({0, 16, 0}); +const std::size_t DataOffset = 16*8; void FramebufferGLTest::read() { #ifndef MAGNUM_TARGET_GLES @@ -1523,16 +1521,14 @@ void FramebufferGLTest::readBuffer() { } #endif -namespace { - constexpr char StorageData[]{ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f - }; +constexpr char StorageData[]{ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f +}; - constexpr char ZeroStorage[4*4*4*6]{}; -} +constexpr char ZeroStorage[4*4*4*6]{}; #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::copyImageTexture1D() { @@ -2096,6 +2092,6 @@ void FramebufferGLTest::blit() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::FramebufferGLTest) diff --git a/src/Magnum/GL/Test/FramebufferTest.cpp b/src/Magnum/GL/Test/FramebufferTest.cpp index 8e0271159..e69516975 100644 --- a/src/Magnum/GL/Test/FramebufferTest.cpp +++ b/src/Magnum/GL/Test/FramebufferTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/Framebuffer.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct FramebufferTest: TestSuite::Tester { explicit FramebufferTest(); @@ -67,6 +67,6 @@ void FramebufferTest::debugStatus() { CORRADE_COMPARE(out.str(), "GL::Framebuffer::Status::IncompleteMissingAttachment GL::Framebuffer::Status(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::FramebufferTest) diff --git a/src/Magnum/GL/Test/MeshGLTest.cpp b/src/Magnum/GL/Test/MeshGLTest.cpp index 3fd73ea78..e1863fb3b 100644 --- a/src/Magnum/GL/Test/MeshGLTest.cpp +++ b/src/Magnum/GL/Test/MeshGLTest.cpp @@ -44,7 +44,7 @@ #include "Magnum/Math/Matrix.h" #include "Magnum/Math/Vector4.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { /* Tests also the MeshView class. */ @@ -304,11 +304,9 @@ void MeshGLTest::construct() { MAGNUM_VERIFY_NO_GL_ERROR(); } -namespace { - struct FloatShader: AbstractShaderProgram { - explicit FloatShader(const std::string& type, const std::string& conversion); - }; -} +struct FloatShader: AbstractShaderProgram { + explicit FloatShader(const std::string& type, const std::string& conversion); +}; void MeshGLTest::constructMove() { const Float data = Math::unpack(96); @@ -467,28 +465,26 @@ void MeshGLTest::label() { } #endif -namespace { - #ifndef MAGNUM_TARGET_GLES2 - struct IntegerShader: AbstractShaderProgram { - explicit IntegerShader(const std::string& type); - }; - #endif +#ifndef MAGNUM_TARGET_GLES2 +struct IntegerShader: AbstractShaderProgram { + explicit IntegerShader(const std::string& type); +}; +#endif - #ifndef MAGNUM_TARGET_GLES - struct DoubleShader: AbstractShaderProgram { - explicit DoubleShader(const std::string& type, const std::string& outputType, const std::string& conversion); - }; - #endif +#ifndef MAGNUM_TARGET_GLES +struct DoubleShader: AbstractShaderProgram { + explicit DoubleShader(const std::string& type, const std::string& outputType, const std::string& conversion); +}; +#endif - struct Checker { - Checker(AbstractShaderProgram&& shader, RenderbufferFormat format, Mesh& mesh); +struct Checker { + Checker(AbstractShaderProgram&& shader, RenderbufferFormat format, Mesh& mesh); - template T get(PixelFormat format, PixelType type); + template T get(PixelFormat format, PixelType type); - Renderbuffer renderbuffer; - Framebuffer framebuffer; - }; -} + Renderbuffer renderbuffer; + Framebuffer framebuffer; +}; #ifndef DOXYGEN_GENERATING_OUTPUT FloatShader::FloatShader(const std::string& type, const std::string& conversion) { @@ -1520,15 +1516,13 @@ void MeshGLTest::addVertexBufferBGRA() { } #endif -namespace { - struct MultipleShader: AbstractShaderProgram { - typedef Attribute<0, Vector3> Position; - typedef Attribute<1, Vector3> Normal; - typedef Attribute<2, Vector2> TextureCoordinates; +struct MultipleShader: AbstractShaderProgram { + typedef Attribute<0, Vector3> Position; + typedef Attribute<1, Vector3> Normal; + typedef Attribute<2, Vector2> TextureCoordinates; - explicit MultipleShader(); - }; -} + explicit MultipleShader(); +}; #ifndef DOXYGEN_GENERATING_OUTPUT MultipleShader::MultipleShader() { @@ -1811,59 +1805,57 @@ void MeshGLTest::addVertexBufferInstancedDynamicTransferOwnwership() { CORRADE_VERIFY(!glIsBuffer(id)); } -namespace { - const Float indexedVertexData[] = { - 0.0f, /* Offset */ +const Float indexedVertexData[] = { + 0.0f, /* Offset */ - /* First vertex */ - Math::unpack(64), + /* First vertex */ + Math::unpack(64), + Math::unpack(17), + Math::unpack(56), + Math::unpack(15), + Math::unpack(164), Math::unpack(17), - Math::unpack(56), - Math::unpack(15), - Math::unpack(164), - Math::unpack(17), - Math::unpack(97), - Math::unpack(28), + Math::unpack(97), + Math::unpack(28), - /* Second vertex */ - 0.3f, 0.1f, 0.5f, - 0.4f, 0.0f, -0.9f, - 1.0f, -0.5f - }; + /* Second vertex */ + 0.3f, 0.1f, 0.5f, + 0.4f, 0.0f, -0.9f, + 1.0f, -0.5f +}; - #ifndef MAGNUM_TARGET_GLES - const Float indexedVertexDataBaseVertex[] = { - 0.0f, 0.0f, /* Offset */ +#ifndef MAGNUM_TARGET_GLES +const Float indexedVertexDataBaseVertex[] = { + 0.0f, 0.0f, /* Offset */ - /* First vertex */ + /* First vertex */ + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, + 0.0f, 0.0f, - /* Second vertex */ + /* Second vertex */ + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, - - /* Third vertex */ - Math::unpack(64), + 0.0f, 0.0f, + + /* Third vertex */ + Math::unpack(64), + Math::unpack(17), + Math::unpack(56), + Math::unpack(15), + Math::unpack(164), Math::unpack(17), - Math::unpack(56), - Math::unpack(15), - Math::unpack(164), - Math::unpack(17), - Math::unpack(97), - Math::unpack(28), + Math::unpack(97), + Math::unpack(28), - /* Fourth vertex */ - 0.3f, 0.1f, 0.5f, - 0.4f, 0.0f, -0.9f, - 1.0f, -0.5f - }; - #endif + /* Fourth vertex */ + 0.3f, 0.1f, 0.5f, + 0.4f, 0.0f, -0.9f, + 1.0f, -0.5f +}; +#endif - constexpr Color4ub indexedResult(64 + 15 + 97, 17 + 164 + 28, 56 + 17, 255); -} +constexpr Color4ub indexedResult(64 + 15 + 97, 17 + 164 + 28, 56 + 17, 255); template void MeshGLTest::setIndexBuffer() { setTestCaseName(std::is_same::value ? @@ -2648,16 +2640,14 @@ void MeshGLTest::resetDivisorAfterInstancedDraw() { } } -namespace { - struct MultiChecker { - MultiChecker(AbstractShaderProgram&& shader, Mesh& mesh); +struct MultiChecker { + MultiChecker(AbstractShaderProgram&& shader, Mesh& mesh); - template T get(PixelFormat format, PixelType type); + template T get(PixelFormat format, PixelType type); - Renderbuffer renderbuffer; - Framebuffer framebuffer; - }; -} + Renderbuffer renderbuffer; + Framebuffer framebuffer; +}; #ifndef DOXYGEN_GENERATING_OUTPUT MultiChecker::MultiChecker(AbstractShaderProgram&& shader, Mesh& mesh): framebuffer({{}, Vector2i(1)}) { @@ -2775,6 +2765,6 @@ void MeshGLTest::multiDrawBaseVertex() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::MeshGLTest) diff --git a/src/Magnum/GL/Test/MeshTest.cpp b/src/Magnum/GL/Test/MeshTest.cpp index 0fa6290db..8f14b6e2d 100644 --- a/src/Magnum/GL/Test/MeshTest.cpp +++ b/src/Magnum/GL/Test/MeshTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/GL/Mesh.h" #include "Magnum/GL/MeshView.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { /* Tests MeshView as well */ @@ -131,11 +131,9 @@ void MeshTest::constructMoveNoCreate() { CORRADE_VERIFY(true); } -namespace { - struct Shader: AbstractShaderProgram { - explicit Shader(NoCreateT): AbstractShaderProgram{NoCreate} {} - }; -} +struct Shader: AbstractShaderProgram { + explicit Shader(NoCreateT): AbstractShaderProgram{NoCreate} {} +}; void MeshTest::drawCountNotSet() { std::ostringstream out; @@ -225,6 +223,6 @@ void MeshTest::debugIndexType() { CORRADE_COMPARE(o.str(), "GL::MeshIndexType::UnsignedShort GL::MeshIndexType(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::MeshTest) diff --git a/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp b/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp index d93e60c12..26097a2fe 100644 --- a/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp +++ b/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp @@ -34,7 +34,7 @@ #include "Magnum/Math/Vector3.h" #include "Magnum/Math/Functions.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct MultisampleTextureGLTest: OpenGLTester { explicit MultisampleTextureGLTest(); @@ -411,6 +411,6 @@ void MultisampleTextureGLTest::invalidateSubImage2DArray() { MAGNUM_VERIFY_NO_GL_ERROR(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::MultisampleTextureGLTest) diff --git a/src/Magnum/GL/Test/MultisampleTextureTest.cpp b/src/Magnum/GL/Test/MultisampleTextureTest.cpp index a612eac9d..e3ac4efc1 100644 --- a/src/Magnum/GL/Test/MultisampleTextureTest.cpp +++ b/src/Magnum/GL/Test/MultisampleTextureTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/MultisampleTexture.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct MultisampleTextureTest: TestSuite::Tester { explicit MultisampleTextureTest(); @@ -75,6 +75,6 @@ void MultisampleTextureTest::constructCopy2DArray() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::MultisampleTextureTest) diff --git a/src/Magnum/GL/Test/PixelFormatTest.cpp b/src/Magnum/GL/Test/PixelFormatTest.cpp index 58c7fdbf2..ab434a273 100644 --- a/src/Magnum/GL/Test/PixelFormatTest.cpp +++ b/src/Magnum/GL/Test/PixelFormatTest.cpp @@ -33,7 +33,7 @@ #include "Magnum/PixelStorage.h" #endif -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct PixelFormatTest: TestSuite::Tester { explicit PixelFormatTest(); @@ -523,6 +523,6 @@ void PixelFormatTest::debugCompressedPixelFormat() { CORRADE_COMPARE(out.str(), "GL::CompressedPixelFormat::RGBS3tcDxt1 GL::CompressedPixelFormat(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::PixelFormatTest) diff --git a/src/Magnum/GL/Test/PixelStorageGLTest.cpp b/src/Magnum/GL/Test/PixelStorageGLTest.cpp index 8269c06bd..7ac540812 100644 --- a/src/Magnum/GL/Test/PixelStorageGLTest.cpp +++ b/src/Magnum/GL/Test/PixelStorageGLTest.cpp @@ -40,7 +40,7 @@ #include "Magnum/GL/Framebuffer.h" #endif -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct PixelStorageGLTest: OpenGLTester { explicit PixelStorageGLTest(); @@ -81,24 +81,22 @@ PixelStorageGLTest::PixelStorageGLTest() { }); } -namespace { - constexpr const char Data2D[] = { - /* Row length ------------------------------------------------------ */ /* Alignment */ - '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', - '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', - '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', - /* ------------ Skip */ /* Data ------------------------------------ */ /* Alignment */ - '\x00', '\x00', '\x00', '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x00', - '\x00', '\x00', '\x00', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x00', - '\x00', '\x00', '\x00', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x00', - }; - - constexpr const char ActualData[] = { - '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x00', '\x00', - '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x00', '\x00', - '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x00', '\x00' - }; -} +constexpr const char Data2D[] = { + /* Row length ------------------------------------------------------ */ /* Alignment */ + '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', + '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', + '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', + /* ------------ Skip */ /* Data ------------------------------------ */ /* Alignment */ + '\x00', '\x00', '\x00', '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x00', + '\x00', '\x00', '\x00', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x00', + '\x00', '\x00', '\x00', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x00', +}; + +constexpr const char ActualData[] = { + '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x00', '\x00', + '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x00', '\x00', + '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x00', '\x00' +}; void PixelStorageGLTest::unpack2D() { #ifdef MAGNUM_TARGET_GLES2 @@ -173,26 +171,24 @@ void PixelStorageGLTest::pack2D() { } #ifndef MAGNUM_TARGET_GLES2 -namespace { - constexpr const char Data3D[] = { - /* Row length ------------------------------------------------------ */ /* Alignment */ - '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', - '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', - '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', - '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', - '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', - - /* Row length ------------------------------------------------------ */ /* Alignment */ - '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', - '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', - /* ------------ Skip */ /* Data ------------------------------------ */ /* Alignment */ - '\x00', '\x00', '\x00', '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x00', - '\x00', '\x00', '\x00', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x00', - '\x00', '\x00', '\x00', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x00', - - /* Filling to image height not needed */ - }; -} +constexpr const char Data3D[] = { + /* Row length ------------------------------------------------------ */ /* Alignment */ + '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', + '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', + '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', + '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', + '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', + + /* Row length ------------------------------------------------------ */ /* Alignment */ + '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', + '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', + /* ------------ Skip */ /* Data ------------------------------------ */ /* Alignment */ + '\x00', '\x00', '\x00', '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x00', + '\x00', '\x00', '\x00', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x00', + '\x00', '\x00', '\x00', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x00', + + /* Filling to image height not needed */ +}; void PixelStorageGLTest::unpack3D() { PixelStorage storage; @@ -260,29 +256,27 @@ void PixelStorageGLTest::pack3D() { #endif #ifndef MAGNUM_TARGET_GLES -namespace { - constexpr const UnsignedByte CompressedData2D[] = { - /* Skip */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2 - }; - - /* Just 4x4 0x00 - 0x3f compressed using RGBA DXT3 by the driver */ - constexpr const UnsignedByte ActualCompressedData[] = { - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - }; -} +constexpr const UnsignedByte CompressedData2D[] = { + /* Skip */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2 +}; + +/* Just 4x4 0x00 - 0x3f compressed using RGBA DXT3 by the driver */ +constexpr const UnsignedByte ActualCompressedData[] = { + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, +}; void PixelStorageGLTest::unpackCompressed2D() { if(!Context::current().isExtensionSupported()) @@ -339,58 +333,56 @@ void PixelStorageGLTest::packCompressed2D() { TestSuite::Compare::Container); } -namespace { - constexpr const UnsignedByte CompressedData3D[] = { - /* Skip image */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - /* Skip rows and pixels */ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2 - }; -} +constexpr const UnsignedByte CompressedData3D[] = { + /* Skip image */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + /* Skip rows and pixels */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2 +}; void PixelStorageGLTest::unpackCompressed3D() { if(!Context::current().isExtensionSupported()) @@ -450,6 +442,6 @@ void PixelStorageGLTest::packCompressed3D() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::PixelStorageGLTest) diff --git a/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp index 25b80cd2f..3e92aa30f 100644 --- a/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp +++ b/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp @@ -40,7 +40,7 @@ #include "Magnum/GL/TransformFeedback.h" #include "Magnum/Math/Vector2.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct PrimitiveQueryGLTest: OpenGLTester { explicit PrimitiveQueryGLTest(); @@ -404,6 +404,6 @@ void PrimitiveQueryGLTest::transformFeedbackOverflow() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::PrimitiveQueryGLTest) diff --git a/src/Magnum/GL/Test/PrimitiveQueryTest.cpp b/src/Magnum/GL/Test/PrimitiveQueryTest.cpp index 57fc864e5..442fafc89 100644 --- a/src/Magnum/GL/Test/PrimitiveQueryTest.cpp +++ b/src/Magnum/GL/Test/PrimitiveQueryTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/PrimitiveQuery.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct PrimitiveQueryTest: TestSuite::Tester { explicit PrimitiveQueryTest(); @@ -55,6 +55,6 @@ void PrimitiveQueryTest::constructCopy() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::PrimitiveQueryTest) diff --git a/src/Magnum/GL/Test/RectangleTextureGLTest.cpp b/src/Magnum/GL/Test/RectangleTextureGLTest.cpp index 6ab384486..6e28fad0e 100644 --- a/src/Magnum/GL/Test/RectangleTextureGLTest.cpp +++ b/src/Magnum/GL/Test/RectangleTextureGLTest.cpp @@ -38,7 +38,7 @@ #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct RectangleTextureGLTest: OpenGLTester { explicit RectangleTextureGLTest(); @@ -74,40 +74,38 @@ struct RectangleTextureGLTest: OpenGLTester { void invalidateSubImage(); }; -namespace { - struct GenericSampler { - typedef Magnum::SamplerFilter Filter; - typedef Magnum::SamplerWrapping Wrapping; - }; - struct GLSampler { - typedef GL::SamplerFilter Filter; - typedef GL::SamplerWrapping Wrapping; - }; - - constexpr UnsignedByte Data[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; - - enum: std::size_t { PixelStorageDataCount = 2 }; - - const struct { - const char* name; - Containers::ArrayView data; - PixelStorage storage; - Containers::ArrayView dataSparse; - std::size_t offset; - } PixelStorageData[PixelStorageDataCount]{ - {"default pixel storage", - Containers::arrayView(Data).suffix(8), {}, - Containers::arrayView(Data).suffix(8), 0}, - #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) - {"skip Y", - Containers::arrayView(Data).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), - Containers::arrayView(Data), 8} - #endif - }; -} +struct GenericSampler { + typedef Magnum::SamplerFilter Filter; + typedef Magnum::SamplerWrapping Wrapping; +}; +struct GLSampler { + typedef GL::SamplerFilter Filter; + typedef GL::SamplerWrapping Wrapping; +}; + +constexpr UnsignedByte Data[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; + +enum: std::size_t { PixelStorageDataCount = 2 }; + +const struct { + const char* name; + Containers::ArrayView data; + PixelStorage storage; + Containers::ArrayView dataSparse; + std::size_t offset; +} PixelStorageData[PixelStorageDataCount]{ + {"default pixel storage", + Containers::arrayView(Data).suffix(8), {}, + Containers::arrayView(Data).suffix(8), 0}, + #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) + {"skip Y", + Containers::arrayView(Data).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), + Containers::arrayView(Data), 8} + #endif +}; RectangleTextureGLTest::RectangleTextureGLTest() { addTests({&RectangleTextureGLTest::construct, @@ -361,15 +359,13 @@ void RectangleTextureGLTest::imageBuffer() { TestSuite::Compare::Container); } -namespace { - constexpr UnsignedByte Zero[4*4*4]{}; - constexpr UnsignedByte SubDataComplete[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, - 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; -} +constexpr UnsignedByte Zero[4*4*4]{}; +constexpr UnsignedByte SubDataComplete[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, + 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; void RectangleTextureGLTest::subImage() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); @@ -523,6 +519,6 @@ void RectangleTextureGLTest::invalidateSubImage() { MAGNUM_VERIFY_NO_GL_ERROR(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::RectangleTextureGLTest) diff --git a/src/Magnum/GL/Test/RectangleTextureTest.cpp b/src/Magnum/GL/Test/RectangleTextureTest.cpp index 0046ba67a..cfb142733 100644 --- a/src/Magnum/GL/Test/RectangleTextureTest.cpp +++ b/src/Magnum/GL/Test/RectangleTextureTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/RectangleTexture.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct RectangleTextureTest: TestSuite::Tester { explicit RectangleTextureTest(); @@ -55,6 +55,6 @@ void RectangleTextureTest::constructCopy() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::RectangleTextureTest) diff --git a/src/Magnum/GL/Test/RenderbufferGLTest.cpp b/src/Magnum/GL/Test/RenderbufferGLTest.cpp index 8ef6da53b..832cfa257 100644 --- a/src/Magnum/GL/Test/RenderbufferGLTest.cpp +++ b/src/Magnum/GL/Test/RenderbufferGLTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/GL/RenderbufferFormat.h" #include "Magnum/Math/Vector2.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct RenderbufferGLTest: OpenGLTester { explicit RenderbufferGLTest(); @@ -191,6 +191,6 @@ void RenderbufferGLTest::setStorageMultisample() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::RenderbufferGLTest) diff --git a/src/Magnum/GL/Test/RenderbufferTest.cpp b/src/Magnum/GL/Test/RenderbufferTest.cpp index 04953d07c..4694a8c44 100644 --- a/src/Magnum/GL/Test/RenderbufferTest.cpp +++ b/src/Magnum/GL/Test/RenderbufferTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/Renderbuffer.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct RenderbufferTest: TestSuite::Tester { explicit RenderbufferTest(); @@ -55,6 +55,6 @@ void RenderbufferTest::constructNoCreate() { CORRADE_VERIFY(true); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::RenderbufferTest) diff --git a/src/Magnum/GL/Test/RendererGLTest.cpp b/src/Magnum/GL/Test/RendererGLTest.cpp index e046be625..355a64a61 100644 --- a/src/Magnum/GL/Test/RendererGLTest.cpp +++ b/src/Magnum/GL/Test/RendererGLTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/OpenGLTester.h" #include "Magnum/Math/Range.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct RendererGLTest: OpenGLTester { explicit RendererGLTest(); @@ -60,6 +60,6 @@ void RendererGLTest::maxLineWidth() { MAGNUM_VERIFY_NO_GL_ERROR(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::RendererGLTest) diff --git a/src/Magnum/GL/Test/RendererTest.cpp b/src/Magnum/GL/Test/RendererTest.cpp index 3d84c7791..4fc283749 100644 --- a/src/Magnum/GL/Test/RendererTest.cpp +++ b/src/Magnum/GL/Test/RendererTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/Renderer.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct RendererTest: TestSuite::Tester { explicit RendererTest(); @@ -72,6 +72,6 @@ void RendererTest::debugGraphicsResetStatus() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::RendererTest) diff --git a/src/Magnum/GL/Test/SampleQueryGLTest.cpp b/src/Magnum/GL/Test/SampleQueryGLTest.cpp index 2d78f0c48..151d7817e 100644 --- a/src/Magnum/GL/Test/SampleQueryGLTest.cpp +++ b/src/Magnum/GL/Test/SampleQueryGLTest.cpp @@ -38,7 +38,7 @@ #include "Magnum/GL/SampleQuery.h" #include "Magnum/GL/Shader.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct SampleQueryGLTest: OpenGLTester { explicit SampleQueryGLTest(); @@ -89,13 +89,11 @@ void SampleQueryGLTest::wrap() { #endif } -namespace { - struct MyShader: public AbstractShaderProgram { - typedef Attribute<0, Vector2> Position; +struct MyShader: public AbstractShaderProgram { + typedef Attribute<0, Vector2> Position; - explicit MyShader(); - }; -} + explicit MyShader(); +}; #ifndef DOXYGEN_GENERATING_OUTPUT MyShader::MyShader() { @@ -268,6 +266,6 @@ void SampleQueryGLTest::conditionalRender() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::SampleQueryGLTest) diff --git a/src/Magnum/GL/Test/SampleQueryTest.cpp b/src/Magnum/GL/Test/SampleQueryTest.cpp index db3e227bc..b444ee6d1 100644 --- a/src/Magnum/GL/Test/SampleQueryTest.cpp +++ b/src/Magnum/GL/Test/SampleQueryTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/SampleQuery.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct SampleQueryTest: TestSuite::Tester { explicit SampleQueryTest(); @@ -55,6 +55,6 @@ void SampleQueryTest::constructCopy() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::SampleQueryTest) diff --git a/src/Magnum/GL/Test/SamplerTest.cpp b/src/Magnum/GL/Test/SamplerTest.cpp index 1fd4608d7..e7e1200f7 100644 --- a/src/Magnum/GL/Test/SamplerTest.cpp +++ b/src/Magnum/GL/Test/SamplerTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Sampler.h" #include "Magnum/GL/Sampler.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct SamplerTest: TestSuite::Tester { explicit SamplerTest(); @@ -205,6 +205,6 @@ void SamplerTest::debugDepthStencilMode() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::SamplerTest) diff --git a/src/Magnum/GL/Test/ShaderGLTest.cpp b/src/Magnum/GL/Test/ShaderGLTest.cpp index 860460643..270fdac9e 100644 --- a/src/Magnum/GL/Test/ShaderGLTest.cpp +++ b/src/Magnum/GL/Test/ShaderGLTest.cpp @@ -32,7 +32,7 @@ #include "configure.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct ShaderGLTest: OpenGLTester { explicit ShaderGLTest(); @@ -298,6 +298,6 @@ void ShaderGLTest::compileNoVersion() { CORRADE_VERIFY(shader.compile()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::ShaderGLTest) diff --git a/src/Magnum/GL/Test/ShaderTest.cpp b/src/Magnum/GL/Test/ShaderTest.cpp index 394d72a29..0a9c4c242 100644 --- a/src/Magnum/GL/Test/ShaderTest.cpp +++ b/src/Magnum/GL/Test/ShaderTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/Shader.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct ShaderTest: TestSuite::Tester { explicit ShaderTest(); @@ -54,6 +54,6 @@ void ShaderTest::debugType() { CORRADE_COMPARE(out.str(), "GL::Shader::Type::Fragment GL::Shader::Type(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::ShaderTest) diff --git a/src/Magnum/GL/Test/TextureArrayGLTest.cpp b/src/Magnum/GL/Test/TextureArrayGLTest.cpp index e7cb654d2..172f6ce8d 100644 --- a/src/Magnum/GL/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/TextureArrayGLTest.cpp @@ -40,7 +40,7 @@ #include "Magnum/GL/ImageFormat.h" #endif -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct TextureArrayGLTest: OpenGLTester { explicit TextureArrayGLTest(); @@ -155,112 +155,109 @@ struct TextureArrayGLTest: OpenGLTester { void invalidateSubImage2D(); }; -namespace { - struct GenericSampler { - typedef Magnum::SamplerFilter Filter; - typedef Magnum::SamplerMipmap Mipmap; - typedef Magnum::SamplerWrapping Wrapping; - }; - struct GLSampler { - typedef GL::SamplerFilter Filter; - typedef GL::SamplerMipmap Mipmap; - typedef GL::SamplerWrapping Wrapping; - }; +struct GenericSampler { + typedef Magnum::SamplerFilter Filter; + typedef Magnum::SamplerMipmap Mipmap; + typedef Magnum::SamplerWrapping Wrapping; +}; +struct GLSampler { + typedef GL::SamplerFilter Filter; + typedef GL::SamplerMipmap Mipmap; + typedef GL::SamplerWrapping Wrapping; +}; + +#ifndef MAGNUM_TARGET_GLES +constexpr UnsignedByte Data1D[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f +}; + +enum: std::size_t { PixelStorage1DDataCount = 2 }; + +const struct { + const char* name; + Containers::ArrayView data; + PixelStorage storage; + Containers::ArrayView dataSparse; + std::size_t offset; +} PixelStorage1DData[PixelStorage1DDataCount]{ + {"default pixel storage", + Containers::arrayView(Data1D).suffix(8), {}, + Containers::arrayView(Data1D).suffix(8), 0}, + {"skip Y", + Containers::arrayView(Data1D).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), + Containers::arrayView(Data1D), 8}}; +#endif + +constexpr UnsignedByte Data2D[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f +}; + +enum: std::size_t { PixelStorage2DDataCount = 2 }; + +const struct { + const char* name; + Containers::ArrayView data; + PixelStorage storage; + Containers::ArrayView dataSparse; + std::size_t offset; +} PixelStorage2DData[PixelStorage2DDataCount]{ + {"default pixel storage", + Containers::arrayView(Data2D).suffix(16), {}, + Containers::arrayView(Data2D).suffix(16), 0}, + {"skip Z", + Containers::arrayView(Data2D).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), + Containers::arrayView(Data2D), 16}}; + +/* Just 4x4x3 0x00 - 0x7f compressed using RGBA DXT3 by the driver */ +constexpr UnsignedByte CompressedData2D[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 68, 84, 85, 101, 102, 118, 119, 119, + 239, 123, 8, 66, 213, 255, 170, 2 +}; +enum: std::size_t { CompressedPixelStorage2DDataCount = #ifndef MAGNUM_TARGET_GLES - constexpr UnsignedByte Data1D[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f - }; - - enum: std::size_t { PixelStorage1DDataCount = 2 }; - - const struct { - const char* name; - Containers::ArrayView data; - PixelStorage storage; - Containers::ArrayView dataSparse; - std::size_t offset; - } PixelStorage1DData[PixelStorage1DDataCount]{ - {"default pixel storage", - Containers::arrayView(Data1D).suffix(8), {}, - Containers::arrayView(Data1D).suffix(8), 0}, - {"skip Y", - Containers::arrayView(Data1D).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), - Containers::arrayView(Data1D), 8}}; - #endif - - constexpr UnsignedByte Data2D[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f - }; - - enum: std::size_t { PixelStorage2DDataCount = 2 }; - - const struct { - const char* name; - Containers::ArrayView data; - PixelStorage storage; - Containers::ArrayView dataSparse; - std::size_t offset; - } PixelStorage2DData[PixelStorage2DDataCount]{ - {"default pixel storage", - Containers::arrayView(Data2D).suffix(16), {}, - Containers::arrayView(Data2D).suffix(16), 0}, - {"skip Z", - Containers::arrayView(Data2D).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), - Containers::arrayView(Data2D), 16}}; - - /* Just 4x4x3 0x00 - 0x7f compressed using RGBA DXT3 by the driver */ - constexpr UnsignedByte CompressedData2D[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 68, 84, 85, 101, 102, 118, 119, 119, - 239, 123, 8, 66, 213, 255, 170, 2 - }; - - enum: std::size_t { CompressedPixelStorage2DDataCount = - #ifndef MAGNUM_TARGET_GLES - 2 - #else - 1 - #endif - }; + 2 + #else + 1 + #endif +}; - const struct { - const char* name; - Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES - CompressedPixelStorage storage; - #endif - Containers::ArrayView dataSparse; - std::size_t offset; - } CompressedPixelStorage2DData[CompressedPixelStorage2DDataCount]{ - {"default pixel storage", - Containers::arrayView(CompressedData2D).suffix(16), - #ifndef MAGNUM_TARGET_GLES - {}, - #endif - Containers::arrayView(CompressedData2D).suffix(16), 0}, +const struct { + const char* name; + Containers::ArrayView data; + #ifndef MAGNUM_TARGET_GLES + CompressedPixelStorage storage; + #endif + Containers::ArrayView dataSparse; + std::size_t offset; +} CompressedPixelStorage2DData[CompressedPixelStorage2DDataCount]{ + {"default pixel storage", + Containers::arrayView(CompressedData2D).suffix(16), #ifndef MAGNUM_TARGET_GLES - {"skip Y", - Containers::arrayView(CompressedData2D).suffix(16), - CompressedPixelStorage{} - .setCompressedBlockSize({4, 4, 1}) - .setCompressedBlockDataSize(16) - .setSkip({0, 0, 1}), - Containers::arrayView(CompressedData2D), 16} + {}, #endif - }; - -} + Containers::arrayView(CompressedData2D).suffix(16), 0}, + #ifndef MAGNUM_TARGET_GLES + {"skip Y", + Containers::arrayView(CompressedData2D).suffix(16), + CompressedPixelStorage{} + .setCompressedBlockSize({4, 4, 1}) + .setCompressedBlockDataSize(16) + .setSkip({0, 0, 1}), + Containers::arrayView(CompressedData2D), 16} + #endif +}; TextureArrayGLTest::TextureArrayGLTest() { addTests({ @@ -894,15 +891,13 @@ void TextureArrayGLTest::image1DBuffer() { TestSuite::Compare::Container); } -namespace { - constexpr UnsignedByte Zero1D[4*4*4] = {}; - constexpr UnsignedByte SubData1DComplete[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, - 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; -} +constexpr UnsignedByte Zero1D[4*4*4] = {}; +constexpr UnsignedByte SubData1DComplete[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, + 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; void TextureArrayGLTest::subImage1D() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); @@ -1099,33 +1094,31 @@ void TextureArrayGLTest::image2DBuffer() { #endif } -namespace { - constexpr UnsignedByte Zero2D[4*4*4*4]{}; +constexpr UnsignedByte Zero2D[4*4*4*4]{}; - #ifndef MAGNUM_TARGET_GLES - constexpr UnsignedByte SubData2DComplete[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, - 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0, 0, 0, 0, - 0, 0, 0, 0, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - #endif -} +#ifndef MAGNUM_TARGET_GLES +constexpr UnsignedByte SubData2DComplete[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, + 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0, 0, 0, 0, + 0, 0, 0, 0, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif void TextureArrayGLTest::subImage2D() { setTestCaseDescription(PixelStorage2DData[testCaseInstanceId()].name); @@ -1332,43 +1325,41 @@ void TextureArrayGLTest::compressedImage2DBuffer() { #endif } -namespace { - /* Just 12x4x4 zeros compressed using RGBA DXT3 by the driver */ - constexpr UnsignedByte CompressedZero2D[3*4*16]{}; +/* Just 12x4x4 zeros compressed using RGBA DXT3 by the driver */ +constexpr UnsignedByte CompressedZero2D[3*4*16]{}; - #ifndef MAGNUM_TARGET_GLES - /* Combination of CompressedZero2D and CompressedData2D */ - constexpr UnsignedByte CompressedSubData2DComplete[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 68, 84, 85, 101, 102, 118, 119, 119, - 239, 123, 8, 66, 213, 255, 170, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 - }; - #endif -} +#ifndef MAGNUM_TARGET_GLES +/* Combination of CompressedZero2D and CompressedData2D */ +constexpr UnsignedByte CompressedSubData2DComplete[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 68, 84, 85, 101, 102, 118, 119, 119, + 239, 123, 8, 66, 213, 255, 170, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif void TextureArrayGLTest::compressedSubImage2D() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); @@ -1648,6 +1639,6 @@ void TextureArrayGLTest::invalidateSubImage2D() { MAGNUM_VERIFY_NO_GL_ERROR(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::TextureArrayGLTest) diff --git a/src/Magnum/GL/Test/TextureArrayTest.cpp b/src/Magnum/GL/Test/TextureArrayTest.cpp index ce6322df3..90c05d036 100644 --- a/src/Magnum/GL/Test/TextureArrayTest.cpp +++ b/src/Magnum/GL/Test/TextureArrayTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/TextureArray.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct TextureArrayTest: TestSuite::Tester { explicit TextureArrayTest(); @@ -88,6 +88,6 @@ void TextureArrayTest::constructCopy2D() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::TextureArrayTest) diff --git a/src/Magnum/GL/Test/TextureGLTest.cpp b/src/Magnum/GL/Test/TextureGLTest.cpp index 97f463a61..33ca06570 100644 --- a/src/Magnum/GL/Test/TextureGLTest.cpp +++ b/src/Magnum/GL/Test/TextureGLTest.cpp @@ -41,7 +41,7 @@ #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct TextureGLTest: OpenGLTester { explicit TextureGLTest(); @@ -234,202 +234,200 @@ struct TextureGLTest: OpenGLTester { void srgbAlphaStorage(); }; -namespace { - struct GenericSampler { - typedef Magnum::SamplerFilter Filter; - typedef Magnum::SamplerMipmap Mipmap; - typedef Magnum::SamplerWrapping Wrapping; - }; - struct GLSampler { - typedef GL::SamplerFilter Filter; - typedef GL::SamplerMipmap Mipmap; - typedef GL::SamplerWrapping Wrapping; - }; +struct GenericSampler { + typedef Magnum::SamplerFilter Filter; + typedef Magnum::SamplerMipmap Mipmap; + typedef Magnum::SamplerWrapping Wrapping; +}; +struct GLSampler { + typedef GL::SamplerFilter Filter; + typedef GL::SamplerMipmap Mipmap; + typedef GL::SamplerWrapping Wrapping; +}; - #ifndef MAGNUM_TARGET_GLES - constexpr UnsignedByte Data1D[]{ - 0, 0, 0, 0, - 0x00, 0x01, 0x02, 0x03, - 0x04, 0x05, 0x06, 0x07 - }; - - enum: std::size_t { PixelStorage1DDataCount = 2 }; - - const struct { - const char* name; - Containers::ArrayView data; - PixelStorage storage; - Containers::ArrayView dataSparse; - std::size_t offset; - } PixelStorage1DData[PixelStorage1DDataCount]{ - {"default pixel storage", - Containers::arrayView(Data1D).suffix(4), {}, - Containers::arrayView(Data1D).suffix(4), 0}, - {"skip X", - Containers::arrayView(Data1D).suffix(4), PixelStorage{}.setSkip({1, 0, 0}), - Containers::arrayView(Data1D), 4}}; - #endif - - constexpr UnsignedByte Data2D[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f - }; - - enum: std::size_t { PixelStorage2DDataCount = - #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) - 2 - #else - 1 - #endif - }; - - const struct { - const char* name; - Containers::ArrayView data; - PixelStorage storage; - Containers::ArrayView dataSparse; - std::size_t offset; - } PixelStorage2DData[PixelStorage2DDataCount]{ - {"default pixel storage", - Containers::arrayView(Data2D).suffix(8), {}, - Containers::arrayView(Data2D).suffix(8), 0}, - #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) - {"skip Y", - Containers::arrayView(Data2D).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), - Containers::arrayView(Data2D), 8} - #endif - }; +#ifndef MAGNUM_TARGET_GLES +constexpr UnsignedByte Data1D[]{ + 0, 0, 0, 0, + 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07 +}; - /* Just 4x8 0x00 - 0x3f compressed using RGBA DXT3 by the driver */ - constexpr UnsignedByte CompressedData2D[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2 - }; +enum: std::size_t { PixelStorage1DDataCount = 2 }; + +const struct { + const char* name; + Containers::ArrayView data; + PixelStorage storage; + Containers::ArrayView dataSparse; + std::size_t offset; +} PixelStorage1DData[PixelStorage1DDataCount]{ + {"default pixel storage", + Containers::arrayView(Data1D).suffix(4), {}, + Containers::arrayView(Data1D).suffix(4), 0}, + {"skip X", + Containers::arrayView(Data1D).suffix(4), PixelStorage{}.setSkip({1, 0, 0}), + Containers::arrayView(Data1D), 4}}; +#endif - enum: std::size_t { CompressedPixelStorage2DDataCount = - #ifndef MAGNUM_TARGET_GLES - 2 - #else - 1 - #endif - }; +constexpr UnsignedByte Data2D[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f +}; - const struct { - const char* name; - Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES - CompressedPixelStorage storage; - #endif - Containers::ArrayView dataSparse; - std::size_t offset; - } CompressedPixelStorage2DData[CompressedPixelStorage2DDataCount]{ - {"default pixel storage", - Containers::arrayView(CompressedData2D).suffix(16), - #ifndef MAGNUM_TARGET_GLES - {}, - #endif - Containers::arrayView(CompressedData2D).suffix(16), 0}, - #ifndef MAGNUM_TARGET_GLES - {"skip Y", - Containers::arrayView(CompressedData2D).suffix(16), - CompressedPixelStorage{} - .setCompressedBlockSize({4, 4, 1}) - .setCompressedBlockDataSize(16) - .setSkip({0, 4, 0}), - Containers::arrayView(CompressedData2D), 16} - #endif - }; +enum: std::size_t { PixelStorage2DDataCount = + #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) + 2 + #else + 1 + #endif +}; - constexpr UnsignedByte Data3D[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const struct { + const char* name; + Containers::ArrayView data; + PixelStorage storage; + Containers::ArrayView dataSparse; + std::size_t offset; +} PixelStorage2DData[PixelStorage2DDataCount]{ + {"default pixel storage", + Containers::arrayView(Data2D).suffix(8), {}, + Containers::arrayView(Data2D).suffix(8), 0}, + #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) + {"skip Y", + Containers::arrayView(Data2D).suffix(8), PixelStorage{}.setSkip({0, 1, 0}), + Containers::arrayView(Data2D), 8} + #endif +}; - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, +/* Just 4x8 0x00 - 0x3f compressed using RGBA DXT3 by the driver */ +constexpr UnsignedByte CompressedData2D[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2 +}; - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }; +enum: std::size_t { CompressedPixelStorage2DDataCount = + #ifndef MAGNUM_TARGET_GLES + 2 + #else + 1 + #endif +}; - enum: std::size_t { PixelStorage3DDataCount = - #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) - 2 - #else - 1 - #endif - }; - - const struct { - const char* name; - Containers::ArrayView data; - PixelStorage storage; - Containers::ArrayView dataSparse; - std::size_t offset; - } PixelStorage3DData[PixelStorage3DDataCount]{ - {"default pixel storage", - Containers::arrayView(Data3D).suffix(16), {}, - Containers::arrayView(Data3D).suffix(16), 0}, - #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) - {"skip Z", - Containers::arrayView(Data3D).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), - Containers::arrayView(Data3D), 16} - #endif - }; - - /* Just 4x4x8 0x00 - 0xff compressed using RGBA BPTC Unorm by the driver */ - constexpr UnsignedByte CompressedData3D[]{ - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 144, 224, 128, 3, 80, 0, 129, 170, - 84, 253, 73, 36, 109, 100, 107, 255, - 144, 232, 161, 135, 94, 244, 129, 170, - 84, 253, 65, 34, 109, 100, 107, 255, - - 144, 240, 194, 11, 47, 248, 130, 170, - 84, 253, 65, 34, 109, 100, 107, 251, - 144, 247, 223, 143, 63, 252, 131, 170, - 84, 253, 73, 34, 109, 100, 91, 251 - }; - - enum: std::size_t { CompressedPixelStorage3DDataCount = +const struct { + const char* name; + Containers::ArrayView data; + #ifndef MAGNUM_TARGET_GLES + CompressedPixelStorage storage; + #endif + Containers::ArrayView dataSparse; + std::size_t offset; +} CompressedPixelStorage2DData[CompressedPixelStorage2DDataCount]{ + {"default pixel storage", + Containers::arrayView(CompressedData2D).suffix(16), #ifndef MAGNUM_TARGET_GLES - 2 - #else - 1 + {}, #endif - }; + Containers::arrayView(CompressedData2D).suffix(16), 0}, + #ifndef MAGNUM_TARGET_GLES + {"skip Y", + Containers::arrayView(CompressedData2D).suffix(16), + CompressedPixelStorage{} + .setCompressedBlockSize({4, 4, 1}) + .setCompressedBlockDataSize(16) + .setSkip({0, 4, 0}), + Containers::arrayView(CompressedData2D), 16} + #endif +}; - const struct { - const char* name; - Containers::ArrayView data; - #ifndef MAGNUM_TARGET_GLES - CompressedPixelStorage storage; - #endif - Containers::ArrayView dataSparse; - std::size_t offset; - } CompressedPixelStorage3DData[CompressedPixelStorage3DDataCount]{ - {"default pixel storage", - Containers::arrayView(CompressedData3D).suffix(16*4), - #ifndef MAGNUM_TARGET_GLES - {}, - #endif - Containers::arrayView(CompressedData3D).suffix(16*4), 0}, +constexpr UnsignedByte Data3D[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }; + +enum: std::size_t { PixelStorage3DDataCount = + #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) + 2 + #else + 1 + #endif +}; + +const struct { + const char* name; + Containers::ArrayView data; + PixelStorage storage; + Containers::ArrayView dataSparse; + std::size_t offset; +} PixelStorage3DData[PixelStorage3DDataCount]{ + {"default pixel storage", + Containers::arrayView(Data3D).suffix(16), {}, + Containers::arrayView(Data3D).suffix(16), 0}, + #if !defined(MAGNUM_TARGET_GLES2) || !defined(MAGNUM_TARGET_WEBGL) + {"skip Z", + Containers::arrayView(Data3D).suffix(16), PixelStorage{}.setSkip({0, 0, 1}), + Containers::arrayView(Data3D), 16} + #endif +}; + +/* Just 4x4x8 0x00 - 0xff compressed using RGBA BPTC Unorm by the driver */ +constexpr UnsignedByte CompressedData3D[]{ + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 144, 224, 128, 3, 80, 0, 129, 170, + 84, 253, 73, 36, 109, 100, 107, 255, + 144, 232, 161, 135, 94, 244, 129, 170, + 84, 253, 65, 34, 109, 100, 107, 255, + + 144, 240, 194, 11, 47, 248, 130, 170, + 84, 253, 65, 34, 109, 100, 107, 251, + 144, 247, 223, 143, 63, 252, 131, 170, + 84, 253, 73, 34, 109, 100, 91, 251 +}; + +enum: std::size_t { CompressedPixelStorage3DDataCount = + #ifndef MAGNUM_TARGET_GLES + 2 + #else + 1 + #endif +}; + +const struct { + const char* name; + Containers::ArrayView data; + #ifndef MAGNUM_TARGET_GLES + CompressedPixelStorage storage; + #endif + Containers::ArrayView dataSparse; + std::size_t offset; +} CompressedPixelStorage3DData[CompressedPixelStorage3DDataCount]{ + {"default pixel storage", + Containers::arrayView(CompressedData3D).suffix(16*4), #ifndef MAGNUM_TARGET_GLES - {"skip Z", - Containers::arrayView(CompressedData3D).suffix(16*4), - CompressedPixelStorage{} - .setCompressedBlockSize({4, 4, 4}) - .setCompressedBlockDataSize(16*4) - .setSkip({0, 0, 4}), - Containers::arrayView(CompressedData3D), 16*4} + {}, #endif - }; -} + Containers::arrayView(CompressedData3D).suffix(16*4), 0}, + #ifndef MAGNUM_TARGET_GLES + {"skip Z", + Containers::arrayView(CompressedData3D).suffix(16*4), + CompressedPixelStorage{} + .setCompressedBlockSize({4, 4, 4}) + .setCompressedBlockDataSize(16*4) + .setSkip({0, 0, 4}), + Containers::arrayView(CompressedData3D), 16*4} + #endif +}; TextureGLTest::TextureGLTest() { addTests({ @@ -1302,10 +1300,6 @@ void TextureGLTest::storage3D() { } #endif -namespace { - -} - #ifndef MAGNUM_TARGET_GLES void TextureGLTest::image1D() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); @@ -1353,12 +1347,10 @@ void TextureGLTest::image1DBuffer() { TestSuite::Compare::Container); } -namespace { - constexpr UnsignedByte Zero1D[4*4] = {}; - constexpr UnsignedByte SubData1DComplete[]{ - 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0 - }; -} +constexpr UnsignedByte Zero1D[4*4] = {}; +constexpr UnsignedByte SubData1DComplete[]{ + 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0 +}; void TextureGLTest::subImage1D() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); @@ -1552,18 +1544,16 @@ void TextureGLTest::image2DBuffer() { } #endif -namespace { - constexpr UnsignedByte Zero2D[4*4*4]{}; +constexpr UnsignedByte Zero2D[4*4*4]{}; - #ifndef MAGNUM_TARGET_GLES - constexpr UnsignedByte SubData2DComplete[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, - 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - #endif -} +#ifndef MAGNUM_TARGET_GLES +constexpr UnsignedByte SubData2DComplete[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, + 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif void TextureGLTest::subImage2D() { setTestCaseDescription(PixelStorage2DData[testCaseInstanceId()].name); @@ -1765,22 +1755,20 @@ void TextureGLTest::compressedImage2DBuffer() { } #endif -namespace { - /* Just 12x4 zeros compressed using RGBA DXT3 by the driver */ - constexpr UnsignedByte CompressedZero2D[3*16]{}; +/* Just 12x4 zeros compressed using RGBA DXT3 by the driver */ +constexpr UnsignedByte CompressedZero2D[3*16]{}; - #ifndef MAGNUM_TARGET_GLES - /* Combination of CompressedZero2D and CompressedData2D */ - constexpr UnsignedByte CompressedSubData2DComplete[]{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 17, 34, 34, 51, 51, 67, - 232, 57, 0, 0, 213, 255, 170, 2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 - }; - #endif -} +#ifndef MAGNUM_TARGET_GLES +/* Combination of CompressedZero2D and CompressedData2D */ +constexpr UnsignedByte CompressedSubData2DComplete[]{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 17, 34, 34, 51, 51, 67, + 232, 57, 0, 0, 213, 255, 170, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif void TextureGLTest::compressedSubImage2D() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); @@ -1990,33 +1978,31 @@ void TextureGLTest::image3DBuffer() { } #endif -namespace { - constexpr UnsignedByte Zero3D[4*4*4*4]{}; - - #ifndef MAGNUM_TARGET_GLES - constexpr UnsignedByte SubData3DComplete[]{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, - 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0, 0, 0, 0, - 0, 0, 0, 0, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +constexpr UnsignedByte Zero3D[4*4*4*4]{}; - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - #endif -} +#ifndef MAGNUM_TARGET_GLES +constexpr UnsignedByte SubData3DComplete[]{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0, + 0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0, 0, 0, 0, + 0, 0, 0, 0, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif void TextureGLTest::subImage3D() { setTestCaseDescription(PixelStorage3DData[testCaseInstanceId()].name); @@ -2205,51 +2191,49 @@ void TextureGLTest::compressedImage3DBuffer() { } #endif -namespace { - #ifndef MAGNUM_TARGET_GLES - /* Just 12x4x4 zeros compressed using RGBA BPTC Unorm by the driver */ - constexpr UnsignedByte CompressedZero3D[3*4*16]{ - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - - /* Combination of CompressedZero3D and CompressedData3D. Note that, in - contrast to array textures, the data are ordered in "cubes" instead of - slices. */ - constexpr UnsignedByte CompressedSubData3DComplete[]{ - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 144, 224, 128, 3, 80, 0, 129, 170, - 84, 253, 73, 36, 109, 100, 107, 255, - 144, 232, 161, 135, 94, 244, 129, 170, - 84, 253, 65, 34, 109, 100, 107, 255, - 144, 240, 194, 11, 47, 248, 130, 170, - 84, 253, 65, 34, 109, 100, 107, 251, - 144, 247, 223, 143, 63, 252, 131, 170, - 84, 253, 73, 34, 109, 100, 91, 251, - - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - #endif -} +#ifndef MAGNUM_TARGET_GLES +/* Just 12x4x4 zeros compressed using RGBA BPTC Unorm by the driver */ +constexpr UnsignedByte CompressedZero3D[3*4*16]{ + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* Combination of CompressedZero3D and CompressedData3D. Note that, in + contrast to array textures, the data are ordered in "cubes" instead of + slices. */ +constexpr UnsignedByte CompressedSubData3DComplete[]{ + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 144, 224, 128, 3, 80, 0, 129, 170, + 84, 253, 73, 36, 109, 100, 107, 255, + 144, 232, 161, 135, 94, 244, 129, 170, + 84, 253, 65, 34, 109, 100, 107, 255, + 144, 240, 194, 11, 47, 248, 130, 170, + 84, 253, 65, 34, 109, 100, 107, 251, + 144, 247, 223, 143, 63, 252, 131, 170, + 84, 253, 73, 34, 109, 100, 91, 251, + + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif void TextureGLTest::compressedSubImage3D() { setTestCaseDescription(CompressedPixelStorage3DData[testCaseInstanceId()].name); @@ -2657,6 +2641,6 @@ void TextureGLTest::srgbAlphaStorage() { MAGNUM_VERIFY_NO_GL_ERROR(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::TextureGLTest) diff --git a/src/Magnum/GL/Test/TextureTest.cpp b/src/Magnum/GL/Test/TextureTest.cpp index 0a0195f64..e1142e9aa 100644 --- a/src/Magnum/GL/Test/TextureTest.cpp +++ b/src/Magnum/GL/Test/TextureTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/Texture.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct TextureTest: TestSuite::Tester { explicit TextureTest(); @@ -119,6 +119,6 @@ void TextureTest::constructCopy3D() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::TextureTest) diff --git a/src/Magnum/GL/Test/TimeQueryGLTest.cpp b/src/Magnum/GL/Test/TimeQueryGLTest.cpp index ba7297e23..1c353801b 100644 --- a/src/Magnum/GL/Test/TimeQueryGLTest.cpp +++ b/src/Magnum/GL/Test/TimeQueryGLTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/GL/OpenGLTester.h" #include "Magnum/GL/TimeQuery.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct TimeQueryGLTest: OpenGLTester { explicit TimeQueryGLTest(); @@ -134,6 +134,6 @@ void TimeQueryGLTest::queryTimestamp() { CORRADE_COMPARE_AS(result2 - result1, result, TestSuite::Compare::GreaterOrEqual); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::TimeQueryGLTest) diff --git a/src/Magnum/GL/Test/TimeQueryTest.cpp b/src/Magnum/GL/Test/TimeQueryTest.cpp index 156049fc8..0b56e7daa 100644 --- a/src/Magnum/GL/Test/TimeQueryTest.cpp +++ b/src/Magnum/GL/Test/TimeQueryTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/TimeQuery.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct TimeQueryTest: TestSuite::Tester { explicit TimeQueryTest(); @@ -55,6 +55,6 @@ void TimeQueryTest::constructCopy() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::TimeQueryTest) diff --git a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp index b0c0f9aab..8fa63431f 100644 --- a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp @@ -40,7 +40,7 @@ #include "Magnum/GL/TransformFeedback.h" #include "Magnum/Math/Vector2.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct TransformFeedbackGLTest: OpenGLTester { explicit TransformFeedbackGLTest(); @@ -65,8 +65,6 @@ struct TransformFeedbackGLTest: OpenGLTester { #endif }; -namespace { - #ifndef MAGNUM_TARGET_GLES enum: std::size_t { DrawDataCount = 4 }; @@ -85,8 +83,6 @@ const struct { }; #endif -} - TransformFeedbackGLTest::TransformFeedbackGLTest() { addTests({&TransformFeedbackGLTest::construct, &TransformFeedbackGLTest::constructMove, @@ -212,8 +208,6 @@ void TransformFeedbackGLTest::label() { } #endif -namespace { - constexpr const Vector2 inputData[] = { {0.0f, 0.0f}, {-1.0f, 1.0f} @@ -259,8 +253,6 @@ XfbShader::XfbShader() { CORRADE_INTERNAL_ASSERT_OUTPUT(link()); } -} - void TransformFeedbackGLTest::attachBase() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -355,8 +347,6 @@ void TransformFeedbackGLTest::attachRange() { #endif } -namespace { - struct XfbMultiShader: AbstractShaderProgram { typedef Attribute<0, Vector2> Input; @@ -399,8 +389,6 @@ XfbMultiShader::XfbMultiShader() { CORRADE_INTERNAL_ASSERT_OUTPUT(link()); } -} - void TransformFeedbackGLTest::attachBases() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -720,6 +708,6 @@ void TransformFeedbackGLTest::draw() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::TransformFeedbackGLTest) diff --git a/src/Magnum/GL/Test/TransformFeedbackTest.cpp b/src/Magnum/GL/Test/TransformFeedbackTest.cpp index 1e6668553..8ba19e7ba 100644 --- a/src/Magnum/GL/Test/TransformFeedbackTest.cpp +++ b/src/Magnum/GL/Test/TransformFeedbackTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/GL/TransformFeedback.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct TransformFeedbackTest: TestSuite::Tester { explicit TransformFeedbackTest(); @@ -55,6 +55,6 @@ void TransformFeedbackTest::constructCopy() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::TransformFeedbackTest) diff --git a/src/Magnum/GL/Test/VersionTest.cpp b/src/Magnum/GL/Test/VersionTest.cpp index 41f98a985..75c40e26b 100644 --- a/src/Magnum/GL/Test/VersionTest.cpp +++ b/src/Magnum/GL/Test/VersionTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/Version.h" -namespace Magnum { namespace GL { namespace Test { +namespace Magnum { namespace GL { namespace Test { namespace { struct VersionTest: TestSuite::Tester { explicit VersionTest(); @@ -126,6 +126,6 @@ void VersionTest::debugES() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::GL::Test::VersionTest) diff --git a/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp b/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp index 5c5483f8b..8ec9bb555 100644 --- a/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/Math/Algorithms/GaussJordan.h" -namespace Magnum { namespace Math { namespace Algorithms { namespace Test { +namespace Magnum { namespace Math { namespace Algorithms { namespace Test { namespace { struct GaussJordanTest: Corrade::TestSuite::Tester { explicit GaussJordanTest(); @@ -92,6 +92,6 @@ void GaussJordanTest::inverted() { CORRADE_COMPARE(inverse*m, Matrix4x4{}); } -}}}} +}}}}} CORRADE_TEST_MAIN(Magnum::Math::Algorithms::Test::GaussJordanTest) diff --git a/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp b/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp index 992748ff6..75edb063e 100644 --- a/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/Math/Algorithms/GramSchmidt.h" -namespace Magnum { namespace Math { namespace Algorithms { namespace Test { +namespace Magnum { namespace Math { namespace Algorithms { namespace Test { namespace { struct GramSchmidtTest: Corrade::TestSuite::Tester { explicit GramSchmidtTest(); @@ -95,6 +95,6 @@ void GramSchmidtTest::orthonormalize() { CORRADE_COMPARE(orthonormalized, expected); } -}}}} +}}}}} CORRADE_TEST_MAIN(Magnum::Math::Algorithms::Test::GramSchmidtTest) diff --git a/src/Magnum/Math/Algorithms/Test/KahanSumTest.cpp b/src/Magnum/Math/Algorithms/Test/KahanSumTest.cpp index 9b1e74177..638431703 100644 --- a/src/Magnum/Math/Algorithms/Test/KahanSumTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/KahanSumTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Magnum.h" #include "Magnum/Math/Algorithms/KahanSum.h" -namespace Magnum { namespace Math { namespace Algorithms { namespace Test { +namespace Magnum { namespace Math { namespace Algorithms { namespace Test { namespace { struct KahanSumTest: TestSuite::Tester { explicit KahanSumTest(); @@ -52,8 +52,6 @@ KahanSumTest::KahanSumTest() { &KahanSumTest::kahan100k}, 50); } -namespace { - /* Custom iterator class to avoid allocating half a gigabyte for hundred million values */ template struct Iterator @@ -84,8 +82,6 @@ template struct Iterator std::size_t _i{}; }; -} - void KahanSumTest::floats() { Iterator begin{1.0f}; Iterator end{1.0f, 100000000}; @@ -165,6 +161,6 @@ void KahanSumTest::kahan100k() { CORRADE_COMPARE(Float(a), 100000.0f); } -}}}} +}}}}} CORRADE_TEST_MAIN(Magnum::Math::Algorithms::Test::KahanSumTest) diff --git a/src/Magnum/Math/Algorithms/Test/QrTest.cpp b/src/Magnum/Math/Algorithms/Test/QrTest.cpp index ea1f51ad9..c6615ae8d 100644 --- a/src/Magnum/Math/Algorithms/Test/QrTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/QrTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Math/Matrix4.h" #include "Magnum/Math/Algorithms/Qr.h" -namespace Magnum { namespace Math { namespace Algorithms { namespace Test { +namespace Magnum { namespace Math { namespace Algorithms { namespace Test { namespace { struct QrTest: Corrade::TestSuite::Tester { explicit QrTest(); @@ -84,6 +84,6 @@ void QrTest::decomposeRotationShear() { CORRADE_COMPARE(r4.rotationShear(), Matrix4::shearingXZ(0.274077f, 0.0f).rotationShear()); } -}}}} +}}}}} CORRADE_TEST_MAIN(Magnum::Math::Algorithms::Test::QrTest) diff --git a/src/Magnum/Math/Algorithms/Test/SvdTest.cpp b/src/Magnum/Math/Algorithms/Test/SvdTest.cpp index fc4bb0134..6a5fdbef0 100644 --- a/src/Magnum/Math/Algorithms/Test/SvdTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/SvdTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Math/Matrix4.h" #include "Magnum/Math/Algorithms/Svd.h" -namespace Magnum { namespace Math { namespace Algorithms { namespace Test { +namespace Magnum { namespace Math { namespace Algorithms { namespace Test { namespace { struct SvdTest: Corrade::TestSuite::Tester { explicit SvdTest(); @@ -116,6 +116,6 @@ void SvdTest::decomposeRotationShear() { CORRADE_COMPARE(Matrix4::from(u*v.transposed(), {}), Matrix4::rotationZ(35.0_degf)); } -}}}} +}}}}} CORRADE_TEST_MAIN(Magnum::Math::Algorithms::Test::SvdTest) diff --git a/src/Magnum/Math/Test/AngleTest.cpp b/src/Magnum/Math/Test/AngleTest.cpp index 1d731a2fc..643c70ca6 100644 --- a/src/Magnum/Math/Test/AngleTest.cpp +++ b/src/Magnum/Math/Test/AngleTest.cpp @@ -35,7 +35,7 @@ #include "Magnum/Math/Angle.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct AngleTest: Corrade::TestSuite::Tester { explicit AngleTest(); @@ -67,8 +67,6 @@ typedef Math::Rad Radd; using namespace Literals; #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT)) || defined(CORRADE_TARGET_EMSCRIPTEN) -namespace { - constexpr struct { const char* name; const char* data; @@ -114,8 +112,6 @@ template<> struct TweakableTraits { static const char* name() { return "Radd"; } static const char* literal() { return "rad"; } }; - -} #endif AngleTest::AngleTest() { @@ -340,6 +336,6 @@ template void AngleTest::tweakableError() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::AngleTest) diff --git a/src/Magnum/Math/Test/BezierTest.cpp b/src/Magnum/Math/Test/BezierTest.cpp index 4d8bb0bf5..4e7860ee0 100644 --- a/src/Magnum/Math/Test/BezierTest.cpp +++ b/src/Magnum/Math/Test/BezierTest.cpp @@ -54,7 +54,7 @@ template<> struct BezierConverter<2, 2, Float, QBezier2D> { } -namespace Test { +namespace Test { namespace { typedef Math::Vector2 Vector2; typedef Math::Vector2 Vector2d; @@ -349,6 +349,6 @@ void BezierTest::configuration() { CORRADE_COMPARE(c.value("bezier"), bezier); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::BezierTest) diff --git a/src/Magnum/Math/Test/BoolVectorTest.cpp b/src/Magnum/Math/Test/BoolVectorTest.cpp index ef8d0ade1..01e00dda2 100644 --- a/src/Magnum/Math/Test/BoolVectorTest.cpp +++ b/src/Magnum/Math/Test/BoolVectorTest.cpp @@ -49,7 +49,7 @@ template<> struct BoolVectorConverter<3, BVec3> { } -namespace Test { +namespace Test { namespace { struct BoolVectorTest: Corrade::TestSuite::Tester { explicit BoolVectorTest(); @@ -335,6 +335,6 @@ void BoolVectorTest::debug() { CORRADE_COMPARE(o.str(), "BoolVector(10100100 11001010 010)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::BoolVectorTest) diff --git a/src/Magnum/Math/Test/ColorTest.cpp b/src/Magnum/Math/Test/ColorTest.cpp index 88a100973..75f933dad 100644 --- a/src/Magnum/Math/Test/ColorTest.cpp +++ b/src/Magnum/Math/Test/ColorTest.cpp @@ -69,7 +69,7 @@ template<> struct VectorConverter<4, float, Vec4> { } -namespace Test { +namespace Test { namespace { struct ColorTest: Corrade::TestSuite::Tester { explicit ColorTest(); @@ -147,8 +147,6 @@ typedef Math::Deg Deg; using namespace Literals; #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT)) || defined(CORRADE_TARGET_EMSCRIPTEN) -namespace { - const struct { const char* name; const char* dataRgb; @@ -180,8 +178,6 @@ constexpr struct { {"bad size", "0x333_{1}", Corrade::Utility::TweakableState::Error, "Utility::TweakableParser: 0x333_{2}{1} doesn't have expected number of digits\n"}, }; - -} #endif ColorTest::ColorTest() { @@ -1130,6 +1126,6 @@ void ColorTest::tweakableErrorSrgbaf() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::ColorTest) diff --git a/src/Magnum/Math/Test/ComplexTest.cpp b/src/Magnum/Math/Test/ComplexTest.cpp index c79e6b889..351debff5 100644 --- a/src/Magnum/Math/Test/ComplexTest.cpp +++ b/src/Magnum/Math/Test/ComplexTest.cpp @@ -51,7 +51,7 @@ template<> struct ComplexConverter { } -namespace Test { +namespace Test { namespace { struct ComplexTest: Corrade::TestSuite::Tester { explicit ComplexTest(); @@ -575,6 +575,6 @@ void ComplexTest::configuration() { CORRADE_COMPARE(c.value("overflow"), (Complex{2.0f, 9.0f})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::ComplexTest) diff --git a/src/Magnum/Math/Test/ConstantsTest.cpp b/src/Magnum/Math/Test/ConstantsTest.cpp index 30fb9d9c8..71285358c 100644 --- a/src/Magnum/Math/Test/ConstantsTest.cpp +++ b/src/Magnum/Math/Test/ConstantsTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Constants.h" #include "Magnum/Math/Functions.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct ConstantsTest: Corrade::TestSuite::Tester { explicit ConstantsTest(); @@ -87,6 +87,6 @@ template void ConstantsTest::specials() { CORRADE_VERIFY(h != h); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::ConstantsTest) diff --git a/src/Magnum/Math/Test/CubicHermiteTest.cpp b/src/Magnum/Math/Test/CubicHermiteTest.cpp index cd0fa661d..544bf54f0 100644 --- a/src/Magnum/Math/Test/CubicHermiteTest.cpp +++ b/src/Magnum/Math/Test/CubicHermiteTest.cpp @@ -33,7 +33,7 @@ #include "Magnum/Math/StrictWeakOrdering.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct CubicHermiteTest: Corrade::TestSuite::Tester { explicit CubicHermiteTest(); @@ -1181,6 +1181,6 @@ void CubicHermiteTest::debugQuaternion() { CORRADE_COMPARE(out.str(), "CubicHermite(Quaternion({2, 1.5, 0.3}, 1.1), Quaternion({3, 0.1, 2.3}, 0.7), Quaternion({-1, 0, 0.3}, 0.4))\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::CubicHermiteTest) diff --git a/src/Magnum/Math/Test/DistanceTest.cpp b/src/Magnum/Math/Test/DistanceTest.cpp index 538be238b..72f50e24e 100644 --- a/src/Magnum/Math/Test/DistanceTest.cpp +++ b/src/Magnum/Math/Test/DistanceTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Math/Constants.h" #include "Magnum/Math/Distance.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct DistanceTest: Corrade::TestSuite::Tester { explicit DistanceTest(); @@ -199,6 +199,6 @@ void DistanceTest::pointPlaneNormalizedNotNormalized() { CORRADE_COMPARE(out.str(), "Math::Distance::pointPlaneNormalized(): plane normal Vector(2, 2, 2) is not normalized\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::DistanceTest) diff --git a/src/Magnum/Math/Test/DualComplexTest.cpp b/src/Magnum/Math/Test/DualComplexTest.cpp index 0a6f5974f..c8a529014 100644 --- a/src/Magnum/Math/Test/DualComplexTest.cpp +++ b/src/Magnum/Math/Test/DualComplexTest.cpp @@ -51,7 +51,7 @@ template<> struct DualComplexConverter { } -namespace Test { +namespace Test { namespace { struct DualComplexTest: Corrade::TestSuite::Tester { explicit DualComplexTest(); @@ -318,15 +318,13 @@ void DualComplexTest::normalized() { CORRADE_COMPARE(a.normalized(), b); } -namespace { - template struct NormalizedIterativeData; - template<> struct NormalizedIterativeData { - static Math::Vector2 translation() { return {10000.0f, -50.0f}; } - }; - template<> struct NormalizedIterativeData { - static Math::Vector2 translation() { return {10000000.0, -500.0}; } - }; -} +template struct NormalizedIterativeData; +template<> struct NormalizedIterativeData { + static Math::Vector2 translation() { return {10000.0f, -50.0f}; } +}; +template<> struct NormalizedIterativeData { + static Math::Vector2 translation() { return {10000000.0, -500.0}; } +}; template void DualComplexTest::normalizedIterative() { setTestCaseName(std::string{"normalizedIterative<"} + TypeTraits::name() + ">"); @@ -491,6 +489,6 @@ void DualComplexTest::configuration() { CORRADE_COMPARE(c.value("overflow"), (DualComplex{{2.0f, 1.0f}, {8.0f, 9.0f}})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::DualComplexTest) diff --git a/src/Magnum/Math/Test/DualQuaternionTest.cpp b/src/Magnum/Math/Test/DualQuaternionTest.cpp index 7a8715215..c8f41a9e7 100644 --- a/src/Magnum/Math/Test/DualQuaternionTest.cpp +++ b/src/Magnum/Math/Test/DualQuaternionTest.cpp @@ -53,7 +53,7 @@ template<> struct DualQuaternionConverter { } -namespace Test { +namespace Test { namespace { struct DualQuaternionTest: Corrade::TestSuite::Tester { explicit DualQuaternionTest(); @@ -348,15 +348,13 @@ void DualQuaternionTest::normalized() { CORRADE_COMPARE(a.normalized(), b); } -namespace { - template struct NormalizedIterativeData; - template<> struct NormalizedIterativeData { - static Math::Vector3 translation() { return {10000.0f, -50.0f, 20000.0f}; } - }; - template<> struct NormalizedIterativeData { - static Math::Vector3 translation() { return {10000000000000.0, -500.0, 20000000000000.0}; } - }; -} +template struct NormalizedIterativeData; +template<> struct NormalizedIterativeData { + static Math::Vector3 translation() { return {10000.0f, -50.0f, 20000.0f}; } +}; +template<> struct NormalizedIterativeData { + static Math::Vector3 translation() { return {10000000000000.0, -500.0, 20000000000000.0}; } +}; template void DualQuaternionTest::normalizedIterative() { setTestCaseName(std::string{"normalizedIterative<"} + TypeTraits::name() + ">"); @@ -666,6 +664,6 @@ void DualQuaternionTest::configuration() { CORRADE_COMPARE(c.value("overflow"), (DualQuaternion{{{2.0f, 1.0f, 8.0f}, 9.0f}, {{16.0f, 33.0f, -1.0f}, 5.0f}})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::DualQuaternionTest) diff --git a/src/Magnum/Math/Test/DualTest.cpp b/src/Magnum/Math/Test/DualTest.cpp index 2476a68e2..b078071f0 100644 --- a/src/Magnum/Math/Test/DualTest.cpp +++ b/src/Magnum/Math/Test/DualTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Math/Vector2.h" #include "Magnum/Math/StrictWeakOrdering.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct DualTest: Corrade::TestSuite::Tester { explicit DualTest(); @@ -298,8 +298,6 @@ void DualTest::strictWeakOrdering() { CORRADE_VERIFY(!o(a, a)); } -namespace { - template class BasicDualVec2: public Math::Dual> { public: template constexpr BasicDualVec2(U&&... args): Math::Dual>{args...} {} @@ -312,8 +310,6 @@ MAGNUM_DUAL_OPERATOR_IMPLEMENTATION(BasicDualVec2, Math::Vector2, T) typedef BasicDualVec2 DualVec2; -} - void DualTest::subclassTypes() { const DualVec2 a; CORRADE_VERIFY((std::is_same::value)); @@ -373,6 +369,6 @@ void DualTest::debug() { CORRADE_COMPARE(o.str(), "Dual(2.5, -0.3)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::DualTest) diff --git a/src/Magnum/Math/Test/FrustumTest.cpp b/src/Magnum/Math/Test/FrustumTest.cpp index e29aba14b..9fc2b7ac8 100644 --- a/src/Magnum/Math/Test/FrustumTest.cpp +++ b/src/Magnum/Math/Test/FrustumTest.cpp @@ -61,7 +61,7 @@ template<> struct FrustumConverter { } -namespace Test { +namespace Test { namespace { struct FrustumTest: Corrade::TestSuite::Tester { explicit FrustumTest(); @@ -368,6 +368,6 @@ void FrustumTest::debug() { " {7, -8, 9, 0.6})\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::FrustumTest) diff --git a/src/Magnum/Math/Test/FunctionsTest.cpp b/src/Magnum/Math/Test/FunctionsTest.cpp index 74734d87c..4a31933ac 100644 --- a/src/Magnum/Math/Test/FunctionsTest.cpp +++ b/src/Magnum/Math/Test/FunctionsTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Functions.h" #include "Magnum/Math/Vector4.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct FunctionsTest: Corrade::TestSuite::Tester { explicit FunctionsTest(); @@ -445,6 +445,6 @@ void FunctionsTest::trigonometricWithBase() { CORRADE_COMPARE(Math::tan(2*Rad(Constants::pi()/8)), 1.0f); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::FunctionsTest) diff --git a/src/Magnum/Math/Test/HalfTest.cpp b/src/Magnum/Math/Test/HalfTest.cpp index b14c0aca7..c5299b773 100644 --- a/src/Magnum/Math/Test/HalfTest.cpp +++ b/src/Magnum/Math/Test/HalfTest.cpp @@ -35,7 +35,7 @@ #include "Magnum/Math/Vector3.h" #include "Magnum/Math/StrictWeakOrdering.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct HalfTest: Corrade::TestSuite::Tester { explicit HalfTest(); @@ -94,8 +94,6 @@ typedef Math::Constants Constants; using namespace Literals; #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT)) || defined(CORRADE_TARGET_EMSCRIPTEN) -namespace { - const struct { const char* name; const char* data; @@ -125,8 +123,6 @@ constexpr struct { {"different suffix", "42.0u", Corrade::Utility::TweakableState::Recompile, /* not for double */ "Utility::TweakableParser: 42.0u has an unexpected suffix, expected _h\n"} }; - -} #endif HalfTest::HalfTest() { @@ -221,8 +217,6 @@ HalfTest::HalfTest() { } } -namespace { - union FloatBits { UnsignedInt u; Float f; @@ -242,8 +236,6 @@ union HalfBits { } bits; }; -} - /* float_to_half_full() from https://gist.github.com/rygorous/2156668, originally from ISPC */ UnsignedShort HalfTest::packNaive(Float value) { @@ -708,6 +700,6 @@ void HalfTest::tweakableError() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::HalfTest) diff --git a/src/Magnum/Math/Test/InterpolationBenchmark.cpp b/src/Magnum/Math/Test/InterpolationBenchmark.cpp index 09ffcc3cf..fb6c2fe38 100644 --- a/src/Magnum/Math/Test/InterpolationBenchmark.cpp +++ b/src/Magnum/Math/Test/InterpolationBenchmark.cpp @@ -28,7 +28,7 @@ #define CORRADE_NO_ASSERT #include "Magnum/Math/DualQuaternion.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct InterpolationBenchmark: Corrade::TestSuite::Tester { explicit InterpolationBenchmark(); @@ -147,6 +147,6 @@ void InterpolationBenchmark::dualQuaternionSclerpShortestPath() { CORRADE_VERIFY(!c.isNormalized()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::InterpolationBenchmark) diff --git a/src/Magnum/Math/Test/IntersectionBenchmark.cpp b/src/Magnum/Math/Test/IntersectionBenchmark.cpp index b623be087..5922a7a57 100644 --- a/src/Magnum/Math/Test/IntersectionBenchmark.cpp +++ b/src/Magnum/Math/Test/IntersectionBenchmark.cpp @@ -32,7 +32,7 @@ #include "Magnum/Math/Angle.h" #include "Magnum/Math/Intersection.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { template bool rangeFrustumNaive(const Math::Range3D& box, const Math::Frustum& frustum) { for(const Math::Vector4& plane: frustum.planes()) { @@ -218,6 +218,6 @@ void IntersectionBenchmark::sphereConeView() { } } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::IntersectionBenchmark) diff --git a/src/Magnum/Math/Test/IntersectionTest.cpp b/src/Magnum/Math/Test/IntersectionTest.cpp index d224dd4ad..712c85e49 100644 --- a/src/Magnum/Math/Test/IntersectionTest.cpp +++ b/src/Magnum/Math/Test/IntersectionTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Intersection.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { using namespace Literals; @@ -451,6 +451,6 @@ void IntersectionTest::aabbCone() { CORRADE_VERIFY(!Intersection::aabbCone(-15.0f*normal, Vector3{1.0f}, center, normal, angle)); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::IntersectionTest) diff --git a/src/Magnum/Math/Test/Matrix3Test.cpp b/src/Magnum/Math/Test/Matrix3Test.cpp index c6ee0a8be..cee24bf05 100644 --- a/src/Magnum/Math/Test/Matrix3Test.cpp +++ b/src/Magnum/Math/Test/Matrix3Test.cpp @@ -55,7 +55,7 @@ template<> struct RectangularMatrixConverter<3, 3, float, Mat3> { } -namespace Test { +namespace Test { namespace { struct Matrix3Test: Corrade::TestSuite::Tester { explicit Matrix3Test(); @@ -638,6 +638,6 @@ void Matrix3Test::configuration() { CORRADE_COMPARE(c.value("matrix"), m); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::Matrix3Test) diff --git a/src/Magnum/Math/Test/Matrix4Test.cpp b/src/Magnum/Math/Test/Matrix4Test.cpp index b9ef62536..8f40e804b 100644 --- a/src/Magnum/Math/Test/Matrix4Test.cpp +++ b/src/Magnum/Math/Test/Matrix4Test.cpp @@ -58,7 +58,7 @@ template<> struct RectangularMatrixConverter<4, 4, float, Mat4> { } -namespace Test { +namespace Test { namespace { struct Matrix4Test: Corrade::TestSuite::Tester { explicit Matrix4Test(); @@ -843,6 +843,6 @@ void Matrix4Test::configuration() { CORRADE_COMPARE(c.value("matrix"), m); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::Matrix4Test) diff --git a/src/Magnum/Math/Test/MatrixTest.cpp b/src/Magnum/Math/Test/MatrixTest.cpp index 9ce78529e..1e122b3d9 100644 --- a/src/Magnum/Math/Test/MatrixTest.cpp +++ b/src/Magnum/Math/Test/MatrixTest.cpp @@ -55,7 +55,7 @@ template<> struct RectangularMatrixConverter<3, 3, float, Mat3> { } -namespace Test { +namespace Test { namespace { struct MatrixTest: Corrade::TestSuite::Tester { explicit MatrixTest(); @@ -503,6 +503,6 @@ void MatrixTest::configuration() { CORRADE_COMPARE(c.value("matrix"), m); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::MatrixTest) diff --git a/src/Magnum/Math/Test/PackingTest.cpp b/src/Magnum/Math/Test/PackingTest.cpp index d7853dd67..759e7328e 100644 --- a/src/Magnum/Math/Test/PackingTest.cpp +++ b/src/Magnum/Math/Test/PackingTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Packing.h" #include "Magnum/Math/Vector3.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct PackingTest: Corrade::TestSuite::Tester { explicit PackingTest(); @@ -279,6 +279,6 @@ void PackingTest::unpackTypeDeduction() { CORRADE_COMPARE((Math::unpack('\x7F')), 1.0f); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::PackingTest) diff --git a/src/Magnum/Math/Test/QuaternionTest.cpp b/src/Magnum/Math/Test/QuaternionTest.cpp index f2ad554bb..0992cffb0 100644 --- a/src/Magnum/Math/Test/QuaternionTest.cpp +++ b/src/Magnum/Math/Test/QuaternionTest.cpp @@ -52,7 +52,7 @@ template<> struct QuaternionConverter { } -namespace Test { +namespace Test { namespace { struct QuaternionTest: Corrade::TestSuite::Tester { explicit QuaternionTest(); @@ -763,6 +763,6 @@ void QuaternionTest::configuration() { CORRADE_COMPARE(c.value("overflow"), (Quaternion{{2.0f, 1.0f, 8.0f}, 9.0f})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::QuaternionTest) diff --git a/src/Magnum/Math/Test/RangeTest.cpp b/src/Magnum/Math/Test/RangeTest.cpp index 9d7bab8a9..92fffc316 100644 --- a/src/Magnum/Math/Test/RangeTest.cpp +++ b/src/Magnum/Math/Test/RangeTest.cpp @@ -93,7 +93,7 @@ template<> struct RangeConverter<3, Float, Box> { } -namespace Test { +namespace Test { namespace { struct RangeTest: Corrade::TestSuite::Tester { explicit RangeTest(); @@ -898,6 +898,6 @@ void RangeTest::configuration() { CORRADE_COMPARE(c.value("rectangle"), rect); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::RangeTest) diff --git a/src/Magnum/Math/Test/RectangularMatrixTest.cpp b/src/Magnum/Math/Test/RectangularMatrixTest.cpp index 3efc584c5..70443fb36 100644 --- a/src/Magnum/Math/Test/RectangularMatrixTest.cpp +++ b/src/Magnum/Math/Test/RectangularMatrixTest.cpp @@ -53,7 +53,7 @@ template<> struct RectangularMatrixConverter<2, 3, Float, Mat2x3> { } -namespace Test { +namespace Test { namespace { struct RectangularMatrixTest: Corrade::TestSuite::Tester { explicit RectangularMatrixTest(); @@ -744,6 +744,6 @@ void RectangularMatrixTest::configuration() { Vector4{8.0f, 3.0f, 7.0f, 3.0f}})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::RectangularMatrixTest) diff --git a/src/Magnum/Math/Test/StrictWeakOrderingTest.cpp b/src/Magnum/Math/Test/StrictWeakOrderingTest.cpp index 557884516..1025601d8 100644 --- a/src/Magnum/Math/Test/StrictWeakOrderingTest.cpp +++ b/src/Magnum/Math/Test/StrictWeakOrderingTest.cpp @@ -36,7 +36,7 @@ namespace std { template<> struct less>: Magnum::Math::Implementation::StrictWeakOrdering> {}; } -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct StrictWeakOrderingTest: Corrade::TestSuite::Tester { explicit StrictWeakOrderingTest(); @@ -73,18 +73,16 @@ void StrictWeakOrderingTest::base() { CORRADE_VERIFY(!of('z', 'h')); } -namespace { - template struct Compare; - template<> struct Compare> { - static const char* name() { return "Implementation::StrictWeakOrdering"; } - }; - template<> struct Compare { - static const char* name() { return "StrictWeakOrdering"; } - }; - template<> struct Compare> { - static const char* name() { return "std::less"; } - }; -} +template struct Compare; +template<> struct Compare> { + static const char* name() { return "Implementation::StrictWeakOrdering"; } +}; +template<> struct Compare { + static const char* name() { return "StrictWeakOrdering"; } +}; +template<> struct Compare> { + static const char* name() { return "std::less"; } +}; template void StrictWeakOrderingTest::set() { setTestCaseName(Corrade::Utility::formatString("set<{}>", Compare::name())); @@ -117,6 +115,6 @@ template void StrictWeakOrderingTest::map() { CORRADE_COMPARE(m.begin()->second, 99); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::StrictWeakOrderingTest) diff --git a/src/Magnum/Math/Test/SwizzleTest.cpp b/src/Magnum/Math/Test/SwizzleTest.cpp index 6251959fa..12ba8d4b4 100644 --- a/src/Magnum/Math/Test/SwizzleTest.cpp +++ b/src/Magnum/Math/Test/SwizzleTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/Math/Swizzle.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct SwizzleTest: Corrade::TestSuite::Tester { explicit SwizzleTest(); @@ -73,6 +73,6 @@ void SwizzleTest::sizes() { CORRADE_COMPARE(c, (Vector<7, Int>(3, 1, 4, 2, 3, 2, 1))); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::SwizzleTest) diff --git a/src/Magnum/Math/Test/TagsTest.cpp b/src/Magnum/Math/Test/TagsTest.cpp index 0435b7db1..856084adb 100644 --- a/src/Magnum/Math/Test/TagsTest.cpp +++ b/src/Magnum/Math/Test/TagsTest.cpp @@ -26,7 +26,7 @@ #include "Magnum/Math/Tags.h" #include "Corrade/TestSuite/Tester.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct TagsTest: Corrade::TestSuite::Tester { explicit TagsTest(); @@ -44,6 +44,6 @@ void TagsTest::noDefaultConstructor() { CORRADE_VERIFY(!std::is_default_constructible::value); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::TagsTest) diff --git a/src/Magnum/Math/Test/TypeTraitsTest.cpp b/src/Magnum/Math/Test/TypeTraitsTest.cpp index dfce2aae8..39c6b9eb7 100644 --- a/src/Magnum/Math/Test/TypeTraitsTest.cpp +++ b/src/Magnum/Math/Test/TypeTraitsTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Math/TypeTraits.h" #include "Magnum/Math/Constants.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct TypeTraitsTest: Corrade::TestSuite::Tester { explicit TypeTraitsTest(); @@ -52,8 +52,6 @@ struct TypeTraitsTest: Corrade::TestSuite::Tester { template void equalsZeroFloatingPointLarge(); }; -namespace { - enum: std::size_t { EqualsZeroDataCount = 3 }; struct { @@ -92,8 +90,6 @@ struct { 0.2l}, }; -} - TypeTraitsTest::TypeTraitsTest() { addTests({&TypeTraitsTest::sizeOfLongDouble, &TypeTraitsTest::name, @@ -212,14 +208,12 @@ template void TypeTraitsTest::equalsFloatingPointNaN() { Constants::nan())); } -namespace { - /* Argh! Why there is no standard std::abs() for unsigned types? */ - template::value>::type> T abs(T value) { - return value; - } - template::value>::type> T abs(T value) { - return std::abs(value); - } +/* Argh! Why there is no standard std::abs() for unsigned types? */ +template::value>::type> T abs(T value) { + return value; +} +template::value>::type> T abs(T value) { + return std::abs(value); } template void TypeTraitsTest::equalsZeroIntegral() { @@ -248,6 +242,6 @@ template void TypeTraitsTest::equalsZeroFloatingPoint() { CORRADE_VERIFY(!TypeTraits::equalsZero(a - step*T(2.0) - a, magnitude)); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::TypeTraitsTest) diff --git a/src/Magnum/Math/Test/UnitTest.cpp b/src/Magnum/Math/Test/UnitTest.cpp index 463ae941c..578132593 100644 --- a/src/Magnum/Math/Test/UnitTest.cpp +++ b/src/Magnum/Math/Test/UnitTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Math/Constants.h" #include "Magnum/Math/Unit.h" -namespace Magnum { namespace Math { namespace Test { +namespace Magnum { namespace Math { namespace Test { namespace { struct UnitTest: Corrade::TestSuite::Tester { explicit UnitTest(); @@ -198,6 +198,6 @@ void UnitTest::multiplyDivide() { CORRADE_COMPARE(h, a); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::UnitTest) diff --git a/src/Magnum/Math/Test/Vector2Test.cpp b/src/Magnum/Math/Test/Vector2Test.cpp index 8ceccdc66..7f50ca2c5 100644 --- a/src/Magnum/Math/Test/Vector2Test.cpp +++ b/src/Magnum/Math/Test/Vector2Test.cpp @@ -50,7 +50,7 @@ template<> struct VectorConverter<2, float, Vec2> { } -namespace Test { +namespace Test { namespace { struct Vector2Test: Corrade::TestSuite::Tester { explicit Vector2Test(); @@ -270,6 +270,6 @@ void Vector2Test::configuration() { CORRADE_COMPARE(c.value("vector"), vec); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::Vector2Test) diff --git a/src/Magnum/Math/Test/Vector3Test.cpp b/src/Magnum/Math/Test/Vector3Test.cpp index 014b1f0ce..2fbafa049 100644 --- a/src/Magnum/Math/Test/Vector3Test.cpp +++ b/src/Magnum/Math/Test/Vector3Test.cpp @@ -50,7 +50,7 @@ template<> struct VectorConverter<3, float, Vec3> { } -namespace Test { +namespace Test { namespace { struct Vector3Test: Corrade::TestSuite::Tester { explicit Vector3Test(); @@ -294,6 +294,6 @@ void Vector3Test::configuration() { CORRADE_COMPARE(c.value("vector"), vec); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::Vector3Test) diff --git a/src/Magnum/Math/Test/Vector4Test.cpp b/src/Magnum/Math/Test/Vector4Test.cpp index b37da91b6..e545964bb 100644 --- a/src/Magnum/Math/Test/Vector4Test.cpp +++ b/src/Magnum/Math/Test/Vector4Test.cpp @@ -50,7 +50,7 @@ template<> struct VectorConverter<4, float, Vec4> { } -namespace Test { +namespace Test { namespace { struct Vector4Test: Corrade::TestSuite::Tester { explicit Vector4Test(); @@ -337,6 +337,6 @@ void Vector4Test::configuration() { CORRADE_COMPARE(c.value("vector"), vec); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::Vector4Test) diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index 547debb64..789efcbf1 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -50,7 +50,7 @@ template<> struct VectorConverter<3, Float, Vec3> { } -namespace Test { +namespace Test { namespace { struct VectorTest: Corrade::TestSuite::Tester { explicit VectorTest(); @@ -773,6 +773,6 @@ void VectorTest::configuration() { CORRADE_COMPARE(c.value("overflow"), (Vector4{2.0f, 1.0f, 8.0f, 9.0f})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Math::Test::VectorTest) diff --git a/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp b/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp index 4ee9bca05..80c291587 100644 --- a/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp +++ b/src/Magnum/MeshTools/Test/CombineIndexedArraysTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Magnum.h" #include "Magnum/MeshTools/CombineIndexedArrays.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct CombineIndexedArraysTest: TestSuite::Tester { explicit CombineIndexedArraysTest(); @@ -87,6 +87,6 @@ void CombineIndexedArraysTest::indexedArrays() { CORRADE_COMPARE(array3, (std::vector{6, 7})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::CombineIndexedArraysTest) diff --git a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp index 6cd716511..cfcd01d6f 100644 --- a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp +++ b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/MeshTools/CompressIndices.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct CompressIndicesTest: TestSuite::Tester { explicit CompressIndicesTest(); @@ -125,6 +125,6 @@ void CompressIndicesTest::compressAsShort() { CORRADE_COMPARE(out.str(), "MeshTools::compressIndicesAs(): type too small to represent value 65536\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::CompressIndicesTest) diff --git a/src/Magnum/MeshTools/Test/DuplicateTest.cpp b/src/Magnum/MeshTools/Test/DuplicateTest.cpp index ddd77863d..0f28775c9 100644 --- a/src/Magnum/MeshTools/Test/DuplicateTest.cpp +++ b/src/Magnum/MeshTools/Test/DuplicateTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Magnum.h" #include "Magnum/MeshTools/Duplicate.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct DuplicateTest: TestSuite::Tester { explicit DuplicateTest(); @@ -45,6 +45,6 @@ void DuplicateTest::duplicate() { (std::vector{35, 35, -7, -18, 12, 12})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::DuplicateTest) diff --git a/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp b/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp index d225af195..d9f2791a5 100644 --- a/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp +++ b/src/Magnum/MeshTools/Test/FlipNormalsTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Vector3.h" #include "Magnum/MeshTools/FlipNormals.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct FlipNormalsTest: TestSuite::Tester { explicit FlipNormalsTest(); @@ -75,6 +75,6 @@ void FlipNormalsTest::flipNormals() { -Vector3::zAxis()})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::FlipNormalsTest) diff --git a/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp b/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp index e5d05b55e..1a123d050 100644 --- a/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp +++ b/src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Vector3.h" #include "Magnum/MeshTools/GenerateFlatNormals.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct GenerateFlatNormalsTest: TestSuite::Tester { explicit GenerateFlatNormalsTest(); @@ -81,6 +81,6 @@ void GenerateFlatNormalsTest::generate() { })); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::GenerateFlatNormalsTest) diff --git a/src/Magnum/MeshTools/Test/InterleaveTest.cpp b/src/Magnum/MeshTools/Test/InterleaveTest.cpp index b56800fbb..db8437e4a 100644 --- a/src/Magnum/MeshTools/Test/InterleaveTest.cpp +++ b/src/Magnum/MeshTools/Test/InterleaveTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/MeshTools/Interleave.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct InterleaveTest: Corrade::TestSuite::Tester { explicit InterleaveTest(); @@ -157,6 +157,6 @@ void InterleaveTest::interleaveInto() { } } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::InterleaveTest) diff --git a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp index 71c1685ce..e10373f8e 100644 --- a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp +++ b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Math/Vector2.h" #include "Magnum/MeshTools/RemoveDuplicates.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct RemoveDuplicatesTest: TestSuite::Tester { explicit RemoveDuplicatesTest(); @@ -59,6 +59,6 @@ void RemoveDuplicatesTest::removeDuplicates() { })); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::RemoveDuplicatesTest) diff --git a/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.cpp b/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.cpp index 8ae02d541..f0452e478 100644 --- a/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.cpp +++ b/src/Magnum/MeshTools/Test/SubdivideRemoveDuplicatesBenchmark.cpp @@ -32,7 +32,7 @@ #include "Magnum/Primitives/Icosphere.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct SubdivideRemoveDuplicatesBenchmark: TestSuite::Tester { explicit SubdivideRemoveDuplicatesBenchmark(); @@ -89,7 +89,7 @@ void SubdivideRemoveDuplicatesBenchmark::subdivideAndRemoveDuplicatesInBetween() } } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::SubdivideRemoveDuplicatesBenchmark) diff --git a/src/Magnum/MeshTools/Test/SubdivideTest.cpp b/src/Magnum/MeshTools/Test/SubdivideTest.cpp index e7dd61c65..7eba6b955 100644 --- a/src/Magnum/MeshTools/Test/SubdivideTest.cpp +++ b/src/Magnum/MeshTools/Test/SubdivideTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/MeshTools/RemoveDuplicates.h" #include "Magnum/MeshTools/Subdivide.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct SubdivideTest: TestSuite::Tester { explicit SubdivideTest(); @@ -38,14 +38,10 @@ struct SubdivideTest: TestSuite::Tester { void subdivide(); }; -namespace { - typedef Math::Vector<1, Int> Vector1; inline Vector1 interpolator(Vector1 a, Vector1 b) { return (a[0]+b[0])/2; } -} - SubdivideTest::SubdivideTest() { addTests({&SubdivideTest::wrongIndexCount, &SubdivideTest::subdivide}); @@ -72,6 +68,6 @@ void SubdivideTest::subdivide() { CORRADE_COMPARE(indices, (std::vector{4, 5, 6, 7, 8, 9, 0, 4, 6, 4, 1, 5, 6, 5, 2, 1, 7, 9, 7, 2, 8, 9, 8, 3})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::SubdivideTest) diff --git a/src/Magnum/MeshTools/Test/TipsifyTest.cpp b/src/Magnum/MeshTools/Test/TipsifyTest.cpp index e51b9189f..2bb86f09c 100644 --- a/src/Magnum/MeshTools/Test/TipsifyTest.cpp +++ b/src/Magnum/MeshTools/Test/TipsifyTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Magnum.h" #include "Magnum/MeshTools/Tipsify.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct TipsifyTest: TestSuite::Tester { explicit TipsifyTest(); @@ -52,34 +52,32 @@ struct TipsifyTest: TestSuite::Tester { */ -namespace { - const std::vector Indices{ - 4, 1, 0, - 10, 9, 13, - 6, 3, 2, - 9, 5, 4, - 12, 9, 8, - 11, 7, 6, - - 14, 15, 11, - 2, 1, 5, - 10, 6, 5, - 10, 5, 9, - 13, 14, 10, - 1, 4, 5, - - 7, 3, 6, - 6, 2, 5, - 9, 4, 8, - 6, 10, 11, - 13, 9, 12, - 14, 11, 10, - - 16, 17, 18 - }; +const std::vector Indices{ + 4, 1, 0, + 10, 9, 13, + 6, 3, 2, + 9, 5, 4, + 12, 9, 8, + 11, 7, 6, + + 14, 15, 11, + 2, 1, 5, + 10, 6, 5, + 10, 5, 9, + 13, 14, 10, + 1, 4, 5, + + 7, 3, 6, + 6, 2, 5, + 9, 4, 8, + 6, 10, 11, + 13, 9, 12, + 14, 11, 10, + + 16, 17, 18 +}; - constexpr std::size_t VertexCount = 19; -} +constexpr std::size_t VertexCount = 19; TipsifyTest::TipsifyTest() { addTests({&TipsifyTest::buildAdjacency, @@ -159,6 +157,6 @@ void TipsifyTest::tipsify() { })); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::TipsifyTest) diff --git a/src/Magnum/MeshTools/Test/TransformTest.cpp b/src/Magnum/MeshTools/Test/TransformTest.cpp index 74040fc76..a5defd20b 100644 --- a/src/Magnum/MeshTools/Test/TransformTest.cpp +++ b/src/Magnum/MeshTools/Test/TransformTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Magnum.h" #include "Magnum/MeshTools/Transform.h" -namespace Magnum { namespace MeshTools { namespace Test { +namespace Magnum { namespace MeshTools { namespace Test { namespace { struct TransformTest: TestSuite::Tester { explicit TransformTest(); @@ -116,6 +116,6 @@ void TransformTest::transformPoints3D() { CORRADE_COMPARE(quaternion, points3DRotatedTranslated); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::MeshTools::Test::TransformTest) diff --git a/src/Magnum/Platform/Test/AndroidApplicationTest.cpp b/src/Magnum/Platform/Test/AndroidApplicationTest.cpp index fdd7e9258..ed82c599e 100644 --- a/src/Magnum/Platform/Test/AndroidApplicationTest.cpp +++ b/src/Magnum/Platform/Test/AndroidApplicationTest.cpp @@ -25,7 +25,7 @@ #include "Magnum/Platform/AndroidApplication.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct AndroidApplicationTest: Platform::Application { explicit AndroidApplicationTest(const Arguments& arguments): Platform::Application{arguments} { @@ -45,6 +45,6 @@ struct AndroidApplicationTest: Platform::Application { } }; -}}} +}}}} MAGNUM_APPLICATION_MAIN(Magnum::Platform::Test::AndroidApplicationTest) diff --git a/src/Magnum/Platform/Test/GlfwApplicationTest.cpp b/src/Magnum/Platform/Test/GlfwApplicationTest.cpp index 841858da4..2bcb9b030 100644 --- a/src/Magnum/Platform/Test/GlfwApplicationTest.cpp +++ b/src/Magnum/Platform/Test/GlfwApplicationTest.cpp @@ -25,7 +25,7 @@ #include "Magnum/Platform/GlfwApplication.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct GlfwApplicationTest: Platform::Application { explicit GlfwApplicationTest(const Arguments& arguments): Platform::Application{arguments} {} @@ -38,6 +38,6 @@ struct GlfwApplicationTest: Platform::Application { void drawEvent() override {} }; -}}} +}}}} MAGNUM_APPLICATION_MAIN(Magnum::Platform::Test::GlfwApplicationTest) diff --git a/src/Magnum/Platform/Test/GlutApplicationTest.cpp b/src/Magnum/Platform/Test/GlutApplicationTest.cpp index e3ffcdfeb..beebe91a6 100644 --- a/src/Magnum/Platform/Test/GlutApplicationTest.cpp +++ b/src/Magnum/Platform/Test/GlutApplicationTest.cpp @@ -28,14 +28,14 @@ #include "Magnum/Platform/GlutApplication.h" CORRADE_IGNORE_DEPRECATED_PUSH -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct GlutApplicationTest: Platform::Application { explicit GlutApplicationTest(const Arguments& arguments): Platform::Application{arguments} {} void drawEvent() override {} }; -}}} +}}}} MAGNUM_APPLICATION_MAIN(Magnum::Platform::Test::GlutApplicationTest) CORRADE_IGNORE_DEPRECATED_POP diff --git a/src/Magnum/Platform/Test/GlxApplicationTest.cpp b/src/Magnum/Platform/Test/GlxApplicationTest.cpp index 566fb15c0..8e9e345b4 100644 --- a/src/Magnum/Platform/Test/GlxApplicationTest.cpp +++ b/src/Magnum/Platform/Test/GlxApplicationTest.cpp @@ -25,13 +25,13 @@ #include "Magnum/Platform/GlxApplication.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct GlxApplicationTest: Platform::Application { explicit GlxApplicationTest(const Arguments& arguments): Platform::Application{arguments} {} void drawEvent() override {} }; -}}} +}}}} MAGNUM_APPLICATION_MAIN(Magnum::Platform::Test::GlxApplicationTest) diff --git a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp index f7a0f1412..74372d95d 100644 --- a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp +++ b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp @@ -25,7 +25,7 @@ #include "Magnum/Platform/Sdl2Application.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct Sdl2ApplicationTest: Platform::Application { /* For testing resize events */ @@ -54,6 +54,6 @@ struct Sdl2ApplicationTest: Platform::Application { } }; -}}} +}}}} MAGNUM_APPLICATION_MAIN(Magnum::Platform::Test::Sdl2ApplicationTest) diff --git a/src/Magnum/Platform/Test/WindowlessCglApplicationTest.cpp b/src/Magnum/Platform/Test/WindowlessCglApplicationTest.cpp index ce9449926..131a56031 100644 --- a/src/Magnum/Platform/Test/WindowlessCglApplicationTest.cpp +++ b/src/Magnum/Platform/Test/WindowlessCglApplicationTest.cpp @@ -25,13 +25,13 @@ #include "Magnum/Platform/WindowlessCglApplication.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct WindowlessCglApplicationTest: Platform::WindowlessApplication { explicit WindowlessCglApplicationTest(const Arguments& arguments): Platform::WindowlessApplication{arguments} {} int exec() override { return 0; } }; -}}} +}}}} MAGNUM_WINDOWLESSAPPLICATION_MAIN(Magnum::Platform::Test::WindowlessCglApplicationTest) diff --git a/src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp b/src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp index 0d7c0a7bb..968ac9139 100644 --- a/src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp +++ b/src/Magnum/Platform/Test/WindowlessEglApplicationTest.cpp @@ -25,13 +25,13 @@ #include "Magnum/Platform/WindowlessEglApplication.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct WindowlessEglApplicationTest: Platform::WindowlessApplication { explicit WindowlessEglApplicationTest(const Arguments& arguments): Platform::WindowlessApplication{arguments} {} int exec() override { return 0; } }; -}}} +}}}} MAGNUM_WINDOWLESSAPPLICATION_MAIN(Magnum::Platform::Test::WindowlessEglApplicationTest) diff --git a/src/Magnum/Platform/Test/WindowlessGlxApplicationTest.cpp b/src/Magnum/Platform/Test/WindowlessGlxApplicationTest.cpp index 0adbc00c9..90ebf3bad 100644 --- a/src/Magnum/Platform/Test/WindowlessGlxApplicationTest.cpp +++ b/src/Magnum/Platform/Test/WindowlessGlxApplicationTest.cpp @@ -25,13 +25,13 @@ #include "Magnum/Platform/WindowlessGlxApplication.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct WindowlessGlxApplicationTest: Platform::WindowlessApplication { explicit WindowlessGlxApplicationTest(const Arguments& arguments): Platform::WindowlessApplication{arguments} {} int exec() override { return 0; } }; -}}} +}}}} MAGNUM_WINDOWLESSAPPLICATION_MAIN(Magnum::Platform::Test::WindowlessGlxApplicationTest) diff --git a/src/Magnum/Platform/Test/WindowlessIosApplicationTest.cpp b/src/Magnum/Platform/Test/WindowlessIosApplicationTest.cpp index 808a5a271..29f654a99 100644 --- a/src/Magnum/Platform/Test/WindowlessIosApplicationTest.cpp +++ b/src/Magnum/Platform/Test/WindowlessIosApplicationTest.cpp @@ -25,13 +25,13 @@ #include "Magnum/Platform/WindowlessIosApplication.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct WindowlessIosApplicationTest: Platform::WindowlessApplication { explicit WindowlessIosApplicationTest(const Arguments& arguments): Platform::WindowlessApplication{arguments} {} int exec() override { return 0; } }; -}}} +}}}} MAGNUM_WINDOWLESSAPPLICATION_MAIN(Magnum::Platform::Test::WindowlessIosApplicationTest) diff --git a/src/Magnum/Platform/Test/WindowlessWglApplicationTest.cpp b/src/Magnum/Platform/Test/WindowlessWglApplicationTest.cpp index de063eb8a..d9965f40d 100644 --- a/src/Magnum/Platform/Test/WindowlessWglApplicationTest.cpp +++ b/src/Magnum/Platform/Test/WindowlessWglApplicationTest.cpp @@ -25,13 +25,13 @@ #include "Magnum/Platform/WindowlessWglApplication.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct WindowlessWglApplicationTest: Platform::WindowlessApplication { explicit WindowlessWglApplicationTest(const Arguments& arguments): Platform::WindowlessApplication{arguments} {} int exec() override { return 0; } }; -}}} +}}}} MAGNUM_WINDOWLESSAPPLICATION_MAIN(Magnum::Platform::Test::WindowlessWglApplicationTest) diff --git a/src/Magnum/Platform/Test/WindowlessWindowsEglApplicationTest.cpp b/src/Magnum/Platform/Test/WindowlessWindowsEglApplicationTest.cpp index 9cb01c2f9..9cd6a3881 100644 --- a/src/Magnum/Platform/Test/WindowlessWindowsEglApplicationTest.cpp +++ b/src/Magnum/Platform/Test/WindowlessWindowsEglApplicationTest.cpp @@ -25,13 +25,13 @@ #include "Magnum/Platform/WindowlessWindowsEglApplication.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct WindowlessWindowsEglApplicationTest: Platform::WindowlessApplication { explicit WindowlessWindowsEglApplicationTest(const Arguments& arguments): Platform::WindowlessApplication{arguments} {} int exec() override { return 0; } }; -}}} +}}}} MAGNUM_WINDOWLESSAPPLICATION_MAIN(Magnum::Platform::Test::WindowlessWindowsEglApplicationTest) diff --git a/src/Magnum/Platform/Test/XEglApplicationTest.cpp b/src/Magnum/Platform/Test/XEglApplicationTest.cpp index 41120fa54..7823aea1b 100644 --- a/src/Magnum/Platform/Test/XEglApplicationTest.cpp +++ b/src/Magnum/Platform/Test/XEglApplicationTest.cpp @@ -25,13 +25,13 @@ #include "Magnum/Platform/XEglApplication.h" -namespace Magnum { namespace Platform { namespace Test { +namespace Magnum { namespace Platform { namespace Test { namespace { struct XEglApplicationTest: Platform::Application { explicit XEglApplicationTest(const Arguments& arguments): Platform::Application{arguments} {} void drawEvent() override {} }; -}}} +}}}} MAGNUM_APPLICATION_MAIN(Magnum::Platform::Test::XEglApplicationTest) diff --git a/src/Magnum/Primitives/Test/AxisTest.cpp b/src/Magnum/Primitives/Test/AxisTest.cpp index 6c2951584..f1f93ac36 100644 --- a/src/Magnum/Primitives/Test/AxisTest.cpp +++ b/src/Magnum/Primitives/Test/AxisTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Trade/MeshData2D.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct AxisTest: TestSuite::Tester { explicit AxisTest(); @@ -63,6 +63,6 @@ void AxisTest::threeDimensions() { CORRADE_COMPARE(axis.colors(0).size(), 12); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::AxisTest) diff --git a/src/Magnum/Primitives/Test/CapsuleTest.cpp b/src/Magnum/Primitives/Test/CapsuleTest.cpp index 65b2c8a11..4ae068aaa 100644 --- a/src/Magnum/Primitives/Test/CapsuleTest.cpp +++ b/src/Magnum/Primitives/Test/CapsuleTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Trade/MeshData3D.h" #include "Magnum/Primitives/Capsule.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct CapsuleTest: TestSuite::Tester { explicit CapsuleTest(); @@ -320,6 +320,6 @@ void CapsuleTest::wireframe3D() { }), TestSuite::Compare::Container); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::CapsuleTest) diff --git a/src/Magnum/Primitives/Test/CircleTest.cpp b/src/Magnum/Primitives/Test/CircleTest.cpp index 6dd2f3b53..a50174fce 100644 --- a/src/Magnum/Primitives/Test/CircleTest.cpp +++ b/src/Magnum/Primitives/Test/CircleTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Trade/MeshData2D.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct CircleTest: TestSuite::Tester { explicit CircleTest(); @@ -117,6 +117,6 @@ void CircleTest::wireframe3D() { })); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::CircleTest) diff --git a/src/Magnum/Primitives/Test/ConeTest.cpp b/src/Magnum/Primitives/Test/ConeTest.cpp index f119b7c37..5f12315a3 100644 --- a/src/Magnum/Primitives/Test/ConeTest.cpp +++ b/src/Magnum/Primitives/Test/ConeTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Primitives/Cone.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct ConeTest: TestSuite::Tester { explicit ConeTest(); @@ -195,6 +195,6 @@ void ConeTest::wireframe() { }), TestSuite::Compare::Container); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::ConeTest) diff --git a/src/Magnum/Primitives/Test/CrosshairTest.cpp b/src/Magnum/Primitives/Test/CrosshairTest.cpp index 8c9c2dce6..8b2474c5a 100644 --- a/src/Magnum/Primitives/Test/CrosshairTest.cpp +++ b/src/Magnum/Primitives/Test/CrosshairTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Trade/MeshData2D.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct CrosshairTest: TestSuite::Tester { explicit CrosshairTest(); @@ -61,6 +61,6 @@ void CrosshairTest::threeDimensions() { CORRADE_COMPARE(crosshair.positions(0).size(), 6); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::CrosshairTest) diff --git a/src/Magnum/Primitives/Test/CubeTest.cpp b/src/Magnum/Primitives/Test/CubeTest.cpp index 705f00cad..5e4398ea5 100644 --- a/src/Magnum/Primitives/Test/CubeTest.cpp +++ b/src/Magnum/Primitives/Test/CubeTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Primitives/Cube.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct CubeTest: TestSuite::Tester { explicit CubeTest(); @@ -72,6 +72,6 @@ void CubeTest::wireframe() { CORRADE_COMPARE(cube.positions(0).size(), 8); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::CubeTest) diff --git a/src/Magnum/Primitives/Test/CylinderTest.cpp b/src/Magnum/Primitives/Test/CylinderTest.cpp index d2ea97227..fbd7f7e15 100644 --- a/src/Magnum/Primitives/Test/CylinderTest.cpp +++ b/src/Magnum/Primitives/Test/CylinderTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Primitives/Cylinder.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct CylinderTest: TestSuite::Tester { explicit CylinderTest(); @@ -241,6 +241,6 @@ void CylinderTest::wireframe() { }), TestSuite::Compare::Container); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::CylinderTest) diff --git a/src/Magnum/Primitives/Test/GradientTest.cpp b/src/Magnum/Primitives/Test/GradientTest.cpp index dab574277..bd56babf3 100644 --- a/src/Magnum/Primitives/Test/GradientTest.cpp +++ b/src/Magnum/Primitives/Test/GradientTest.cpp @@ -34,7 +34,7 @@ #include "Magnum/Primitives/Square.h" #include "Magnum/Primitives/Plane.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct GradientTest: TestSuite::Tester { explicit GradientTest(); @@ -162,6 +162,6 @@ void GradientTest::gradient3DVertical() { }), TestSuite::Compare::Container); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::GradientTest) diff --git a/src/Magnum/Primitives/Test/GridTest.cpp b/src/Magnum/Primitives/Test/GridTest.cpp index 7994b13d5..f5114d8b8 100644 --- a/src/Magnum/Primitives/Test/GridTest.cpp +++ b/src/Magnum/Primitives/Test/GridTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Primitives/Grid.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct GridTest: TestSuite::Tester { explicit GridTest(); @@ -372,6 +372,6 @@ void GridTest::wireframe3D() { }), TestSuite::Compare::Container); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::GridTest) diff --git a/src/Magnum/Primitives/Test/IcosphereTest.cpp b/src/Magnum/Primitives/Test/IcosphereTest.cpp index 3311a5899..b6cbf2c7e 100644 --- a/src/Magnum/Primitives/Test/IcosphereTest.cpp +++ b/src/Magnum/Primitives/Test/IcosphereTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Primitives/Icosphere.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct IcosphereTest: TestSuite::Tester { explicit IcosphereTest(); @@ -52,6 +52,6 @@ void IcosphereTest::count() { CORRADE_COMPARE(data.normals(0).size(), 162); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::IcosphereTest) diff --git a/src/Magnum/Primitives/Test/LineTest.cpp b/src/Magnum/Primitives/Test/LineTest.cpp index 9684c322a..02c0f7972 100644 --- a/src/Magnum/Primitives/Test/LineTest.cpp +++ b/src/Magnum/Primitives/Test/LineTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Trade/MeshData2D.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct LineTest: TestSuite::Tester { explicit LineTest(); @@ -61,6 +61,6 @@ void LineTest::threeDimensions() { CORRADE_COMPARE(line.positions(0).size(), 2); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::LineTest) diff --git a/src/Magnum/Primitives/Test/PlaneTest.cpp b/src/Magnum/Primitives/Test/PlaneTest.cpp index 672520606..14ce8ba94 100644 --- a/src/Magnum/Primitives/Test/PlaneTest.cpp +++ b/src/Magnum/Primitives/Test/PlaneTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Primitives/Plane.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct PlaneTest: TestSuite::Tester { explicit PlaneTest(); @@ -75,6 +75,6 @@ void PlaneTest::wireframe() { CORRADE_COMPARE(plane.positions(0).size(), 4); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::PlaneTest) diff --git a/src/Magnum/Primitives/Test/SquareTest.cpp b/src/Magnum/Primitives/Test/SquareTest.cpp index 8f0d82f57..d4abf8bfc 100644 --- a/src/Magnum/Primitives/Test/SquareTest.cpp +++ b/src/Magnum/Primitives/Test/SquareTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Primitives/Square.h" #include "Magnum/Trade/MeshData2D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct SquareTest: TestSuite::Tester { explicit SquareTest(); @@ -73,7 +73,7 @@ void SquareTest::wireframe() { CORRADE_COMPARE(square.positions(0).size(), 4); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::SquareTest) diff --git a/src/Magnum/Primitives/Test/UVSphereTest.cpp b/src/Magnum/Primitives/Test/UVSphereTest.cpp index eb289c19b..98efb97b0 100644 --- a/src/Magnum/Primitives/Test/UVSphereTest.cpp +++ b/src/Magnum/Primitives/Test/UVSphereTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Primitives/UVSphere.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Primitives { namespace Test { +namespace Magnum { namespace Primitives { namespace Test { namespace { struct UVSphereTest: TestSuite::Tester { explicit UVSphereTest(); @@ -184,6 +184,6 @@ void UVSphereTest::wireframe() { }), TestSuite::Compare::Container); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Primitives::Test::UVSphereTest) diff --git a/src/Magnum/SceneGraph/Test/AnimableTest.cpp b/src/Magnum/SceneGraph/Test/AnimableTest.cpp index c475bfd7c..08a8fb25b 100644 --- a/src/Magnum/SceneGraph/Test/AnimableTest.cpp +++ b/src/Magnum/SceneGraph/Test/AnimableTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/SceneGraph/AnimableGroup.h" #include "Magnum/SceneGraph/MatrixTransformation3D.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { struct AnimableTest: TestSuite::Tester { explicit AnimableTest(); @@ -383,6 +383,6 @@ void AnimableTest::debug() { CORRADE_COMPARE(o.str(), "SceneGraph::AnimationState::Running SceneGraph::AnimationState(0xbe)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::AnimableTest) diff --git a/src/Magnum/SceneGraph/Test/CameraTest.cpp b/src/Magnum/SceneGraph/Test/CameraTest.cpp index a3c38d02d..f07116d32 100644 --- a/src/Magnum/SceneGraph/Test/CameraTest.cpp +++ b/src/Magnum/SceneGraph/Test/CameraTest.cpp @@ -34,7 +34,7 @@ #include "Magnum/SceneGraph/MatrixTransformation3D.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { struct CameraTest: TestSuite::Tester { explicit CameraTest(); @@ -267,6 +267,6 @@ void CameraTest::drawOrdered() { }), TestSuite::Compare::Container); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::CameraTest) diff --git a/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp b/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp index 8207d6443..f338d3bd6 100644 --- a/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp +++ b/src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/SceneGraph/DualComplexTransformation.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { typedef Object Object2D; typedef Scene Scene2D; @@ -175,6 +175,6 @@ void DualComplexTransformationTest::normalizeRotation() { CORRADE_COMPARE(o.transformationMatrix(), Matrix3::rotation(Deg(17.0f))); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::DualComplexTransformationTest) diff --git a/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp b/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp index 7e7fbdda8..5da3b15b6 100644 --- a/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp +++ b/src/Magnum/SceneGraph/Test/DualQuaternionTransformationTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/SceneGraph/DualQuaternionTransformation.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { typedef Object Object3D; typedef Scene Scene3D; @@ -197,6 +197,6 @@ void DualQuaternionTransformationTest::normalizeRotation() { CORRADE_COMPARE(o.transformationMatrix(), Matrix4::rotationX(Deg(17.0f))); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::DualQuaternionTransformationTest) diff --git a/src/Magnum/SceneGraph/Test/MatrixTransformation2DTest.cpp b/src/Magnum/SceneGraph/Test/MatrixTransformation2DTest.cpp index cf63cd7d8..76f4ecd9b 100644 --- a/src/Magnum/SceneGraph/Test/MatrixTransformation2DTest.cpp +++ b/src/Magnum/SceneGraph/Test/MatrixTransformation2DTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/SceneGraph/MatrixTransformation2D.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { typedef Object Object2D; typedef Scene Scene2D; @@ -182,6 +182,6 @@ void MatrixTransformation2DTest::reflect() { } } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::MatrixTransformation2DTest) diff --git a/src/Magnum/SceneGraph/Test/MatrixTransformation3DTest.cpp b/src/Magnum/SceneGraph/Test/MatrixTransformation3DTest.cpp index 2efe6c06b..cc6afeb7c 100644 --- a/src/Magnum/SceneGraph/Test/MatrixTransformation3DTest.cpp +++ b/src/Magnum/SceneGraph/Test/MatrixTransformation3DTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/SceneGraph/MatrixTransformation3D.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { typedef Object Object3D; typedef Scene Scene3D; @@ -198,6 +198,6 @@ void MatrixTransformation3DTest::reflect() { } } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::MatrixTransformation3DTest) diff --git a/src/Magnum/SceneGraph/Test/ObjectTest.cpp b/src/Magnum/SceneGraph/Test/ObjectTest.cpp index d18a0b530..fea60bcd9 100644 --- a/src/Magnum/SceneGraph/Test/ObjectTest.cpp +++ b/src/Magnum/SceneGraph/Test/ObjectTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/SceneGraph/MatrixTransformation3D.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { struct ObjectTest: TestSuite::Tester { explicit ObjectTest(); @@ -515,6 +515,6 @@ void ObjectTest::rangeBasedForFeatures() { CORRADE_COMPARE(features, (std::vector{&a, &b, &c})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::ObjectTest) diff --git a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp index f92e46b89..2d50bf5b9 100644 --- a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp +++ b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation2DTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/SceneGraph/RigidMatrixTransformation2D.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { typedef Object Object2D; typedef Scene Scene2D; @@ -194,6 +194,6 @@ void RigidMatrixTransformation2DTest::normalizeRotation() { CORRADE_COMPARE(o.transformationMatrix(), Matrix3::rotation(Deg(17.0f))); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::RigidMatrixTransformation2DTest) diff --git a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp index af7976549..2d9d144f4 100644 --- a/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp +++ b/src/Magnum/SceneGraph/Test/RigidMatrixTransformation3DTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/SceneGraph/RigidMatrixTransformation3D.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { typedef Object Object3D; typedef Scene Scene3D; @@ -211,6 +211,6 @@ void RigidMatrixTransformation3DTest::normalizeRotation() { CORRADE_COMPARE(o.transformationMatrix(), Matrix4::rotationX(Deg(17.0f))); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::RigidMatrixTransformation3DTest) diff --git a/src/Magnum/SceneGraph/Test/SceneTest.cpp b/src/Magnum/SceneGraph/Test/SceneTest.cpp index c1f199872..762261043 100644 --- a/src/Magnum/SceneGraph/Test/SceneTest.cpp +++ b/src/Magnum/SceneGraph/Test/SceneTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/SceneGraph/MatrixTransformation3D.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { struct SceneTest: TestSuite::Tester { explicit SceneTest(); @@ -65,6 +65,6 @@ void SceneTest::parent() { CORRADE_VERIFY(object.children().isEmpty()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::SceneTest) diff --git a/src/Magnum/SceneGraph/Test/TranslationRotationScalingTransformation2DTest.cpp b/src/Magnum/SceneGraph/Test/TranslationRotationScalingTransformation2DTest.cpp index 8ba672f41..624a07701 100644 --- a/src/Magnum/SceneGraph/Test/TranslationRotationScalingTransformation2DTest.cpp +++ b/src/Magnum/SceneGraph/Test/TranslationRotationScalingTransformation2DTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/SceneGraph/TranslationRotationScalingTransformation2D.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { typedef Object Object2D; typedef Scene Scene2D; @@ -218,6 +218,6 @@ void TranslationRotationScalingTransformation2DTest::scale() { } } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::TranslationRotationScalingTransformation2DTest) diff --git a/src/Magnum/SceneGraph/Test/TranslationRotationScalingTransformation3DTest.cpp b/src/Magnum/SceneGraph/Test/TranslationRotationScalingTransformation3DTest.cpp index 4d9e65289..948881d87 100644 --- a/src/Magnum/SceneGraph/Test/TranslationRotationScalingTransformation3DTest.cpp +++ b/src/Magnum/SceneGraph/Test/TranslationRotationScalingTransformation3DTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/SceneGraph/TranslationRotationScalingTransformation3D.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { typedef Object Object3D; typedef Scene Scene3D; @@ -234,6 +234,6 @@ void TranslationRotationScalingTransformation3DTest::scale() { } } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::TranslationRotationScalingTransformation3DTest) diff --git a/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp b/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp index e50db7b22..286f90bbc 100644 --- a/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp +++ b/src/Magnum/SceneGraph/Test/TranslationTransformationTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/SceneGraph/TranslationTransformation.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace SceneGraph { namespace Test { +namespace Magnum { namespace SceneGraph { namespace Test { namespace { typedef Object Object2D; typedef Scene Scene2D; @@ -139,6 +139,6 @@ void TranslationTransformationTest::integral() { CORRADE_COMPARE(o.transformationMatrix(), Matrix3::translation({3.0f, -7.0f})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::SceneGraph::Test::TranslationTransformationTest) diff --git a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp index aff7ce63e..3658f0192 100644 --- a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp @@ -26,7 +26,7 @@ #include "Magnum/GL/OpenGLTester.h" #include "Magnum/Shaders/DistanceFieldVector.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct DistanceFieldVectorGLTest: GL::OpenGLTester { explicit DistanceFieldVectorGLTest(); @@ -102,6 +102,6 @@ void DistanceFieldVectorGLTest::constructMove3D() { CORRADE_VERIFY(!b.id()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::DistanceFieldVectorGLTest) diff --git a/src/Magnum/Shaders/Test/DistanceFieldVectorTest.cpp b/src/Magnum/Shaders/Test/DistanceFieldVectorTest.cpp index 176d90e0f..7d0e071e2 100644 --- a/src/Magnum/Shaders/Test/DistanceFieldVectorTest.cpp +++ b/src/Magnum/Shaders/Test/DistanceFieldVectorTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/Shaders/DistanceFieldVector.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct DistanceFieldVectorTest: TestSuite::Tester { explicit DistanceFieldVectorTest(); @@ -75,6 +75,6 @@ void DistanceFieldVectorTest::constructCopy3D() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::DistanceFieldVectorTest) diff --git a/src/Magnum/Shaders/Test/FlatGLTest.cpp b/src/Magnum/Shaders/Test/FlatGLTest.cpp index 238f88d96..b13af52bb 100644 --- a/src/Magnum/Shaders/Test/FlatGLTest.cpp +++ b/src/Magnum/Shaders/Test/FlatGLTest.cpp @@ -33,7 +33,7 @@ #include "Magnum/GL/OpenGLTester.h" #include "Magnum/Shaders/Flat.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct FlatGLTest: GL::OpenGLTester { explicit FlatGLTest(); @@ -49,8 +49,6 @@ struct FlatGLTest: GL::OpenGLTester { template void setAlphaMaskNotEnabled(); }; -namespace { - constexpr struct { const char* name; Flat2D::Flags flags; @@ -59,8 +57,6 @@ constexpr struct { {"textured", Flat2D::Flag::Textured} }; -} - FlatGLTest::FlatGLTest() { addInstancedTests({ &FlatGLTest::construct<2>, @@ -173,6 +169,6 @@ template void FlatGLTest::setAlphaMaskNotEnabled() { "Shaders::Flat::setAlphaMask(): the shader was not created with alpha mask enabled\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::FlatGLTest) diff --git a/src/Magnum/Shaders/Test/FlatTest.cpp b/src/Magnum/Shaders/Test/FlatTest.cpp index ff642a793..b64176533 100644 --- a/src/Magnum/Shaders/Test/FlatTest.cpp +++ b/src/Magnum/Shaders/Test/FlatTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Shaders/Flat.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct FlatTest: TestSuite::Tester { explicit FlatTest(); @@ -96,6 +96,6 @@ void FlatTest::debugFlags() { CORRADE_COMPARE(out.str(), "Shaders::Flat::Flag::Textured|Shaders::Flat::Flag::AlphaMask Shaders::Flat::Flags{}\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::FlatTest) diff --git a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp index b01ddab36..4936ce24a 100644 --- a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp +++ b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/OpenGLTester.h" #include "Magnum/Shaders/MeshVisualizer.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct MeshVisualizerGLTest: GL::OpenGLTester { explicit MeshVisualizerGLTest(); @@ -122,6 +122,6 @@ void MeshVisualizerGLTest::constructMove() { CORRADE_VERIFY(!b.id()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::MeshVisualizerGLTest) diff --git a/src/Magnum/Shaders/Test/MeshVisualizerTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerTest.cpp index f39bf22a8..55a2d6b0d 100644 --- a/src/Magnum/Shaders/Test/MeshVisualizerTest.cpp +++ b/src/Magnum/Shaders/Test/MeshVisualizerTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Shaders/MeshVisualizer.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct MeshVisualizerTest: TestSuite::Tester { explicit MeshVisualizerTest(); @@ -80,6 +80,6 @@ void MeshVisualizerTest::debugFlags() { #endif } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::MeshVisualizerTest) diff --git a/src/Magnum/Shaders/Test/PhongGLTest.cpp b/src/Magnum/Shaders/Test/PhongGLTest.cpp index 4ff7c1984..7eeb39ab6 100644 --- a/src/Magnum/Shaders/Test/PhongGLTest.cpp +++ b/src/Magnum/Shaders/Test/PhongGLTest.cpp @@ -32,7 +32,7 @@ #include "Magnum/GL/TextureFormat.h" #include "Magnum/Shaders/Phong.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct PhongGLTest: GL::OpenGLTester { explicit PhongGLTest(); @@ -222,6 +222,6 @@ void PhongGLTest::setWrongLightId() { "Shaders::Phong::setLightPosition(): light ID 3 is out of bounds for 3 lights\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::PhongGLTest) diff --git a/src/Magnum/Shaders/Test/PhongTest.cpp b/src/Magnum/Shaders/Test/PhongTest.cpp index e442cae38..8e19f7f8f 100644 --- a/src/Magnum/Shaders/Test/PhongTest.cpp +++ b/src/Magnum/Shaders/Test/PhongTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Shaders/Phong.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct PhongTest: TestSuite::Tester { explicit PhongTest(); @@ -76,6 +76,6 @@ void PhongTest::debugFlags() { CORRADE_COMPARE(out.str(), "Shaders::Phong::Flag::DiffuseTexture|Shaders::Phong::Flag::SpecularTexture Shaders::Phong::Flags{}\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::PhongTest) diff --git a/src/Magnum/Shaders/Test/VectorGLTest.cpp b/src/Magnum/Shaders/Test/VectorGLTest.cpp index bd65c4362..956a48087 100644 --- a/src/Magnum/Shaders/Test/VectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VectorGLTest.cpp @@ -26,7 +26,7 @@ #include "Magnum/GL/OpenGLTester.h" #include "Magnum/Shaders/Vector.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct VectorGLTest: GL::OpenGLTester { explicit VectorGLTest(); @@ -102,6 +102,6 @@ void VectorGLTest::constructMove3D() { CORRADE_VERIFY(!b.id()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::VectorGLTest) diff --git a/src/Magnum/Shaders/Test/VectorTest.cpp b/src/Magnum/Shaders/Test/VectorTest.cpp index 016f2db0a..98d40bb62 100644 --- a/src/Magnum/Shaders/Test/VectorTest.cpp +++ b/src/Magnum/Shaders/Test/VectorTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/Shaders/Vector.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct VectorTest: TestSuite::Tester { explicit VectorTest(); @@ -75,6 +75,6 @@ void VectorTest::constructCopy3D() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::VectorTest) diff --git a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp index 60b4eb41f..237c397e8 100644 --- a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp @@ -26,7 +26,7 @@ #include "Magnum/GL/OpenGLTester.h" #include "Magnum/Shaders/VertexColor.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct VertexColorGLTest: GL::OpenGLTester { explicit VertexColorGLTest(); @@ -102,6 +102,6 @@ void VertexColorGLTest::constructMove3D() { CORRADE_VERIFY(!b.id()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::VertexColorGLTest) diff --git a/src/Magnum/Shaders/Test/VertexColorTest.cpp b/src/Magnum/Shaders/Test/VertexColorTest.cpp index 178bc7df3..b5db9985c 100644 --- a/src/Magnum/Shaders/Test/VertexColorTest.cpp +++ b/src/Magnum/Shaders/Test/VertexColorTest.cpp @@ -27,7 +27,7 @@ #include "Magnum/Shaders/VertexColor.h" -namespace Magnum { namespace Shaders { namespace Test { +namespace Magnum { namespace Shaders { namespace Test { namespace { struct VertexColorTest: TestSuite::Tester { explicit VertexColorTest(); @@ -75,6 +75,6 @@ void VertexColorTest::constructCopy3D() { CORRADE_VERIFY(!(std::is_assignable{})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shaders::Test::VertexColorTest) diff --git a/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp b/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp index 62fcf34e2..3a0a73579 100644 --- a/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp +++ b/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp @@ -32,7 +32,7 @@ #include "ShapeTestBase.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct AxisAlignedBoxTest: TestSuite::Tester { explicit AxisAlignedBoxTest(); @@ -64,6 +64,6 @@ void AxisAlignedBoxTest::collisionPoint() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::AxisAlignedBoxTest) diff --git a/src/Magnum/Shapes/Test/BoxTest.cpp b/src/Magnum/Shapes/Test/BoxTest.cpp index f222f7e02..0c743c36c 100644 --- a/src/Magnum/Shapes/Test/BoxTest.cpp +++ b/src/Magnum/Shapes/Test/BoxTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Math/Matrix4.h" #include "Magnum/Shapes/Box.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct BoxTest: TestSuite::Tester { explicit BoxTest(); @@ -51,6 +51,6 @@ void BoxTest::transformed() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::BoxTest) diff --git a/src/Magnum/Shapes/Test/CapsuleTest.cpp b/src/Magnum/Shapes/Test/CapsuleTest.cpp index 2dddd546a..e1acad0ce 100644 --- a/src/Magnum/Shapes/Test/CapsuleTest.cpp +++ b/src/Magnum/Shapes/Test/CapsuleTest.cpp @@ -34,7 +34,7 @@ #include "ShapeTestBase.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct CapsuleTest: TestSuite::Tester { explicit CapsuleTest(); @@ -84,6 +84,6 @@ void CapsuleTest::collisionSphere() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::CapsuleTest) diff --git a/src/Magnum/Shapes/Test/CollisionTest.cpp b/src/Magnum/Shapes/Test/CollisionTest.cpp index 908c37a3c..19c2e7eac 100644 --- a/src/Magnum/Shapes/Test/CollisionTest.cpp +++ b/src/Magnum/Shapes/Test/CollisionTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Magnum.h" #include "Magnum/Shapes/Collision.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct CollisionTest: TestSuite::Tester { explicit CollisionTest(); @@ -60,6 +60,6 @@ void CollisionTest::flipped() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::CollisionTest) diff --git a/src/Magnum/Shapes/Test/CompositionTest.cpp b/src/Magnum/Shapes/Test/CompositionTest.cpp index f712af2f3..d1a6994dc 100644 --- a/src/Magnum/Shapes/Test/CompositionTest.cpp +++ b/src/Magnum/Shapes/Test/CompositionTest.cpp @@ -34,7 +34,7 @@ #include "ShapeTestBase.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct CompositionTest: TestSuite::Tester { explicit CompositionTest(); @@ -187,6 +187,6 @@ void CompositionTest::transformed() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::CompositionTest) diff --git a/src/Magnum/Shapes/Test/CylinderTest.cpp b/src/Magnum/Shapes/Test/CylinderTest.cpp index e34c9297c..3910f342d 100644 --- a/src/Magnum/Shapes/Test/CylinderTest.cpp +++ b/src/Magnum/Shapes/Test/CylinderTest.cpp @@ -34,7 +34,7 @@ #include "ShapeTestBase.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct CylinderTest: TestSuite::Tester { explicit CylinderTest(); @@ -84,6 +84,6 @@ void CylinderTest::collisionSphere() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::CylinderTest) diff --git a/src/Magnum/Shapes/Test/LineTest.cpp b/src/Magnum/Shapes/Test/LineTest.cpp index 825aa8d94..389825cd8 100644 --- a/src/Magnum/Shapes/Test/LineTest.cpp +++ b/src/Magnum/Shapes/Test/LineTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Math/Matrix4.h" #include "Magnum/Shapes/Line.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct LineTest: TestSuite::Tester { explicit LineTest(); @@ -52,6 +52,6 @@ void LineTest::transformed() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::LineTest) diff --git a/src/Magnum/Shapes/Test/PlaneTest.cpp b/src/Magnum/Shapes/Test/PlaneTest.cpp index f8ae2d38d..083538774 100644 --- a/src/Magnum/Shapes/Test/PlaneTest.cpp +++ b/src/Magnum/Shapes/Test/PlaneTest.cpp @@ -32,7 +32,7 @@ #include "ShapeTestBase.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct PlaneTest: TestSuite::Tester { explicit PlaneTest(); @@ -81,6 +81,6 @@ void PlaneTest::collisionLineSegment() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::PlaneTest) diff --git a/src/Magnum/Shapes/Test/PointTest.cpp b/src/Magnum/Shapes/Test/PointTest.cpp index 455ddc0e9..8d7259d4d 100644 --- a/src/Magnum/Shapes/Test/PointTest.cpp +++ b/src/Magnum/Shapes/Test/PointTest.cpp @@ -31,7 +31,7 @@ #include "Magnum/Math/Matrix4.h" #include "Magnum/Shapes/Point.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct PointTest: TestSuite::Tester { explicit PointTest(); @@ -51,6 +51,6 @@ void PointTest::transformed() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::PointTest) diff --git a/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp b/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp index 394516e10..d4e4a825e 100644 --- a/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp +++ b/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Shapes/shapeImplementation.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct ShapeImplementationTest: TestSuite::Tester { explicit ShapeImplementationTest(); @@ -54,6 +54,6 @@ void ShapeImplementationTest::debug() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::ShapeImplementationTest) diff --git a/src/Magnum/Shapes/Test/ShapeTest.cpp b/src/Magnum/Shapes/Test/ShapeTest.cpp index 6bc1a16ee..88c1d1acd 100644 --- a/src/Magnum/Shapes/Test/ShapeTest.cpp +++ b/src/Magnum/Shapes/Test/ShapeTest.cpp @@ -36,7 +36,7 @@ #include "Magnum/SceneGraph/MatrixTransformation3D.h" #include "Magnum/SceneGraph/Scene.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct ShapeTest: TestSuite::Tester { explicit ShapeTest(); @@ -226,6 +226,6 @@ void ShapeTest::shapeGroup() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::ShapeTest) diff --git a/src/Magnum/Shapes/Test/ShapeTestBase.h b/src/Magnum/Shapes/Test/ShapeTestBase.h index fcbf1652b..d93c31ff2 100644 --- a/src/Magnum/Shapes/Test/ShapeTestBase.h +++ b/src/Magnum/Shapes/Test/ShapeTestBase.h @@ -27,7 +27,7 @@ #include -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { #define VERIFY_COLLIDES(a, b) \ CORRADE_VERIFY(a % b); \ @@ -37,6 +37,6 @@ namespace Magnum { namespace Shapes { namespace Test { CORRADE_VERIFY(!(a % b)); \ CORRADE_VERIFY(!(b % a)); -}}} +}}}} #endif diff --git a/src/Magnum/Shapes/Test/SphereTest.cpp b/src/Magnum/Shapes/Test/SphereTest.cpp index 9e714883a..deb2a99fa 100644 --- a/src/Magnum/Shapes/Test/SphereTest.cpp +++ b/src/Magnum/Shapes/Test/SphereTest.cpp @@ -34,7 +34,7 @@ #include "ShapeTestBase.h" -namespace Magnum { namespace Shapes { namespace Test { +namespace Magnum { namespace Shapes { namespace Test { namespace { struct SphereTest: TestSuite::Tester { explicit SphereTest(); @@ -176,6 +176,6 @@ void SphereTest::collisionSphereInverted() { } CORRADE_IGNORE_DEPRECATED_POP -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Shapes::Test::SphereTest) diff --git a/src/Magnum/Test/ArrayTest.cpp b/src/Magnum/Test/ArrayTest.cpp index 5dad4b71d..722f8a766 100644 --- a/src/Magnum/Test/ArrayTest.cpp +++ b/src/Magnum/Test/ArrayTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Array.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct ArrayTest: TestSuite::Tester { explicit ArrayTest(); @@ -121,6 +121,6 @@ void ArrayTest::debug() { CORRADE_COMPARE(out.str(), "Array(5, 6, 7, 8) Array(13) Array(71, 2) Array(1, 2, 3)\n"); } -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::ArrayTest) diff --git a/src/Magnum/Test/ImageTest.cpp b/src/Magnum/Test/ImageTest.cpp index e16f8fc61..f8696e54f 100644 --- a/src/Magnum/Test/ImageTest.cpp +++ b/src/Magnum/Test/ImageTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Image.h" #include "Magnum/PixelFormat.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct ImageTest: TestSuite::Tester { explicit ImageTest(); @@ -103,8 +103,6 @@ ImageTest::ImageTest() { &ImageTest::releaseCompressed}); } -namespace { - namespace GL { enum class PixelFormat { RGB = 666 }; enum class PixelType { UnsignedShort = 1337 }; @@ -133,8 +131,6 @@ namespace Vk { enum class CompressedPixelFormat { Bc1SRGBAlpha = 42 }; } -} - void ImageTest::constructGeneric() { { auto data = new char[4*4]; @@ -663,6 +659,6 @@ void ImageTest::releaseCompressed() { CORRADE_COMPARE(a.size(), Vector2i()); } -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::ImageTest) diff --git a/src/Magnum/Test/ImageViewTest.cpp b/src/Magnum/Test/ImageViewTest.cpp index 764b6c8b6..34ab989ab 100644 --- a/src/Magnum/Test/ImageViewTest.cpp +++ b/src/Magnum/Test/ImageViewTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/ImageView.h" #include "Magnum/PixelFormat.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct ImageViewTest: TestSuite::Tester { explicit ImageViewTest(); @@ -83,8 +83,6 @@ ImageViewTest::ImageViewTest() { &ImageViewTest::setDataCompressedInvalidSize}); } -namespace { - namespace GL { enum class PixelFormat { RGB = 666 }; enum class PixelType { UnsignedShort = 1337 }; @@ -113,8 +111,6 @@ namespace Vk { enum class CompressedPixelFormat { Bc1SRGBAlpha = 42 }; } -} - void ImageViewTest::constructGeneric() { { const char data[4*4]{}; @@ -584,6 +580,6 @@ void ImageViewTest::setDataCompressedInvalidSize() { } } -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::ImageViewTest) diff --git a/src/Magnum/Test/MeshTest.cpp b/src/Magnum/Test/MeshTest.cpp index 786035104..de7872d50 100644 --- a/src/Magnum/Test/MeshTest.cpp +++ b/src/Magnum/Test/MeshTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Mesh.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct MeshTest: TestSuite::Tester { explicit MeshTest(); @@ -93,6 +93,6 @@ void MeshTest::configurationIndexType() { CORRADE_COMPARE(c.value("invalid"), MeshIndexType::UnsignedInt); } -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::MeshTest) diff --git a/src/Magnum/Test/PixelFormatTest.cpp b/src/Magnum/Test/PixelFormatTest.cpp index 92fc545e6..30b330dfc 100644 --- a/src/Magnum/Test/PixelFormatTest.cpp +++ b/src/Magnum/Test/PixelFormatTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/PixelFormat.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct PixelFormatTest: TestSuite::Tester { explicit PixelFormatTest(); @@ -211,6 +211,6 @@ void PixelFormatTest::compressedDebugImplementationSpecific() { CORRADE_COMPARE(out.str(), "CompressedPixelFormat::ImplementationSpecific(0xdead)\n"); } -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::PixelFormatTest) diff --git a/src/Magnum/Test/PixelStorageTest.cpp b/src/Magnum/Test/PixelStorageTest.cpp index 3503500a9..ad4ba2ebe 100644 --- a/src/Magnum/Test/PixelStorageTest.cpp +++ b/src/Magnum/Test/PixelStorageTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/PixelFormat.h" #include "Magnum/PixelStorage.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct PixelStorageTest: TestSuite::Tester { explicit PixelStorageTest(); @@ -283,6 +283,6 @@ void PixelStorageTest::dataOffsetSizeCompressed() { (std::pair{16*4*4 + 16*2 + 16, 16})); } -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::PixelStorageTest) diff --git a/src/Magnum/Test/ResourceManagerLocalInstanceTest.cpp b/src/Magnum/Test/ResourceManagerLocalInstanceTest.cpp index d0a3af6b6..c11c3d3aa 100644 --- a/src/Magnum/Test/ResourceManagerLocalInstanceTest.cpp +++ b/src/Magnum/Test/ResourceManagerLocalInstanceTest.cpp @@ -27,7 +27,7 @@ #include "ResourceManagerLocalInstanceTestLib.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct ResourceManagerLocalInstanceTest: TestSuite::Tester { explicit ResourceManagerLocalInstanceTest(); @@ -49,6 +49,6 @@ void ResourceManagerLocalInstanceTest::instance() { CORRADE_COMPARE(manager.state("integer"), ResourceState::Final); } -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::ResourceManagerLocalInstanceTest) diff --git a/src/Magnum/Test/ResourceManagerTest.cpp b/src/Magnum/Test/ResourceManagerTest.cpp index 14232452e..0ea2caab3 100644 --- a/src/Magnum/Test/ResourceManagerTest.cpp +++ b/src/Magnum/Test/ResourceManagerTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/AbstractResourceLoader.h" #include "Magnum/ResourceManager.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct ResourceManagerTest: TestSuite::Tester { explicit ResourceManagerTest(); @@ -339,6 +339,6 @@ void ResourceManagerTest::debugResourceState() { CORRADE_COMPARE(out.str(), "ResourceState::Loading ResourceState(0xbe)\n"); } -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::ResourceManagerTest) diff --git a/src/Magnum/Test/SamplerTest.cpp b/src/Magnum/Test/SamplerTest.cpp index 0f5299f16..00b10d3c2 100644 --- a/src/Magnum/Test/SamplerTest.cpp +++ b/src/Magnum/Test/SamplerTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Sampler.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct SamplerTest: TestSuite::Tester { explicit SamplerTest(); @@ -65,6 +65,6 @@ void SamplerTest::debugWrapping() { CORRADE_COMPARE(out.str(), "SamplerWrapping::ClampToEdge SamplerWrapping(0xdead)\n"); } -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::SamplerTest) diff --git a/src/Magnum/Test/TagsTest.cpp b/src/Magnum/Test/TagsTest.cpp index 3e997b6e8..b02ba6c56 100644 --- a/src/Magnum/Test/TagsTest.cpp +++ b/src/Magnum/Test/TagsTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Magnum.h" #include "Magnum/Tags.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct TagsTest: TestSuite::Tester { explicit TagsTest(); @@ -44,6 +44,6 @@ void TagsTest::noDefaultConstructor() { CORRADE_VERIFY(!std::is_default_constructible::value); } -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::TagsTest) diff --git a/src/Magnum/Text/Test/AbstractFontConverterTest.cpp b/src/Magnum/Text/Test/AbstractFontConverterTest.cpp index bf5e61228..9876320cf 100644 --- a/src/Magnum/Text/Test/AbstractFontConverterTest.cpp +++ b/src/Magnum/Text/Test/AbstractFontConverterTest.cpp @@ -34,7 +34,7 @@ #include "configure.h" -namespace Magnum { namespace Text { namespace Test { +namespace Magnum { namespace Text { namespace Test { namespace { struct AbstractFontConverterTest: TestSuite::Tester { explicit AbstractFontConverterTest(); @@ -67,12 +67,10 @@ AbstractFontConverterTest::AbstractFontConverterTest() { Utility::Directory::mkpath(TEXT_TEST_OUTPUT_DIR); } -namespace { - /* *static_cast(nullptr) makes Clang Analyzer grumpy */ - char nullData; - AbstractFont& nullFont = *reinterpret_cast(nullData); - GlyphCache& nullGlyphCache = *reinterpret_cast(nullData); -} +/* *static_cast(nullptr) makes Clang Analyzer grumpy */ +char nullData; +AbstractFont& nullFont = *reinterpret_cast(nullData); +GlyphCache& nullGlyphCache = *reinterpret_cast(nullData); void AbstractFontConverterTest::convertGlyphs() { class GlyphExporter: public AbstractFontConverter { @@ -196,8 +194,6 @@ void AbstractFontConverterTest::exportGlyphCacheToFile() { "\xfe\xed", TestSuite::Compare::FileToString); } -namespace { - class SingleGlyphCacheDataImporter: public Text::AbstractFontConverter { private: Features doFeatures() const override { return Feature::ConvertData|Feature::ImportGlyphCache; } @@ -209,8 +205,6 @@ class SingleGlyphCacheDataImporter: public Text::AbstractFontConverter { } }; -} - void AbstractFontConverterTest::importGlyphCacheFromSingleData() { /* doImportFromData() should call doImportFromSingleData() */ SingleGlyphCacheDataImporter importer; @@ -232,6 +226,6 @@ void AbstractFontConverterTest::importGlyphCacheFromFile() { cache.release(); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Text::Test::AbstractFontConverterTest) diff --git a/src/Magnum/Text/Test/AbstractFontTest.cpp b/src/Magnum/Text/Test/AbstractFontTest.cpp index 308a93576..abd4e3dac 100644 --- a/src/Magnum/Text/Test/AbstractFontTest.cpp +++ b/src/Magnum/Text/Test/AbstractFontTest.cpp @@ -32,7 +32,7 @@ #include "configure.h" -namespace Magnum { namespace Text { namespace Test { +namespace Magnum { namespace Text { namespace Test { namespace { struct AbstractFontTest: TestSuite::Tester { explicit AbstractFontTest(); @@ -46,8 +46,6 @@ AbstractFontTest::AbstractFontTest() { &AbstractFontTest::openFile}); } -namespace { - class SingleDataFont: public Text::AbstractFont { public: explicit SingleDataFont(): opened(false) {} @@ -72,8 +70,6 @@ class SingleDataFont: public Text::AbstractFont { bool opened; }; -} - void AbstractFontTest::openSingleData() { /* doOpenData() should call doOpenSingleData() */ SingleDataFont font; @@ -91,6 +87,6 @@ void AbstractFontTest::openFile() { CORRADE_VERIFY(font.isOpened()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Text::Test::AbstractFontTest) diff --git a/src/Magnum/Text/Test/AbstractLayouterTest.cpp b/src/Magnum/Text/Test/AbstractLayouterTest.cpp index 4b13feef0..f7c08da70 100644 --- a/src/Magnum/Text/Test/AbstractLayouterTest.cpp +++ b/src/Magnum/Text/Test/AbstractLayouterTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Math/Range.h" #include "Magnum/Text/AbstractFont.h" -namespace Magnum { namespace Text { namespace Test { +namespace Magnum { namespace Text { namespace Test { namespace { struct AbstractLayouterTest: TestSuite::Tester { explicit AbstractLayouterTest(); @@ -80,6 +80,6 @@ void AbstractLayouterTest::renderGlyph() { CORRADE_COMPARE(rectangle, Range2D({2.0f, 0.5f}, {6.1f, 3.0f})); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Text::Test::AbstractLayouterTest) diff --git a/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp b/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp index 05a61cfd7..e6933587e 100644 --- a/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp +++ b/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp @@ -26,7 +26,7 @@ #include "Magnum/GL/OpenGLTester.h" #include "Magnum/Text/DistanceFieldGlyphCache.h" -namespace Magnum { namespace Text { namespace Test { +namespace Magnum { namespace Text { namespace Test { namespace { struct DistanceFieldGlyphCacheGLTest: GL::OpenGLTester { explicit DistanceFieldGlyphCacheGLTest(); @@ -47,6 +47,6 @@ void DistanceFieldGlyphCacheGLTest::initialize() { #endif } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Text::Test::DistanceFieldGlyphCacheGLTest) diff --git a/src/Magnum/Text/Test/GlyphCacheGLTest.cpp b/src/Magnum/Text/Test/GlyphCacheGLTest.cpp index fa3276704..d986b4adb 100644 --- a/src/Magnum/Text/Test/GlyphCacheGLTest.cpp +++ b/src/Magnum/Text/Test/GlyphCacheGLTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/GL/OpenGLTester.h" #include "Magnum/Text/GlyphCache.h" -namespace Magnum { namespace Text { namespace Test { +namespace Magnum { namespace Text { namespace Test { namespace { struct GlyphCacheGLTest: GL::OpenGLTester { explicit GlyphCacheGLTest(); @@ -91,6 +91,6 @@ void GlyphCacheGLTest::reserve() { CORRADE_VERIFY(!cache.reserve({{5, 3}}).empty()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Text::Test::GlyphCacheGLTest) diff --git a/src/Magnum/Text/Test/RendererGLTest.cpp b/src/Magnum/Text/Test/RendererGLTest.cpp index e98007636..dcfb64c26 100644 --- a/src/Magnum/Text/Test/RendererGLTest.cpp +++ b/src/Magnum/Text/Test/RendererGLTest.cpp @@ -32,7 +32,7 @@ #include "Magnum/Text/AbstractFont.h" #include "Magnum/Text/Renderer.h" -namespace Magnum { namespace Text { namespace Test { +namespace Magnum { namespace Text { namespace Test { namespace { struct RendererGLTest: GL::OpenGLTester { explicit RendererGLTest(); @@ -54,8 +54,6 @@ RendererGLTest::RendererGLTest() { &RendererGLTest::multiline}); } -namespace { - class TestLayouter: public Text::AbstractLayouter { public: explicit TestLayouter(Float size, std::size_t glyphCount): AbstractLayouter(glyphCount), _size(size) {} @@ -90,8 +88,6 @@ class TestFont: public Text::AbstractFont { char glyphCacheData; GlyphCache& nullGlyphCache = *reinterpret_cast(&glyphCacheData); -} - void RendererGLTest::renderData() { TestFont font; std::vector positions; @@ -435,6 +431,6 @@ void RendererGLTest::multiline() { }), TestSuite::Compare::Container); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Text::Test::RendererGLTest) diff --git a/src/Magnum/TextureTools/Test/AtlasTest.cpp b/src/Magnum/TextureTools/Test/AtlasTest.cpp index 477602fbb..648452044 100644 --- a/src/Magnum/TextureTools/Test/AtlasTest.cpp +++ b/src/Magnum/TextureTools/Test/AtlasTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Range.h" #include "Magnum/TextureTools/Atlas.h" -namespace Magnum { namespace TextureTools { namespace Test { +namespace Magnum { namespace TextureTools { namespace Test { namespace { struct AtlasTest: TestSuite::Tester { explicit AtlasTest(); @@ -93,6 +93,6 @@ void AtlasTest::createTooSmall() { CORRADE_COMPARE(o.str(), "TextureTools::atlas(): requested atlas size Vector(64, 32) is too small to fit 3 Vector(25, 31) textures. Generated atlas will be empty.\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::TextureTools::Test::AtlasTest) diff --git a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp index 76daab16c..6ce14fe05 100644 --- a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp +++ b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp @@ -48,7 +48,7 @@ #include "configure.h" -namespace Magnum { namespace TextureTools { namespace Test { +namespace Magnum { namespace TextureTools { namespace Test { namespace { struct DistanceFieldGLTest: GL::OpenGLTester { explicit DistanceFieldGLTest(); @@ -279,6 +279,6 @@ void DistanceFieldGLTest::benchmark() { } #endif -}}} +}}}} CORRADE_TEST_MAIN(Magnum::TextureTools::Test::DistanceFieldGLTest) diff --git a/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp b/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp index 76814bef5..57700df11 100644 --- a/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp +++ b/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp @@ -37,7 +37,7 @@ #include "configure.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { class AbstractImageConverterTest: public TestSuite::Tester { public: @@ -308,8 +308,6 @@ void AbstractImageConverterTest::exportCompressedToDataNotImplemented() { CORRADE_COMPARE(out.str(), "Trade::AbstractImageConverter::exportToData(): feature advertised but not implemented\n"); } -namespace { - class ImageDataExporter: public Trade::AbstractImageConverter { private: Features doFeatures() const override { return Feature::ConvertData|Feature::ConvertCompressedData; } @@ -323,8 +321,6 @@ class ImageDataExporter: public Trade::AbstractImageConverter { }; }; -} - void AbstractImageConverterTest::exportImageDataToData() { ImageDataExporter exporter; @@ -541,6 +537,6 @@ void AbstractImageConverterTest::debugFeatures() { CORRADE_COMPARE(out.str(), "Trade::AbstractImageConverter::Feature::ConvertData|Trade::AbstractImageConverter::Feature::ConvertCompressedFile Trade::AbstractImageConverter::Features{}\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::AbstractImageConverterTest) diff --git a/src/Magnum/Trade/Test/AbstractImporterTest.cpp b/src/Magnum/Trade/Test/AbstractImporterTest.cpp index feb098d8f..2356a08fd 100644 --- a/src/Magnum/Trade/Test/AbstractImporterTest.cpp +++ b/src/Magnum/Trade/Test/AbstractImporterTest.cpp @@ -43,7 +43,7 @@ #include "configure.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { class AbstractImporterTest: public TestSuite::Tester { public: @@ -927,9 +927,7 @@ void AbstractImporterTest::defaultSceneNoFile() { CORRADE_COMPARE(out.str(), "Trade::AbstractImporter::defaultScene(): no file opened\n"); } -namespace { - int state; -} +int state; void AbstractImporterTest::scene() { class Importer: public Trade::AbstractImporter { @@ -3279,6 +3277,6 @@ void AbstractImporterTest::debugFileCallbackPolicy() { CORRADE_COMPARE(out.str(), "Trade::ImporterFileCallbackPolicy::Close Trade::ImporterFileCallbackPolicy(0xf0)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::AbstractImporterTest) diff --git a/src/Magnum/Trade/Test/AnimationDataTest.cpp b/src/Magnum/Trade/Test/AnimationDataTest.cpp index 410cb7254..70bd5da8c 100644 --- a/src/Magnum/Trade/Test/AnimationDataTest.cpp +++ b/src/Magnum/Trade/Test/AnimationDataTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Quaternion.h" #include "Magnum/Trade/AnimationData.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct AnimationDataTest: TestSuite::Tester { explicit AnimationDataTest(); @@ -396,6 +396,6 @@ void AnimationDataTest::debugAnimationTrackTargetType() { CORRADE_COMPARE(out.str(), "Trade::AnimationTrackTargetType::Rotation3D Trade::AnimationTrackTargetType::Custom(135) Trade::AnimationTrackTargetType(0x42)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::AnimationDataTest) diff --git a/src/Magnum/Trade/Test/CameraDataTest.cpp b/src/Magnum/Trade/Test/CameraDataTest.cpp index 5294c2664..bed2050d3 100644 --- a/src/Magnum/Trade/Test/CameraDataTest.cpp +++ b/src/Magnum/Trade/Test/CameraDataTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Trade/CameraData.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct CameraDataTest: TestSuite::Tester { explicit CameraDataTest(); @@ -168,6 +168,6 @@ void CameraDataTest::debugType() { CORRADE_COMPARE(out.str(), "Trade::CameraType::Orthographic3D Trade::CameraType(0xde)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::CameraDataTest) diff --git a/src/Magnum/Trade/Test/ImageDataTest.cpp b/src/Magnum/Trade/Test/ImageDataTest.cpp index 81afa771a..ce4803257 100644 --- a/src/Magnum/Trade/Test/ImageDataTest.cpp +++ b/src/Magnum/Trade/Test/ImageDataTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/PixelFormat.h" #include "Magnum/Trade/ImageData.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct ImageDataTest: TestSuite::Tester { explicit ImageDataTest(); @@ -95,8 +95,6 @@ ImageDataTest::ImageDataTest() { &ImageDataTest::releaseCompressed}); } -namespace { - namespace GL { enum class PixelFormat { RGB = 666 }; enum class PixelType { UnsignedShort = 1337 }; @@ -125,8 +123,6 @@ namespace Vk { enum class CompressedPixelFormat { Bc1SRGBAlpha = 42 }; } -} - void ImageDataTest::constructGeneric() { { auto data = new char[4*4]; @@ -582,6 +578,6 @@ void ImageDataTest::releaseCompressed() { CORRADE_COMPARE(a.size(), Vector2i()); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::ImageDataTest) diff --git a/src/Magnum/Trade/Test/LightDataTest.cpp b/src/Magnum/Trade/Test/LightDataTest.cpp index f69ba34e8..d9f24ad3c 100644 --- a/src/Magnum/Trade/Test/LightDataTest.cpp +++ b/src/Magnum/Trade/Test/LightDataTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Trade/LightData.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct LightDataTest: TestSuite::Tester { explicit LightDataTest(); @@ -96,6 +96,6 @@ void LightDataTest::debugType() { CORRADE_COMPARE(out.str(), "Trade::LightData::Type::Spot Trade::LightData::Type(0xbe)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::LightDataTest) diff --git a/src/Magnum/Trade/Test/MaterialDataTest.cpp b/src/Magnum/Trade/Test/MaterialDataTest.cpp index 74aeb64ae..3b4e948a1 100644 --- a/src/Magnum/Trade/Test/MaterialDataTest.cpp +++ b/src/Magnum/Trade/Test/MaterialDataTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Trade/PhongMaterialData.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { class MaterialDataTest: public TestSuite::Tester { public: @@ -345,6 +345,6 @@ void MaterialDataTest::debugPhongFlags() { CORRADE_COMPARE(out.str(), "Trade::PhongMaterialData::Flag::DiffuseTexture|Trade::PhongMaterialData::Flag::SpecularTexture Trade::PhongMaterialData::Flags{}\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::MaterialDataTest) diff --git a/src/Magnum/Trade/Test/MeshData2DTest.cpp b/src/Magnum/Trade/Test/MeshData2DTest.cpp index bf381f141..315e8db64 100644 --- a/src/Magnum/Trade/Test/MeshData2DTest.cpp +++ b/src/Magnum/Trade/Test/MeshData2DTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Color.h" #include "Magnum/Trade/MeshData2D.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct MeshData2DTest: TestSuite::Tester { explicit MeshData2DTest(); @@ -168,6 +168,6 @@ void MeshData2DTest::constructMove() { CORRADE_COMPARE(d.importerState(), &a); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::MeshData2DTest) diff --git a/src/Magnum/Trade/Test/MeshData3DTest.cpp b/src/Magnum/Trade/Test/MeshData3DTest.cpp index 6afb21e7c..937e3ccd1 100644 --- a/src/Magnum/Trade/Test/MeshData3DTest.cpp +++ b/src/Magnum/Trade/Test/MeshData3DTest.cpp @@ -29,7 +29,7 @@ #include "Magnum/Math/Color.h" #include "Magnum/Trade/MeshData3D.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct MeshData3DTest: TestSuite::Tester { explicit MeshData3DTest(); @@ -195,6 +195,6 @@ void MeshData3DTest::constructMove() { CORRADE_COMPARE(d.importerState(), &a); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::MeshData3DTest) diff --git a/src/Magnum/Trade/Test/ObjectData2DTest.cpp b/src/Magnum/Trade/Test/ObjectData2DTest.cpp index d69b86dfe..5b582cb41 100644 --- a/src/Magnum/Trade/Test/ObjectData2DTest.cpp +++ b/src/Magnum/Trade/Test/ObjectData2DTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Trade/MeshObjectData2D.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { class ObjectData2DTest: public TestSuite::Tester { public: @@ -249,6 +249,6 @@ void ObjectData2DTest::debugFlags() { CORRADE_COMPARE(o.str(), "Trade::ObjectFlag2D::HasTranslationRotationScaling Trade::ObjectFlags2D{}\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::ObjectData2DTest) diff --git a/src/Magnum/Trade/Test/ObjectData3DTest.cpp b/src/Magnum/Trade/Test/ObjectData3DTest.cpp index 82a973201..8d03b58f3 100644 --- a/src/Magnum/Trade/Test/ObjectData3DTest.cpp +++ b/src/Magnum/Trade/Test/ObjectData3DTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Trade/MeshObjectData3D.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { class ObjectData3DTest: public TestSuite::Tester { public: @@ -263,6 +263,6 @@ void ObjectData3DTest::debugFlags() { CORRADE_COMPARE(o.str(), "Trade::ObjectFlag3D::HasTranslationRotationScaling Trade::ObjectFlags3D{}\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::ObjectData3DTest) diff --git a/src/Magnum/Trade/Test/SceneDataTest.cpp b/src/Magnum/Trade/Test/SceneDataTest.cpp index 767b2c694..cd930e171 100644 --- a/src/Magnum/Trade/Test/SceneDataTest.cpp +++ b/src/Magnum/Trade/Test/SceneDataTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Magnum.h" #include "Magnum/Trade/SceneData.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct SceneDataTest: TestSuite::Tester { explicit SceneDataTest(); @@ -77,6 +77,6 @@ void SceneDataTest::constructMove() { CORRADE_COMPARE(d.importerState(), &a); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::SceneDataTest) diff --git a/src/Magnum/Trade/Test/TextureDataTest.cpp b/src/Magnum/Trade/Test/TextureDataTest.cpp index 78f325d23..5ac11643c 100644 --- a/src/Magnum/Trade/Test/TextureDataTest.cpp +++ b/src/Magnum/Trade/Test/TextureDataTest.cpp @@ -28,7 +28,7 @@ #include "Magnum/Trade/TextureData.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { class TextureDataTest: public TestSuite::Tester { public: @@ -119,6 +119,6 @@ void TextureDataTest::debugType() { CORRADE_COMPARE(out.str(), "Trade::TextureData::Type::Texture3D Trade::TextureData::Type(0xbe)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::TextureDataTest) diff --git a/src/Magnum/Vk/Test/EnumsTest.cpp b/src/Magnum/Vk/Test/EnumsTest.cpp index f71fa1c97..e94a14301 100644 --- a/src/Magnum/Vk/Test/EnumsTest.cpp +++ b/src/Magnum/Vk/Test/EnumsTest.cpp @@ -38,7 +38,7 @@ #include "Magnum/Sampler.h" #include "Magnum/Vk/Enums.h" -namespace Magnum { namespace Vk { namespace Test { +namespace Magnum { namespace Vk { namespace Test { namespace { /* Tests MeshView as well */ @@ -401,6 +401,6 @@ void EnumsTest::mapVkSamplerAddressModeInvalid() { "Vk::vkSamplerAddressMode(): invalid wrapping SamplerWrapping(0x123)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Vk::Test::EnumsTest) diff --git a/src/MagnumExternal/Optional/Test/StdOptionalTest.cpp b/src/MagnumExternal/Optional/Test/StdOptionalTest.cpp index 5a566efc0..cab64877f 100644 --- a/src/MagnumExternal/Optional/Test/StdOptionalTest.cpp +++ b/src/MagnumExternal/Optional/Test/StdOptionalTest.cpp @@ -37,7 +37,7 @@ #include "Magnum/Magnum.h" #include "MagnumExternal/Optional/OptionalWrapper.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace Test { namespace { struct StdOptionalTest: TestSuite::Tester { explicit StdOptionalTest(); @@ -102,7 +102,7 @@ void StdOptionalTest::conversion() { #pragma GCC diagnostic pop #endif -}} +}}} CORRADE_TEST_MAIN(Magnum::Test::StdOptionalTest) diff --git a/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp b/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp index d8328c269..efac74393 100644 --- a/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp +++ b/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp @@ -31,7 +31,7 @@ #include "configure.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct AnyImporterTest: TestSuite::Tester { explicit AnyImporterTest(); @@ -82,6 +82,6 @@ void AnyImporterTest::unknown() { CORRADE_COMPARE(output.str(), "Audio::AnyImporter::openFile(): cannot determine type of file sound.mid\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::AnyImporterTest) diff --git a/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp b/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp index b6e4b109b..7991d9808 100644 --- a/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp +++ b/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp @@ -34,7 +34,7 @@ #include "configure.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct AnyImageConverterTest: TestSuite::Tester { explicit AnyImageConverterTest(); @@ -66,15 +66,13 @@ AnyImageConverterTest::AnyImageConverterTest() { CORRADE_INTERNAL_ASSERT(Utility::Directory::mkpath(ANYIMAGECONVERTER_TEST_DIR)); } -namespace { - constexpr const char Data[] = { - 1, 2, 3, 2, 3, 4, 0, 0, - 3, 4, 5, 4, 5, 6, 0, 0, - 5, 6, 7, 6, 7, 8, 0, 0 - }; +constexpr const char Data[] = { + 1, 2, 3, 2, 3, 4, 0, 0, + 3, 4, 5, 4, 5, 6, 0, 0, + 5, 6, 7, 6, 7, 8, 0, 0 +}; - const ImageView2D Image{PixelFormat::RGB8Unorm, {2, 3}, Data}; -} +const ImageView2D Image{PixelFormat::RGB8Unorm, {2, 3}, Data}; void AnyImageConverterTest::tga() { if(!(_manager.loadState("TgaImageConverter") & PluginManager::LoadState::Loaded)) @@ -101,6 +99,6 @@ void AnyImageConverterTest::unknown() { CORRADE_COMPARE(output.str(), "Trade::AnyImageConverter::exportToFile(): cannot determine type of file image.xcf\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::AnyImageConverterTest) diff --git a/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp b/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp index 9e780359e..40e615c5b 100644 --- a/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp +++ b/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp @@ -34,7 +34,7 @@ #include "configure.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct AnyImageImporterTest: TestSuite::Tester { explicit AnyImageImporterTest(); @@ -51,8 +51,6 @@ struct AnyImageImporterTest: TestSuite::Tester { PluginManager::Manager _manager{"nonexistent"}; }; -namespace { - Containers::Optional> fileCallback(const std::string& filename, Trade::ImporterFileCallbackPolicy, Containers::Array& storage) { storage = Utility::Directory::read(filename); return Containers::ArrayView{storage}; @@ -91,8 +89,6 @@ constexpr struct { /* Not testing everything, just the most important ones */ }; -} - AnyImageImporterTest::AnyImageImporterTest() { addInstancedTests({&AnyImageImporterTest::load}, Containers::arraySize(LoadData)); @@ -192,6 +188,6 @@ void AnyImageImporterTest::emptyData() { CORRADE_COMPARE(output.str(), "Trade::AnyImageImporter::openData(): file is empty\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::AnyImageImporterTest) diff --git a/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp b/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp index 871c5a2d3..05b8e2d4e 100644 --- a/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp +++ b/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp @@ -33,7 +33,7 @@ #include "configure.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct AnySceneImporterTest: TestSuite::Tester { explicit AnySceneImporterTest(); @@ -85,6 +85,6 @@ void AnySceneImporterTest::unknown() { CORRADE_COMPARE(output.str(), "Trade::AnySceneImporter::openFile(): cannot determine type of file mesh.wtf\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::AnySceneImporterTest) diff --git a/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp b/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp index 08af925f5..f49e2e66d 100644 --- a/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp +++ b/src/MagnumPlugins/MagnumFont/Test/MagnumFontGLTest.cpp @@ -33,7 +33,7 @@ #include "configure.h" -namespace Magnum { namespace Text { namespace Test { +namespace Magnum { namespace Text { namespace Test { namespace { struct MagnumFontGLTest: GL::OpenGLTester { explicit MagnumFontGLTest(); @@ -141,6 +141,6 @@ void MagnumFontGLTest::createGlyphCache() { /** @todo properly test contents */ } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Text::Test::MagnumFontGLTest) diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp index 7d54d9b56..d7373632f 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp @@ -40,7 +40,7 @@ #include "configure.h" -namespace Magnum { namespace Text { namespace Test { +namespace Magnum { namespace Text { namespace Test { namespace { struct MagnumFontConverterGLTest: GL::OpenGLTester { explicit MagnumFontConverterGLTest(); @@ -139,6 +139,6 @@ void MagnumFontConverterGLTest::exportFont() { CORRADE_COMPARE(image->format(), PixelFormat::R8Unorm); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Text::Test::MagnumFontConverterGLTest) diff --git a/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp b/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp index 70cddd3e4..c30c63220 100644 --- a/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp +++ b/src/MagnumPlugins/ObjImporter/Test/ObjImporterTest.cpp @@ -34,7 +34,7 @@ #include "configure.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct ObjImporterTest: TestSuite::Tester { explicit ObjImporterTest(); @@ -738,6 +738,6 @@ void ObjImporterTest::unknownKeyword() { CORRADE_COMPARE(out.str(), "Trade::ObjImporter::mesh3D(): unknown keyword bleh\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::ObjImporterTest) diff --git a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp index e10162590..ae72bc35a 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp +++ b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp @@ -38,7 +38,7 @@ #include "configure.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct TgaImageConverterTest: TestSuite::Tester { explicit TgaImageConverterTest(); @@ -53,32 +53,30 @@ struct TgaImageConverterTest: TestSuite::Tester { PluginManager::Manager _importerManager{"nonexistent"}; }; -namespace { - /* Padded to four byte alignment (the resulting file is *not* padded) */ - constexpr char OriginalDataRGB[] = { - /* Skip */ - 0, 0, 0, 0, 0, 0, 0, 0, - - 1, 2, 3, 2, 3, 4, 0, 0, - 3, 4, 5, 4, 5, 6, 0, 0, - 5, 6, 7, 6, 7, 8, 0, 0 - }; - constexpr char ConvertedDataRGB[] = { - 1, 2, 3, 2, 3, 4, - 3, 4, 5, 4, 5, 6, - 5, 6, 7, 6, 7, 8 - }; - - const ImageView2D OriginalRGB{PixelStorage{}.setSkip({0, 1, 0}), - PixelFormat::RGB8Unorm, {2, 3}, OriginalDataRGB}; - - constexpr char OriginalDataRGBA[] = { - 1, 2, 3, 4, 2, 3, 4, 5, - 3, 4, 5, 6, 4, 5, 6, 7, - 5, 6, 7, 8, 6, 7, 8, 9 - }; - const ImageView2D OriginalRGBA{PixelFormat::RGBA8Unorm, {2, 3}, OriginalDataRGBA}; -} +/* Padded to four byte alignment (the resulting file is *not* padded) */ +constexpr char OriginalDataRGB[] = { + /* Skip */ + 0, 0, 0, 0, 0, 0, 0, 0, + + 1, 2, 3, 2, 3, 4, 0, 0, + 3, 4, 5, 4, 5, 6, 0, 0, + 5, 6, 7, 6, 7, 8, 0, 0 +}; +constexpr char ConvertedDataRGB[] = { + 1, 2, 3, 2, 3, 4, + 3, 4, 5, 4, 5, 6, + 5, 6, 7, 6, 7, 8 +}; + +const ImageView2D OriginalRGB{PixelStorage{}.setSkip({0, 1, 0}), + PixelFormat::RGB8Unorm, {2, 3}, OriginalDataRGB}; + +constexpr char OriginalDataRGBA[] = { + 1, 2, 3, 4, 2, 3, 4, 5, + 3, 4, 5, 6, 4, 5, 6, 7, + 5, 6, 7, 8, 6, 7, 8, 9 +}; +const ImageView2D OriginalRGBA{PixelFormat::RGBA8Unorm, {2, 3}, OriginalDataRGBA}; TgaImageConverterTest::TgaImageConverterTest() { addTests({&TgaImageConverterTest::wrongFormat, @@ -149,6 +147,6 @@ void TgaImageConverterTest::rgba() { TestSuite::Compare::Container); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::TgaImageConverterTest) diff --git a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp index 9cacbcdab..558ec32c6 100644 --- a/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp +++ b/src/MagnumPlugins/TgaImporter/Test/TgaImporterTest.cpp @@ -35,7 +35,7 @@ #include "configure.h" -namespace Magnum { namespace Trade { namespace Test { +namespace Magnum { namespace Trade { namespace Test { namespace { struct TgaImporterTest: TestSuite::Tester { explicit TgaImporterTest(); @@ -216,6 +216,6 @@ void TgaImporterTest::useTwice() { } } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Trade::Test::TgaImporterTest) diff --git a/src/MagnumPlugins/WavAudioImporter/Test/WavHeaderTest.cpp b/src/MagnumPlugins/WavAudioImporter/Test/WavHeaderTest.cpp index 9a592504d..c7e6155b4 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/WavHeaderTest.cpp +++ b/src/MagnumPlugins/WavAudioImporter/Test/WavHeaderTest.cpp @@ -30,7 +30,7 @@ #include "Magnum/Magnum.h" #include "MagnumPlugins/WavAudioImporter/WavHeader.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct WavHeaderTest: TestSuite::Tester { explicit WavHeaderTest(); @@ -49,7 +49,7 @@ void WavHeaderTest::debugAudioFormat() { CORRADE_COMPARE(out.str(), "Audio::WavAudioFormat::IeeeFloat Audio::WavAudioFormat(0xdead)\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::WavHeaderTest) diff --git a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp index 5ad8f10ec..beedb9bcf 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp +++ b/src/MagnumPlugins/WavAudioImporter/Test/WavImporterTest.cpp @@ -34,7 +34,7 @@ #include "configure.h" -namespace Magnum { namespace Audio { namespace Test { +namespace Magnum { namespace Audio { namespace Test { namespace { struct WavImporterTest: TestSuite::Tester { explicit WavImporterTest(); @@ -421,6 +421,6 @@ void WavImporterTest::surround71Channel24() { CORRADE_COMPARE(out.str(), "Audio::WavImporter::openData(): unsupported format Audio::WavAudioFormat::Extensible\n"); } -}}} +}}}} CORRADE_TEST_MAIN(Magnum::Audio::Test::WavImporterTest)