From e8f13af4beffc24958e714e58c55a3c57867d607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 17 Nov 2020 21:12:39 +0100 Subject: [PATCH] GL: test noexcept-movability of all GL classes. Not sure why this wasn't done for ages already, all other (non-GL) classes have it. --- src/Magnum/GL/Test/AbstractQueryGLTest.cpp | 2 ++ .../GL/Test/AbstractShaderProgramGLTest.cpp | 3 +++ src/Magnum/GL/Test/BufferGLTest.cpp | 3 +++ src/Magnum/GL/Test/BufferImageGLTest.cpp | 6 ++++++ src/Magnum/GL/Test/BufferTextureGLTest.cpp | 11 +++++++++++ .../GL/Test/CubeMapTextureArrayGLTest.cpp | 11 +++++++++++ src/Magnum/GL/Test/CubeMapTextureGLTest.cpp | 11 +++++++++++ src/Magnum/GL/Test/FramebufferGLTest.cpp | 3 +++ src/Magnum/GL/Test/MeshGLTest.cpp | 3 +++ .../GL/Test/MultisampleTextureGLTest.cpp | 12 ++++++++++++ .../GL/Test/PipelineStatisticsQueryGLTest.cpp | 13 ++++++++++++- src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp | 19 ++++++++++++++++++- src/Magnum/GL/Test/RectangleTextureGLTest.cpp | 11 +++++++++++ src/Magnum/GL/Test/RenderbufferGLTest.cpp | 3 +++ src/Magnum/GL/Test/SampleQueryGLTest.cpp | 13 ++++++++++++- src/Magnum/GL/Test/ShaderGLTest.cpp | 3 +++ src/Magnum/GL/Test/TextureArrayGLTest.cpp | 13 +++++++++++++ src/Magnum/GL/Test/TextureGLTest.cpp | 13 +++++++++++++ src/Magnum/GL/Test/TimeQueryGLTest.cpp | 13 ++++++++++++- .../GL/Test/TransformFeedbackGLTest.cpp | 3 +++ 20 files changed, 165 insertions(+), 4 deletions(-) diff --git a/src/Magnum/GL/Test/AbstractQueryGLTest.cpp b/src/Magnum/GL/Test/AbstractQueryGLTest.cpp index bb09385bc..9b5e34ea5 100644 --- a/src/Magnum/GL/Test/AbstractQueryGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractQueryGLTest.cpp @@ -106,6 +106,8 @@ void AbstractQueryGLTest::constructMove() { CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); + + /* nothrow move constructibility tested in subclasses */ } #ifndef MAGNUM_TARGET_WEBGL diff --git a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp index 70ea11be5..787a1d792 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp @@ -165,6 +165,9 @@ void AbstractShaderProgramGLTest::constructMove() { CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); } #ifndef MAGNUM_TARGET_WEBGL diff --git a/src/Magnum/GL/Test/BufferGLTest.cpp b/src/Magnum/GL/Test/BufferGLTest.cpp index 43f104f70..208154f54 100644 --- a/src/Magnum/GL/Test/BufferGLTest.cpp +++ b/src/Magnum/GL/Test/BufferGLTest.cpp @@ -164,6 +164,9 @@ void BufferGLTest::constructMove() { CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); } void BufferGLTest::wrap() { diff --git a/src/Magnum/GL/Test/BufferImageGLTest.cpp b/src/Magnum/GL/Test/BufferImageGLTest.cpp index 7b9f4e0ea..5800febda 100644 --- a/src/Magnum/GL/Test/BufferImageGLTest.cpp +++ b/src/Magnum/GL/Test/BufferImageGLTest.cpp @@ -399,6 +399,9 @@ void BufferImageGLTest::constructMove() { CORRADE_COMPARE(c.size(), Vector2i(4, 1)); CORRADE_COMPARE(c.dataSize(), 4); CORRADE_COMPARE(c.buffer().id(), id); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); } void BufferImageGLTest::constructMoveCompressed() { @@ -446,6 +449,9 @@ void BufferImageGLTest::constructMoveCompressed() { CORRADE_COMPARE(c.size(), Vector2i(4, 4)); CORRADE_COMPARE(c.dataSize(), 8); CORRADE_COMPARE(c.buffer().id(), id); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); } void BufferImageGLTest::dataProperties() { diff --git a/src/Magnum/GL/Test/BufferTextureGLTest.cpp b/src/Magnum/GL/Test/BufferTextureGLTest.cpp index 4b3d78df6..b224ee9d3 100644 --- a/src/Magnum/GL/Test/BufferTextureGLTest.cpp +++ b/src/Magnum/GL/Test/BufferTextureGLTest.cpp @@ -45,6 +45,7 @@ struct BufferTextureGLTest: OpenGLTester { explicit BufferTextureGLTest(); void construct(); + void constructMove(); void wrap(); void bind(); @@ -68,6 +69,7 @@ struct BufferTextureGLTest: OpenGLTester { BufferTextureGLTest::BufferTextureGLTest() { addTests({&BufferTextureGLTest::construct, + &BufferTextureGLTest::constructMove, &BufferTextureGLTest::wrap, &BufferTextureGLTest::bind, @@ -109,6 +111,15 @@ void BufferTextureGLTest::construct() { MAGNUM_VERIFY_NO_GL_ERROR(); } +void BufferTextureGLTest::constructMove() { + /* Move constructor tested in AbstractTexture, here we just verify there + are no extra members that would need to be taken care of */ + CORRADE_COMPARE(sizeof(BufferTexture), sizeof(AbstractTexture)); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + void BufferTextureGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp index ad58eb584..4be3da0ca 100644 --- a/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp @@ -44,6 +44,7 @@ struct CubeMapTextureArrayGLTest: OpenGLTester { explicit CubeMapTextureArrayGLTest(); void construct(); + void constructMove(); void wrap(); void bind(); @@ -265,6 +266,7 @@ const struct { CubeMapTextureArrayGLTest::CubeMapTextureArrayGLTest() { addTests({&CubeMapTextureArrayGLTest::construct, + &CubeMapTextureArrayGLTest::constructMove, &CubeMapTextureArrayGLTest::wrap, &CubeMapTextureArrayGLTest::bind, @@ -343,6 +345,15 @@ void CubeMapTextureArrayGLTest::construct() { MAGNUM_VERIFY_NO_GL_ERROR(); } +void CubeMapTextureArrayGLTest::constructMove() { + /* Move constructor tested in AbstractTexture, here we just verify there + are no extra members that would need to be taken care of */ + CORRADE_COMPARE(sizeof(CubeMapTextureArray), sizeof(AbstractTexture)); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + void CubeMapTextureArrayGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp index 90faa88fd..aee77342f 100644 --- a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp @@ -50,6 +50,7 @@ struct CubeMapTextureGLTest: OpenGLTester { explicit CubeMapTextureGLTest(); void construct(); + void constructMove(); void wrap(); void bind(); @@ -302,6 +303,7 @@ const struct { CubeMapTextureGLTest::CubeMapTextureGLTest() { addTests({&CubeMapTextureGLTest::construct, + &CubeMapTextureGLTest::constructMove, &CubeMapTextureGLTest::wrap, &CubeMapTextureGLTest::bind, @@ -441,6 +443,15 @@ void CubeMapTextureGLTest::construct() { MAGNUM_VERIFY_NO_GL_ERROR(); } +void CubeMapTextureGLTest::constructMove() { + /* Move constructor tested in AbstractTexture, here we just verify there + are no extra members that would need to be taken care of */ + CORRADE_COMPARE(sizeof(CubeMapTexture), sizeof(AbstractTexture)); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + void CubeMapTextureGLTest::wrap() { GLuint id; glGenTextures(1, &id); diff --git a/src/Magnum/GL/Test/FramebufferGLTest.cpp b/src/Magnum/GL/Test/FramebufferGLTest.cpp index 140e81eff..ee04bb84b 100644 --- a/src/Magnum/GL/Test/FramebufferGLTest.cpp +++ b/src/Magnum/GL/Test/FramebufferGLTest.cpp @@ -367,6 +367,9 @@ void FramebufferGLTest::constructMove() { CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); CORRADE_COMPARE(c.viewport(), Range2Di({32, 16}, {128, 256})); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); } void FramebufferGLTest::wrap() { diff --git a/src/Magnum/GL/Test/MeshGLTest.cpp b/src/Magnum/GL/Test/MeshGLTest.cpp index e3146b10f..04442898e 100644 --- a/src/Magnum/GL/Test/MeshGLTest.cpp +++ b/src/Magnum/GL/Test/MeshGLTest.cpp @@ -408,6 +408,9 @@ void MeshGLTest::constructMove() { CORRADE_COMPARE(Containers::arrayCast(framebuffer.read({{}, Vector2i{1}}, {PixelFormat::RGBA, PixelType::UnsignedByte}).data())[0], 85); #endif } + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); } void MeshGLTest::wrap() { diff --git a/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp b/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp index a74838a88..e01fa2213 100644 --- a/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp +++ b/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp @@ -41,6 +41,7 @@ struct MultisampleTextureGLTest: OpenGLTester { void construct2D(); void construct2DArray(); + void constructMove(); void wrap2D(); void wrap2DArray(); @@ -65,6 +66,8 @@ MultisampleTextureGLTest::MultisampleTextureGLTest() { addTests({&MultisampleTextureGLTest::construct2D, &MultisampleTextureGLTest::construct2DArray, + &MultisampleTextureGLTest::constructMove, + &MultisampleTextureGLTest::wrap2D, &MultisampleTextureGLTest::wrap2DArray, @@ -122,6 +125,15 @@ void MultisampleTextureGLTest::construct2DArray() { MAGNUM_VERIFY_NO_GL_ERROR(); } +void MultisampleTextureGLTest::constructMove() { + /* Move constructor tested in AbstractTexture, here we just verify there + are no extra members that would need to be taken care of */ + CORRADE_COMPARE(sizeof(MultisampleTexture2D), sizeof(AbstractTexture)); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + void MultisampleTextureGLTest::wrap2D() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/GL/Test/PipelineStatisticsQueryGLTest.cpp b/src/Magnum/GL/Test/PipelineStatisticsQueryGLTest.cpp index c546b8b96..ebf116b10 100644 --- a/src/Magnum/GL/Test/PipelineStatisticsQueryGLTest.cpp +++ b/src/Magnum/GL/Test/PipelineStatisticsQueryGLTest.cpp @@ -42,17 +42,28 @@ namespace Magnum { namespace GL { namespace Test { namespace { struct PipelineStatisticsQueryGLTest: OpenGLTester { explicit PipelineStatisticsQueryGLTest(); + void constructMove(); void wrap(); void queryVerticesSubmitted(); }; PipelineStatisticsQueryGLTest::PipelineStatisticsQueryGLTest() { - addTests({&PipelineStatisticsQueryGLTest::wrap, + addTests({&PipelineStatisticsQueryGLTest::constructMove, + &PipelineStatisticsQueryGLTest::wrap, &PipelineStatisticsQueryGLTest::queryVerticesSubmitted}); } +void PipelineStatisticsQueryGLTest::constructMove() { + /* Move constructor tested in AbstractQuery, here we just verify there + are no extra members that would need to be taken care of */ + CORRADE_COMPARE(sizeof(PipelineStatisticsQuery), sizeof(AbstractQuery)); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + void PipelineStatisticsQueryGLTest::wrap() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::ARB::pipeline_statistics_query::string() + std::string(" is not available")); diff --git a/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp index fbf02a5d2..b6f0c6106 100644 --- a/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp +++ b/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp @@ -46,6 +46,7 @@ namespace Magnum { namespace GL { namespace Test { namespace { struct PrimitiveQueryGLTest: OpenGLTester { explicit PrimitiveQueryGLTest(); + void constructMove(); void wrap(); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) @@ -61,7 +62,8 @@ struct PrimitiveQueryGLTest: OpenGLTester { }; PrimitiveQueryGLTest::PrimitiveQueryGLTest() { - addTests({&PrimitiveQueryGLTest::wrap, + addTests({&PrimitiveQueryGLTest::constructMove, + &PrimitiveQueryGLTest::wrap, #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &PrimitiveQueryGLTest::primitivesGenerated, @@ -76,6 +78,21 @@ PrimitiveQueryGLTest::PrimitiveQueryGLTest() { }); } +void PrimitiveQueryGLTest::constructMove() { + /* Move constructor tested in AbstractQuery. Compared to other *Query + classes, PrimitiveQuery contains an additional layer ID, which is + trivial to move and the move is defaulted, so we HOPEFULLY don't need to + test. In case this bites me in the future, I'm stupid. */ + #ifndef MAGNUM_TARGET_GLES + CORRADE_COMPARE(sizeof(PrimitiveQuery), sizeof(AbstractQuery) + sizeof(GLuint)); + #else + CORRADE_COMPARE(sizeof(PrimitiveQuery), sizeof(AbstractQuery)); + #endif + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + void PrimitiveQueryGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/GL/Test/RectangleTextureGLTest.cpp b/src/Magnum/GL/Test/RectangleTextureGLTest.cpp index 5096a95f5..0eb72f840 100644 --- a/src/Magnum/GL/Test/RectangleTextureGLTest.cpp +++ b/src/Magnum/GL/Test/RectangleTextureGLTest.cpp @@ -45,6 +45,7 @@ struct RectangleTextureGLTest: OpenGLTester { explicit RectangleTextureGLTest(); void construct(); + void constructMove(); void wrap(); void bind(); @@ -115,6 +116,7 @@ const struct { RectangleTextureGLTest::RectangleTextureGLTest() { addTests({&RectangleTextureGLTest::construct, + &RectangleTextureGLTest::constructMove, &RectangleTextureGLTest::wrap, &RectangleTextureGLTest::bind, @@ -167,6 +169,15 @@ void RectangleTextureGLTest::construct() { MAGNUM_VERIFY_NO_GL_ERROR(); } +void RectangleTextureGLTest::constructMove() { + /* Move constructor tested in AbstractTexture, here we just verify there + are no extra members that would need to be taken care of */ + CORRADE_COMPARE(sizeof(RectangleTexture), sizeof(AbstractTexture)); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + void RectangleTextureGLTest::wrap() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); diff --git a/src/Magnum/GL/Test/RenderbufferGLTest.cpp b/src/Magnum/GL/Test/RenderbufferGLTest.cpp index c29ce2349..06cb1c707 100644 --- a/src/Magnum/GL/Test/RenderbufferGLTest.cpp +++ b/src/Magnum/GL/Test/RenderbufferGLTest.cpp @@ -109,6 +109,9 @@ void RenderbufferGLTest::constructMove() { CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); } void RenderbufferGLTest::wrap() { diff --git a/src/Magnum/GL/Test/SampleQueryGLTest.cpp b/src/Magnum/GL/Test/SampleQueryGLTest.cpp index a2726d5e7..ef597af32 100644 --- a/src/Magnum/GL/Test/SampleQueryGLTest.cpp +++ b/src/Magnum/GL/Test/SampleQueryGLTest.cpp @@ -44,6 +44,7 @@ namespace Magnum { namespace GL { namespace Test { namespace { struct SampleQueryGLTest: OpenGLTester { explicit SampleQueryGLTest(); + void constructMove(); void wrap(); void querySamplesPassed(); @@ -53,7 +54,8 @@ struct SampleQueryGLTest: OpenGLTester { }; SampleQueryGLTest::SampleQueryGLTest() { - addTests({&SampleQueryGLTest::wrap, + addTests({&SampleQueryGLTest::constructMove, + &SampleQueryGLTest::wrap, &SampleQueryGLTest::querySamplesPassed, #ifndef MAGNUM_TARGET_GLES @@ -62,6 +64,15 @@ SampleQueryGLTest::SampleQueryGLTest() { }); } +void SampleQueryGLTest::constructMove() { + /* Move constructor tested in AbstractQuery, here we just verify there + are no extra members that would need to be taken care of */ + CORRADE_COMPARE(sizeof(SampleQuery), sizeof(AbstractQuery)); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + void SampleQueryGLTest::wrap() { #ifdef MAGNUM_TARGET_GLES2 if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/GL/Test/ShaderGLTest.cpp b/src/Magnum/GL/Test/ShaderGLTest.cpp index 7e8fd8cfa..c6dd74dfe 100644 --- a/src/Magnum/GL/Test/ShaderGLTest.cpp +++ b/src/Magnum/GL/Test/ShaderGLTest.cpp @@ -137,6 +137,9 @@ void ShaderGLTest::constructMove() { #else CORRADE_COMPARE(c.sources(), std::vector{"#version 300 es\n"}); #endif + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); } #ifndef MAGNUM_TARGET_WEBGL diff --git a/src/Magnum/GL/Test/TextureArrayGLTest.cpp b/src/Magnum/GL/Test/TextureArrayGLTest.cpp index 3b2d09b26..d7471d092 100644 --- a/src/Magnum/GL/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/TextureArrayGLTest.cpp @@ -51,6 +51,8 @@ struct TextureArrayGLTest: OpenGLTester { #endif void construct2D(); + void constructMove(); + #ifndef MAGNUM_TARGET_GLES void wrap1D(); #endif @@ -273,6 +275,8 @@ TextureArrayGLTest::TextureArrayGLTest() { #endif &TextureArrayGLTest::construct2D, + &TextureArrayGLTest::constructMove, + #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::wrap1D, #endif @@ -434,6 +438,15 @@ void TextureArrayGLTest::construct2D() { MAGNUM_VERIFY_NO_GL_ERROR(); } +void TextureArrayGLTest::constructMove() { + /* Move constructor tested in AbstractTexture, here we just verify there + are no extra members that would need to be taken care of */ + CORRADE_COMPARE(sizeof(Texture2DArray), sizeof(AbstractTexture)); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::wrap1D() { GLuint id; diff --git a/src/Magnum/GL/Test/TextureGLTest.cpp b/src/Magnum/GL/Test/TextureGLTest.cpp index 4eadf06bf..26ae3f883 100644 --- a/src/Magnum/GL/Test/TextureGLTest.cpp +++ b/src/Magnum/GL/Test/TextureGLTest.cpp @@ -55,6 +55,8 @@ struct TextureGLTest: OpenGLTester { void construct3D(); #endif + void constructMove(); + #ifndef MAGNUM_TARGET_GLES void wrap1D(); #endif @@ -433,6 +435,8 @@ TextureGLTest::TextureGLTest() { &TextureGLTest::construct3D, #endif + &TextureGLTest::constructMove, + #ifndef MAGNUM_TARGET_GLES &TextureGLTest::wrap1D, #endif @@ -690,6 +694,15 @@ void TextureGLTest::construct3D() { } #endif +void TextureGLTest::constructMove() { + /* Move constructor tested in AbstractTexture, here we just verify there + are no extra members that would need to be taken care of */ + CORRADE_COMPARE(sizeof(Texture2D), sizeof(AbstractTexture)); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + #ifndef MAGNUM_TARGET_GLES void TextureGLTest::wrap1D() { GLuint id; diff --git a/src/Magnum/GL/Test/TimeQueryGLTest.cpp b/src/Magnum/GL/Test/TimeQueryGLTest.cpp index 204bd3d1d..1ba42e6aa 100644 --- a/src/Magnum/GL/Test/TimeQueryGLTest.cpp +++ b/src/Magnum/GL/Test/TimeQueryGLTest.cpp @@ -35,6 +35,7 @@ namespace Magnum { namespace GL { namespace Test { namespace { struct TimeQueryGLTest: OpenGLTester { explicit TimeQueryGLTest(); + void constructMove(); void wrap(); void queryTime(); @@ -42,12 +43,22 @@ struct TimeQueryGLTest: OpenGLTester { }; TimeQueryGLTest::TimeQueryGLTest() { - addTests({&TimeQueryGLTest::wrap, + addTests({&TimeQueryGLTest::constructMove, + &TimeQueryGLTest::wrap, &TimeQueryGLTest::queryTime, &TimeQueryGLTest::queryTimestamp}); } +void TimeQueryGLTest::constructMove() { + /* Move constructor tested in AbstractQuery, here we just verify there + are no extra members that would need to be taken care of */ + CORRADE_COMPARE(sizeof(TimeQuery), sizeof(AbstractQuery)); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); +} + void TimeQueryGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp index 7aede06d5..fffba6dbb 100644 --- a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp @@ -152,6 +152,9 @@ void TransformFeedbackGLTest::constructMove() { CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable::value); } void TransformFeedbackGLTest::wrap() {