Skip to content

Commit

Permalink
Test: adapt to changes in CORRADE_SKIP().
Browse files Browse the repository at this point in the history
Chose to update the tests instead of adding a compatibility DebugStl.h
include to Tester.h, which would have a significant impact on compile
times.
  • Loading branch information
mosra committed Apr 1, 2021
1 parent b3fd0b3 commit 65a935c
Show file tree
Hide file tree
Showing 34 changed files with 756 additions and 756 deletions.
10 changes: 5 additions & 5 deletions src/Magnum/Audio/Test/BufferALTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void BufferALTest::properties() {

void BufferALTest::loopPoints() {
if(!_context.isExtensionSupported<Audio::Extensions::AL::SOFT::loop_points>())
CORRADE_SKIP(Extensions::AL::SOFT::loop_points::string() + std::string{" is not supported."});
CORRADE_SKIP(Extensions::AL::SOFT::loop_points::string() << "is not supported.");

Buffer buf;
constexpr char data[] { 25, 17, 24, 122, 67, 24, 48, 96 };
Expand All @@ -95,7 +95,7 @@ void BufferALTest::loopPoints() {

void BufferALTest::setLoopPoints() {
if(!_context.isExtensionSupported<Audio::Extensions::AL::SOFT::loop_points>())
CORRADE_SKIP(Extensions::AL::SOFT::loop_points::string() + std::string{" is not supported."});
CORRADE_SKIP(Extensions::AL::SOFT::loop_points::string() << "is not supported.");

Buffer buf;
constexpr char data[] { 25, 17, 24, 122, 67, 24, 48, 96 };
Expand All @@ -106,7 +106,7 @@ void BufferALTest::setLoopPoints() {

void BufferALTest::setLoopSince() {
if(!_context.isExtensionSupported<Audio::Extensions::AL::SOFT::loop_points>())
CORRADE_SKIP(Extensions::AL::SOFT::loop_points::string() + std::string{" is not supported."});
CORRADE_SKIP(Extensions::AL::SOFT::loop_points::string() << "is not supported.");

Buffer buf;
constexpr char data[] { 25, 17, 24, 122, 67, 24, 48, 96 };
Expand All @@ -117,7 +117,7 @@ void BufferALTest::setLoopSince() {

void BufferALTest::setLoopUntil() {
if(!_context.isExtensionSupported<Audio::Extensions::AL::SOFT::loop_points>())
CORRADE_SKIP(Extensions::AL::SOFT::loop_points::string() + std::string{" is not supported."});
CORRADE_SKIP(Extensions::AL::SOFT::loop_points::string() << "is not supported.");

Buffer buf;
constexpr char data[] { 25, 17, 24, 122, 67, 24, 48, 96 };
Expand All @@ -128,7 +128,7 @@ void BufferALTest::setLoopUntil() {

void BufferALTest::resetLoopPoints() {
if(!_context.isExtensionSupported<Audio::Extensions::AL::SOFT::loop_points>())
CORRADE_SKIP(Extensions::AL::SOFT::loop_points::string() + std::string{" is not supported."});
CORRADE_SKIP(Extensions::AL::SOFT::loop_points::string() << "is not supported.");

Buffer buf;
constexpr char data[] { 25, 17, 24, 122, 67, 24, 48, 96 };
Expand Down
2 changes: 1 addition & 1 deletion src/Magnum/Audio/Test/ContextALTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void ContextALTest::isExtensionUnsupported() {
Context context;

if(context.isExtensionSupported<Extensions::ALC::SOFTX::HRTF>())
CORRADE_SKIP("Extension" + std::string{Extensions::ALC::SOFTX::HRTF::string()} + " is supported, can't test.");
CORRADE_SKIP("Extension" << Extensions::ALC::SOFTX::HRTF::string() << "is supported, can't test.");

CORRADE_VERIFY(!context.isExtensionSupported<Extensions::ALC::SOFTX::HRTF>());
CORRADE_VERIFY(!context.isExtensionDisabled<Extensions::ALC::SOFTX::HRTF>());
Expand Down
8 changes: 4 additions & 4 deletions src/Magnum/DebugTools/Test/BufferDataGLTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ constexpr Int Data[] = {2, 7, 5, 13, 25};
void BufferDataGLTest::data() {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::map_buffer_range>())
CORRADE_SKIP(GL::Extensions::ARB::map_buffer_range::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::ARB::map_buffer_range::string() << "is not supported.");
#elif defined(MAGNUM_TARGET_GLES2)
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::map_buffer_range>())
CORRADE_SKIP(GL::Extensions::EXT::map_buffer_range::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::EXT::map_buffer_range::string() << "is not supported.");
#endif

GL::Buffer buffer;
Expand All @@ -66,10 +66,10 @@ void BufferDataGLTest::data() {
void BufferDataGLTest::subData() {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::map_buffer_range>())
CORRADE_SKIP(GL::Extensions::ARB::map_buffer_range::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::ARB::map_buffer_range::string() << "is not supported.");
#elif defined(MAGNUM_TARGET_GLES2)
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::map_buffer_range>())
CORRADE_SKIP(GL::Extensions::EXT::map_buffer_range::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::EXT::map_buffer_range::string() << "is not supported.");
#endif

GL::Buffer buffer;
Expand Down
12 changes: 6 additions & 6 deletions src/Magnum/DebugTools/Test/FrameProfilerGLTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,19 @@ void FrameProfilerGLTest::test() {
if(data.values & GLFrameProfiler::Value::GpuDuration) {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::timer_query>())
CORRADE_SKIP(GL::Extensions::ARB::timer_query::string() + std::string(" is not available"));
CORRADE_SKIP(GL::Extensions::ARB::timer_query::string() << "is not supported.");
#elif defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2)
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::disjoint_timer_query_webgl2>())
CORRADE_SKIP(GL::Extensions::EXT::disjoint_timer_query_webgl2::string() + std::string(" is not available"));
CORRADE_SKIP(GL::Extensions::EXT::disjoint_timer_query_webgl2::string() << "is not supported.");
#else
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::disjoint_timer_query>())
CORRADE_SKIP(GL::Extensions::EXT::disjoint_timer_query::string() + std::string(" is not available"));
CORRADE_SKIP(GL::Extensions::EXT::disjoint_timer_query::string() << "is not supported.");
#endif
}

#ifndef MAGNUM_TARGET_GLES
if((data.values & GLFrameProfiler::Value::VertexFetchRatio) && !GL::Context::current().isExtensionSupported<GL::Extensions::ARB::pipeline_statistics_query>())
CORRADE_SKIP(GL::Extensions::ARB::pipeline_statistics_query::string() + std::string(" is not available"));
CORRADE_SKIP(GL::Extensions::ARB::pipeline_statistics_query::string() << "is not supported.");
#endif

/* Bind some FB to avoid errors on contexts w/o default FB */
Expand Down Expand Up @@ -188,7 +188,7 @@ void FrameProfilerGLTest::test() {
#ifndef MAGNUM_TARGET_GLES
void FrameProfilerGLTest::vertexFetchRatioDivisionByZero() {
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::pipeline_statistics_query>())
CORRADE_SKIP(GL::Extensions::ARB::pipeline_statistics_query::string() + std::string(" is not available"));
CORRADE_SKIP(GL::Extensions::ARB::pipeline_statistics_query::string() << "is not supported.");

GLFrameProfiler profiler{GLFrameProfiler::Value::VertexFetchRatio, 4};

Expand All @@ -214,7 +214,7 @@ void FrameProfilerGLTest::vertexFetchRatioDivisionByZero() {

void FrameProfilerGLTest::primitiveClipRatioDivisionByZero() {
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::pipeline_statistics_query>())
CORRADE_SKIP(GL::Extensions::ARB::pipeline_statistics_query::string() + std::string(" is not available"));
CORRADE_SKIP(GL::Extensions::ARB::pipeline_statistics_query::string() << "is not supported.");

GLFrameProfiler profiler{GLFrameProfiler::Value::PrimitiveClipRatio, 4};

Expand Down
2 changes: 1 addition & 1 deletion src/Magnum/DebugTools/Test/TextureImageGLTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ constexpr UnsignedInt Data2DUInt[] = { 0xcafebabe,
void TextureImageGLTest::subImage2DUInt() {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::texture_integer>())
CORRADE_SKIP(GL::Extensions::EXT::texture_integer::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::EXT::texture_integer::string() << "is not supported.");
#endif

GL::Texture2D texture;
Expand Down
6 changes: 3 additions & 3 deletions src/Magnum/GL/Test/AbstractQueryGLTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ AbstractQueryGLTest::AbstractQueryGLTest() {
void AbstractQueryGLTest::construct() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current().isExtensionSupported<Extensions::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() + std::string(" is not supported."));
CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() << "is not supported.");
#endif

{
Expand All @@ -76,7 +76,7 @@ void AbstractQueryGLTest::construct() {
void AbstractQueryGLTest::constructMove() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current().isExtensionSupported<Extensions::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() + std::string(" is not supported."));
CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() << "is not supported.");
#endif

#ifndef MAGNUM_TARGET_GLES
Expand Down Expand Up @@ -114,7 +114,7 @@ void AbstractQueryGLTest::constructMove() {
void AbstractQueryGLTest::label() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current().isExtensionSupported<Extensions::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() + std::string(" is not supported."));
CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() << "is not supported.");
#endif

/* No-Op version is tested in AbstractObjectGLTest */
Expand Down
22 changes: 11 additions & 11 deletions src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void AbstractShaderProgramGLTest::create() {
void AbstractShaderProgramGLTest::createMultipleOutputs() {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::gpu_shader4>())
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() << "is not supported.");

Utility::Resource rs("AbstractShaderProgramGLTest");

Expand Down Expand Up @@ -326,9 +326,9 @@ void AbstractShaderProgramGLTest::createMultipleOutputs() {
#ifndef MAGNUM_TARGET_GLES
void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() {
if(!GL::Context::current().isExtensionSupported<GL::Extensions::EXT::gpu_shader4>())
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::EXT::gpu_shader4::string() << "is not supported.");
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::blend_func_extended>())
CORRADE_SKIP(GL::Extensions::ARB::blend_func_extended::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::ARB::blend_func_extended::string() << "is not supported.");

Utility::Resource rs("AbstractShaderProgramGLTest");

Expand Down Expand Up @@ -590,7 +590,7 @@ MyDoubleShader::MyDoubleShader() {

void AbstractShaderProgramGLTest::uniformDouble() {
if(!Context::current().isExtensionSupported<Extensions::ARB::gpu_shader_fp64>())
CORRADE_SKIP(Extensions::ARB::gpu_shader_fp64::string() + std::string{" is not supported."});
CORRADE_SKIP(Extensions::ARB::gpu_shader_fp64::string() << "is not supported.");

MyDoubleShader shader;

Expand All @@ -603,7 +603,7 @@ void AbstractShaderProgramGLTest::uniformDouble() {

void AbstractShaderProgramGLTest::uniformDoubleVector() {
if(!Context::current().isExtensionSupported<Extensions::ARB::gpu_shader_fp64>())
CORRADE_SKIP(Extensions::ARB::gpu_shader_fp64::string() + std::string{" is not supported."});
CORRADE_SKIP(Extensions::ARB::gpu_shader_fp64::string() << "is not supported.");

MyDoubleShader shader;

Expand All @@ -616,7 +616,7 @@ void AbstractShaderProgramGLTest::uniformDoubleVector() {

void AbstractShaderProgramGLTest::uniformDoubleMatrix() {
if(!Context::current().isExtensionSupported<Extensions::ARB::gpu_shader_fp64>())
CORRADE_SKIP(Extensions::ARB::gpu_shader_fp64::string() + std::string{" is not supported."});
CORRADE_SKIP(Extensions::ARB::gpu_shader_fp64::string() << "is not supported.");

MyDoubleShader shader;

Expand All @@ -629,7 +629,7 @@ void AbstractShaderProgramGLTest::uniformDoubleMatrix() {

void AbstractShaderProgramGLTest::uniformDoubleArray() {
if(!Context::current().isExtensionSupported<Extensions::ARB::gpu_shader_fp64>())
CORRADE_SKIP(Extensions::ARB::gpu_shader_fp64::string() + std::string{" is not supported."});
CORRADE_SKIP(Extensions::ARB::gpu_shader_fp64::string() << "is not supported.");

MyDoubleShader shader;

Expand All @@ -654,7 +654,7 @@ void AbstractShaderProgramGLTest::uniformDoubleArray() {
void AbstractShaderProgramGLTest::createUniformBlocks() {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported.");
#endif

Utility::Resource rs("AbstractShaderProgramGLTest");
Expand Down Expand Up @@ -711,7 +711,7 @@ void AbstractShaderProgramGLTest::createUniformBlocks() {
void AbstractShaderProgramGLTest::uniformBlockIndexNotFound() {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported.");
#endif

MyPublicShader program;
Expand Down Expand Up @@ -790,7 +790,7 @@ UniformBlockShader::UniformBlockShader() {
void AbstractShaderProgramGLTest::uniformBlock() {
#ifndef MAGNUM_TARGET_GLES
if(!GL::Context::current().isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() + std::string(" is not supported"));
CORRADE_SKIP(GL::Extensions::ARB::uniform_buffer_object::string() << "is not supported.");
#endif

UniformBlockShader shader;
Expand All @@ -807,7 +807,7 @@ void AbstractShaderProgramGLTest::uniformBlock() {
void AbstractShaderProgramGLTest::compute() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::ARB::compute_shader>())
CORRADE_SKIP(Extensions::ARB::compute_shader::string() + std::string(" is not supported."));
CORRADE_SKIP(Extensions::ARB::compute_shader::string() << "is not supported.");
#else
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
Expand Down
Loading

0 comments on commit 65a935c

Please sign in to comment.