Browse Source

Wrap all tests in unnamed namespaces.

This makes the compiler warn about test cases that aren't ever used,
which is a good thing.
simd
Vladimír Vondruš 7 years ago
parent
commit
2149f7b869
  1. 2
      package/ci/leaksanitizer.conf
  2. 4
      src/Magnum/Animation/Test/Benchmark.cpp
  3. 16
      src/Magnum/Animation/Test/EasingTest.cpp
  4. 28
      src/Magnum/Animation/Test/InterpolationTest.cpp
  5. 18
      src/Magnum/Animation/Test/PlayerCustomTest.cpp
  6. 80
      src/Magnum/Animation/Test/PlayerTest.cpp
  7. 18
      src/Magnum/Animation/Test/TrackTest.cpp
  8. 35
      src/Magnum/Animation/Test/TrackViewTest.cpp
  9. 4
      src/Magnum/Audio/Test/AbstractImporterTest.cpp
  10. 4
      src/Magnum/Audio/Test/BufferALTest.cpp
  11. 4
      src/Magnum/Audio/Test/BufferFormatTest.cpp
  12. 4
      src/Magnum/Audio/Test/ContextALTest.cpp
  13. 4
      src/Magnum/Audio/Test/ContextTest.cpp
  14. 4
      src/Magnum/Audio/Test/ListenerALTest.cpp
  15. 4
      src/Magnum/Audio/Test/PlayableALTest.cpp
  16. 4
      src/Magnum/Audio/Test/RendererALTest.cpp
  17. 4
      src/Magnum/Audio/Test/RendererTest.cpp
  18. 4
      src/Magnum/Audio/Test/SourceALTest.cpp
  19. 4
      src/Magnum/Audio/Test/SourceTest.cpp
  20. 8
      src/Magnum/DebugTools/Test/BufferDataGLTest.cpp
  21. 4
      src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp
  22. 87
      src/Magnum/DebugTools/Test/CompareImageTest.cpp
  23. 4
      src/Magnum/DebugTools/Test/CylinderRendererTest.cpp
  24. 4
      src/Magnum/DebugTools/Test/ForceRendererTest.cpp
  25. 4
      src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp
  26. 34
      src/Magnum/DebugTools/Test/TextureImageGLTest.cpp
  27. 4
      src/Magnum/GL/Test/AbstractObjectGLTest.cpp
  28. 4
      src/Magnum/GL/Test/AbstractQueryGLTest.cpp
  29. 93
      src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp
  30. 4
      src/Magnum/GL/Test/AbstractShaderProgramTest.cpp
  31. 4
      src/Magnum/GL/Test/AbstractTextureGLTest.cpp
  32. 4
      src/Magnum/GL/Test/AttributeTest.cpp
  33. 4
      src/Magnum/GL/Test/BufferGLTest.cpp
  34. 4
      src/Magnum/GL/Test/BufferImageGLTest.cpp
  35. 4
      src/Magnum/GL/Test/BufferImageTest.cpp
  36. 4
      src/Magnum/GL/Test/BufferTest.cpp
  37. 4
      src/Magnum/GL/Test/BufferTextureGLTest.cpp
  38. 4
      src/Magnum/GL/Test/BufferTextureTest.cpp
  39. 4
      src/Magnum/GL/Test/ContextGLTest.cpp
  40. 4
      src/Magnum/GL/Test/ContextTest.cpp
  41. 570
      src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp
  42. 4
      src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp
  43. 409
      src/Magnum/GL/Test/CubeMapTextureGLTest.cpp
  44. 4
      src/Magnum/GL/Test/CubeMapTextureTest.cpp
  45. 4
      src/Magnum/GL/Test/DebugOutputGLTest.cpp
  46. 4
      src/Magnum/GL/Test/DebugOutputTest.cpp
  47. 4
      src/Magnum/GL/Test/DefaultFramebufferTest.cpp
  48. 26
      src/Magnum/GL/Test/FramebufferGLTest.cpp
  49. 4
      src/Magnum/GL/Test/FramebufferTest.cpp
  50. 156
      src/Magnum/GL/Test/MeshGLTest.cpp
  51. 12
      src/Magnum/GL/Test/MeshTest.cpp
  52. 4
      src/Magnum/GL/Test/MultisampleTextureGLTest.cpp
  53. 4
      src/Magnum/GL/Test/MultisampleTextureTest.cpp
  54. 4
      src/Magnum/GL/Test/PixelFormatTest.cpp
  55. 222
      src/Magnum/GL/Test/PixelStorageGLTest.cpp
  56. 4
      src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp
  57. 4
      src/Magnum/GL/Test/PrimitiveQueryTest.cpp
  58. 86
      src/Magnum/GL/Test/RectangleTextureGLTest.cpp
  59. 4
      src/Magnum/GL/Test/RectangleTextureTest.cpp
  60. 4
      src/Magnum/GL/Test/RenderbufferGLTest.cpp
  61. 4
      src/Magnum/GL/Test/RenderbufferTest.cpp
  62. 4
      src/Magnum/GL/Test/RendererGLTest.cpp
  63. 4
      src/Magnum/GL/Test/RendererTest.cpp
  64. 14
      src/Magnum/GL/Test/SampleQueryGLTest.cpp
  65. 4
      src/Magnum/GL/Test/SampleQueryTest.cpp
  66. 4
      src/Magnum/GL/Test/SamplerTest.cpp
  67. 4
      src/Magnum/GL/Test/ShaderGLTest.cpp
  68. 4
      src/Magnum/GL/Test/ShaderTest.cpp
  69. 339
      src/Magnum/GL/Test/TextureArrayGLTest.cpp
  70. 4
      src/Magnum/GL/Test/TextureArrayTest.cpp
  71. 568
      src/Magnum/GL/Test/TextureGLTest.cpp
  72. 4
      src/Magnum/GL/Test/TextureTest.cpp
  73. 4
      src/Magnum/GL/Test/TimeQueryGLTest.cpp
  74. 4
      src/Magnum/GL/Test/TimeQueryTest.cpp
  75. 16
      src/Magnum/GL/Test/TransformFeedbackGLTest.cpp
  76. 4
      src/Magnum/GL/Test/TransformFeedbackTest.cpp
  77. 4
      src/Magnum/GL/Test/VersionTest.cpp
  78. 4
      src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp
  79. 4
      src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp
  80. 8
      src/Magnum/Math/Algorithms/Test/KahanSumTest.cpp
  81. 4
      src/Magnum/Math/Algorithms/Test/QrTest.cpp
  82. 4
      src/Magnum/Math/Algorithms/Test/SvdTest.cpp
  83. 8
      src/Magnum/Math/Test/AngleTest.cpp
  84. 4
      src/Magnum/Math/Test/BezierTest.cpp
  85. 4
      src/Magnum/Math/Test/BoolVectorTest.cpp
  86. 8
      src/Magnum/Math/Test/ColorTest.cpp
  87. 4
      src/Magnum/Math/Test/ComplexTest.cpp
  88. 4
      src/Magnum/Math/Test/ConstantsTest.cpp
  89. 4
      src/Magnum/Math/Test/CubicHermiteTest.cpp
  90. 4
      src/Magnum/Math/Test/DistanceTest.cpp
  91. 20
      src/Magnum/Math/Test/DualComplexTest.cpp
  92. 20
      src/Magnum/Math/Test/DualQuaternionTest.cpp
  93. 8
      src/Magnum/Math/Test/DualTest.cpp
  94. 4
      src/Magnum/Math/Test/FrustumTest.cpp
  95. 4
      src/Magnum/Math/Test/FunctionsTest.cpp
  96. 12
      src/Magnum/Math/Test/HalfTest.cpp
  97. 4
      src/Magnum/Math/Test/InterpolationBenchmark.cpp
  98. 4
      src/Magnum/Math/Test/IntersectionBenchmark.cpp
  99. 4
      src/Magnum/Math/Test/IntersectionTest.cpp
  100. 4
      src/Magnum/Math/Test/Matrix3Test.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

2
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

4
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)

16
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)

28
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)

18
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<UnsignedShort, Float> 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<UnsignedShort, Float> 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<UnsignedLong, UnsignedShort> player{
@ -75,6 +73,6 @@ void PlayerCustomTest::test() {
CORRADE_COMPARE(value, 4.0f);
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Animation::Test::PlayerCustomTest)

80
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<Float, Float> Track{{
{1.0f, 1.5f},
{2.5f, 3.0f},
{3.0f, 5.0f},
{4.0f, 2.0f}
}, Math::lerp};
}
const Animation::Track<Float, Float> Track{{
{1.0f, 1.5f},
{2.5f, 3.0f},
{3.0f, 5.0f},
{4.0f, 2.0f}
}, Math::lerp};
void PlayerTest::construct() {
Animation::Track<Float, Int> 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<Int>& data, Int value) {
data.push_back(value);
}
/* Can't use raw lambdas because MSVC 2015 */
void callback(std::vector<Int>& 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)

18
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<Float, Vector3> 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)

35
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<Float, Vector3>{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<Float, Vector3>{5.0f, {0.3f, 0.6f, 1.0f}}));
}
namespace {
const std::pair<Float, Float> Keyframes[]{
{0.0f, 3.0f},
{2.0f, 1.0f},
{4.0f, 2.5f},
{5.0f, 0.5f}};
}
const std::pair<Float, Float> 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)

4
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)

4
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)

4
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)

4
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<Extensions::ALC::EXT::ENUMERATION>());
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Audio::Test::ContextALTest)

4
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)

4
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<SceneGraph::MatrixTransformation2D> Scene2D;
typedef SceneGraph::Object<SceneGraph::MatrixTransformation2D> Object2D;
@ -106,6 +106,6 @@ void ListenerALTest::updateGroups() {
CORRADE_COMPARE(playable.source().position(), offset*13.0f);
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Audio::Test::ListenerALTest)

4
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<SceneGraph::MatrixTransformation3D> Scene3D;
typedef SceneGraph::Object<SceneGraph::MatrixTransformation3D> Object3D;
@ -100,6 +100,6 @@ void PlayableALTest::group() {
group.stop();
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Audio::Test::PlayableALTest)

4
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)

4
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)

4
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)

4
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)

8
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)

4
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)

87
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<Float> DeltaRed{
0.35f, 0.0f, 0.3f,
0.01f, 0.0f, 0.1f,
0.12f, 1.0f, 0.0f};
const std::vector<Float> 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<Float> 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)

4
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)

4
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)

4
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)

34
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)

4
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)

4
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)

93
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)

4
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<DummyShader, const DummyShader&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractShaderProgramTest)

4
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)

4
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)

4
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)

4
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)

4
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<CompressedBufferImage2D, const CompressedBufferImage2D&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::BufferImageTest)

4
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)

4
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)

4
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<BufferTexture, const BufferTexture&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::BufferTextureTest)

4
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)

4
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)

570
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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
enum: std::size_t { PixelStorageDataCount = 2 };
const struct {
const char* name;
Containers::ArrayView<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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)

4
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<CubeMapTextureArray, const CubeMapTextureArray&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::CubeMapTextureArrayTest)

409
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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> 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<const UnsignedByte> 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<const UnsignedByte> 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<const UnsignedByte> 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<std::size_t size, class T> Containers::ArrayView<const T> unsafeSuffix(const T(&data)[size], std::size_t offset) {
static_assert(sizeof(T) == 1, "");
return {data - offset, size + offset};
}
template<std::size_t size, class T> Containers::ArrayView<const T> 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)

4
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<CubeMapTexture, const CubeMapTexture&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::CubeMapTextureTest)

4
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)

4
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)

4
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)

26
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)

4
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)

156
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<Float, UnsignedByte>(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<class T> T get(PixelFormat format, PixelType type);
template<class T> 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<Float, UnsignedByte>(64),
/* First vertex */
Math::unpack<Float, UnsignedByte>(64),
Math::unpack<Float, UnsignedByte>(17),
Math::unpack<Float, UnsignedByte>(56),
Math::unpack<Float, UnsignedByte>(15),
Math::unpack<Float, UnsignedByte>(164),
Math::unpack<Float, UnsignedByte>(17),
Math::unpack<Float, UnsignedByte>(56),
Math::unpack<Float, UnsignedByte>(15),
Math::unpack<Float, UnsignedByte>(164),
Math::unpack<Float, UnsignedByte>(17),
Math::unpack<Float, UnsignedByte>(97),
Math::unpack<Float, UnsignedByte>(28),
Math::unpack<Float, UnsignedByte>(97),
Math::unpack<Float, UnsignedByte>(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<Float, UnsignedByte>(64),
0.0f, 0.0f,
/* Third vertex */
Math::unpack<Float, UnsignedByte>(64),
Math::unpack<Float, UnsignedByte>(17),
Math::unpack<Float, UnsignedByte>(56),
Math::unpack<Float, UnsignedByte>(15),
Math::unpack<Float, UnsignedByte>(164),
Math::unpack<Float, UnsignedByte>(17),
Math::unpack<Float, UnsignedByte>(56),
Math::unpack<Float, UnsignedByte>(15),
Math::unpack<Float, UnsignedByte>(164),
Math::unpack<Float, UnsignedByte>(17),
Math::unpack<Float, UnsignedByte>(97),
Math::unpack<Float, UnsignedByte>(28),
Math::unpack<Float, UnsignedByte>(97),
Math::unpack<Float, UnsignedByte>(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<class T> void MeshGLTest::setIndexBuffer() {
setTestCaseName(std::is_same<T, MeshIndexType>::value ?
@ -2648,16 +2640,14 @@ void MeshGLTest::resetDivisorAfterInstancedDraw() {
}
}
namespace {
struct MultiChecker {
MultiChecker(AbstractShaderProgram&& shader, Mesh& mesh);
struct MultiChecker {
MultiChecker(AbstractShaderProgram&& shader, Mesh& mesh);
template<class T> T get(PixelFormat format, PixelType type);
template<class T> 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)

12
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)

4
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)

4
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<MultisampleTexture2DArray, const MultisampleTexture2DArray&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::MultisampleTextureTest)

4
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)

222
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<Extensions::ARB::compressed_texture_pixel_storage>())
@ -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<Extensions::ARB::compressed_texture_pixel_storage>())
@ -450,6 +442,6 @@ void PixelStorageGLTest::packCompressed3D() {
}
#endif
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::PixelStorageGLTest)

4
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)

4
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<PrimitiveQuery, const PrimitiveQuery&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::PrimitiveQueryTest)

86
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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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)

4
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<RectangleTexture, const RectangleTexture&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::RectangleTextureTest)

4
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)

4
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)

4
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)

4
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)

14
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)

4
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<SampleQuery, const SampleQuery&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::SampleQueryTest)

4
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)

4
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)

4
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)

339
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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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)

4
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<Texture2DArray, const Texture2DArray&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::TextureArrayTest)

568
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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
PixelStorage storage;
Containers::ArrayView<const UnsignedByte> 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<const UnsignedByte> data;
#ifndef MAGNUM_TARGET_GLES
CompressedPixelStorage storage;
#endif
Containers::ArrayView<const UnsignedByte> 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)

4
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)

4
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)

4
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<TimeQuery, const TimeQuery&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::TimeQueryTest)

16
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<Extensions::ARB::transform_feedback2>())
@ -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<Extensions::ARB::transform_feedback2>())
@ -720,6 +708,6 @@ void TransformFeedbackGLTest::draw() {
}
#endif
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::TransformFeedbackGLTest)

4
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<TransformFeedback, const TransformFeedback&>{}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::GL::Test::TransformFeedbackTest)

4
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)

4
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)

4
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)

8
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<class T> struct Iterator
@ -84,8 +82,6 @@ template<class T> struct Iterator
std::size_t _i{};
};
}
void KahanSumTest::floats() {
Iterator<Float> begin{1.0f};
Iterator<Float> 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)

4
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)

4
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)

8
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<Double> 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<Radd> {
static const char* name() { return "Radd"; }
static const char* literal() { return "rad"; }
};
}
#endif
AngleTest::AngleTest() {
@ -340,6 +336,6 @@ template<class T> void AngleTest::tweakableError() {
}
#endif
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::AngleTest)

4
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<Float> Vector2;
typedef Math::Vector2<Double> Vector2d;
@ -349,6 +349,6 @@ void BezierTest::configuration() {
CORRADE_COMPARE(c.value<CubicBezier2D>("bezier"), bezier);
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::BezierTest)

4
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)

8
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<Float> 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)

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

@ -51,7 +51,7 @@ template<> struct ComplexConverter<Float, Cmpl> {
}
namespace Test {
namespace Test { namespace {
struct ComplexTest: Corrade::TestSuite::Tester {
explicit ComplexTest();
@ -575,6 +575,6 @@ void ComplexTest::configuration() {
CORRADE_COMPARE(c.value<Complex>("overflow"), (Complex{2.0f, 9.0f}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::ComplexTest)

4
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<class T> void ConstantsTest::specials() {
CORRADE_VERIFY(h != h);
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::ConstantsTest)

4
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)

4
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)

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

@ -51,7 +51,7 @@ template<> struct DualComplexConverter<Float, DualCmpl> {
}
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<class> struct NormalizedIterativeData;
template<> struct NormalizedIterativeData<Float> {
static Math::Vector2<Float> translation() { return {10000.0f, -50.0f}; }
};
template<> struct NormalizedIterativeData<Double> {
static Math::Vector2<Double> translation() { return {10000000.0, -500.0}; }
};
}
template<class> struct NormalizedIterativeData;
template<> struct NormalizedIterativeData<Float> {
static Math::Vector2<Float> translation() { return {10000.0f, -50.0f}; }
};
template<> struct NormalizedIterativeData<Double> {
static Math::Vector2<Double> translation() { return {10000000.0, -500.0}; }
};
template<class T> void DualComplexTest::normalizedIterative() {
setTestCaseName(std::string{"normalizedIterative<"} + TypeTraits<T>::name() + ">");
@ -491,6 +489,6 @@ void DualComplexTest::configuration() {
CORRADE_COMPARE(c.value<DualComplex>("overflow"), (DualComplex{{2.0f, 1.0f}, {8.0f, 9.0f}}));
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::DualComplexTest)

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

@ -53,7 +53,7 @@ template<> struct DualQuaternionConverter<Float, DualQuat> {
}
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<class> struct NormalizedIterativeData;
template<> struct NormalizedIterativeData<Float> {
static Math::Vector3<Float> translation() { return {10000.0f, -50.0f, 20000.0f}; }
};
template<> struct NormalizedIterativeData<Double> {
static Math::Vector3<Double> translation() { return {10000000000000.0, -500.0, 20000000000000.0}; }
};
}
template<class> struct NormalizedIterativeData;
template<> struct NormalizedIterativeData<Float> {
static Math::Vector3<Float> translation() { return {10000.0f, -50.0f, 20000.0f}; }
};
template<> struct NormalizedIterativeData<Double> {
static Math::Vector3<Double> translation() { return {10000000000000.0, -500.0, 20000000000000.0}; }
};
template<class T> void DualQuaternionTest::normalizedIterative() {
setTestCaseName(std::string{"normalizedIterative<"} + TypeTraits<T>::name() + ">");
@ -666,6 +664,6 @@ void DualQuaternionTest::configuration() {
CORRADE_COMPARE(c.value<DualQuaternion>("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)

8
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 T> class BasicDualVec2: public Math::Dual<Math::Vector2<T>> {
public:
template<class ...U> constexpr BasicDualVec2(U&&... args): Math::Dual<Math::Vector2<T>>{args...} {}
@ -312,8 +310,6 @@ MAGNUM_DUAL_OPERATOR_IMPLEMENTATION(BasicDualVec2, Math::Vector2, T)
typedef BasicDualVec2<Float> DualVec2;
}
void DualTest::subclassTypes() {
const DualVec2 a;
CORRADE_VERIFY((std::is_same<decltype(-a), DualVec2>::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)

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

@ -61,7 +61,7 @@ template<> struct FrustumConverter<Float, Frstm> {
}
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)

4
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)

12
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<Float> 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)

4
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)

4
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<class T> bool rangeFrustumNaive(const Math::Range3D<T>& box, const Math::Frustum<T>& frustum) {
for(const Math::Vector4<T>& plane: frustum.planes()) {
@ -218,6 +218,6 @@ void IntersectionBenchmark::sphereConeView() {
}
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::IntersectionBenchmark)

4
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)

4
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<Matrix3>("matrix"), m);
}
}}}
}}}}
CORRADE_TEST_MAIN(Magnum::Math::Test::Matrix3Test)

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

Loading…
Cancel
Save