From 6e8e78c0e4e0918d9534be5aef45d3b7194a117b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 28 Sep 2020 18:28:12 +0200 Subject: [PATCH] GL: verify that NoCreate constructors are explicit. --- src/Magnum/GL/Test/AbstractShaderProgramTest.cpp | 3 ++- src/Magnum/GL/Test/BufferImageTest.cpp | 3 ++- src/Magnum/GL/Test/BufferTest.cpp | 3 ++- src/Magnum/GL/Test/BufferTextureTest.cpp | 3 ++- src/Magnum/GL/Test/ContextTest.cpp | 3 +++ src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp | 3 ++- src/Magnum/GL/Test/CubeMapTextureTest.cpp | 3 ++- src/Magnum/GL/Test/FramebufferTest.cpp | 3 ++- src/Magnum/GL/Test/MeshTest.cpp | 6 ++++-- src/Magnum/GL/Test/MultisampleTextureTest.cpp | 6 ++++-- src/Magnum/GL/Test/PipelineStatisticsQueryTest.cpp | 3 ++- src/Magnum/GL/Test/PrimitiveQueryTest.cpp | 3 ++- src/Magnum/GL/Test/RectangleTextureTest.cpp | 3 ++- src/Magnum/GL/Test/RenderbufferTest.cpp | 3 ++- src/Magnum/GL/Test/SampleQueryTest.cpp | 3 ++- src/Magnum/GL/Test/ShaderTest.cpp | 3 ++- src/Magnum/GL/Test/TextureArrayTest.cpp | 6 ++++-- src/Magnum/GL/Test/TextureTest.cpp | 9 ++++++--- src/Magnum/GL/Test/TimeQueryTest.cpp | 3 ++- src/Magnum/GL/Test/TransformFeedbackTest.cpp | 3 ++- 20 files changed, 51 insertions(+), 24 deletions(-) diff --git a/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp index f85ffd362..aed316ce1 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp +++ b/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp @@ -50,7 +50,8 @@ void AbstractShaderProgramTest::constructNoCreate() { CORRADE_COMPARE(shader.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void AbstractShaderProgramTest::constructCopy() { diff --git a/src/Magnum/GL/Test/BufferImageTest.cpp b/src/Magnum/GL/Test/BufferImageTest.cpp index c58c68bfd..2587febd1 100644 --- a/src/Magnum/GL/Test/BufferImageTest.cpp +++ b/src/Magnum/GL/Test/BufferImageTest.cpp @@ -53,7 +53,8 @@ void BufferImageTest::constructNoCreate() { CORRADE_COMPARE(image.buffer().id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void BufferImageTest::constructNoCreateCompressed() { diff --git a/src/Magnum/GL/Test/BufferTest.cpp b/src/Magnum/GL/Test/BufferTest.cpp index c3f05ef98..c331fe977 100644 --- a/src/Magnum/GL/Test/BufferTest.cpp +++ b/src/Magnum/GL/Test/BufferTest.cpp @@ -61,7 +61,8 @@ void BufferTest::constructNoCreate() { CORRADE_COMPARE(buffer.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void BufferTest::constructCopy() { diff --git a/src/Magnum/GL/Test/BufferTextureTest.cpp b/src/Magnum/GL/Test/BufferTextureTest.cpp index 68cb70988..a7ac2ecf7 100644 --- a/src/Magnum/GL/Test/BufferTextureTest.cpp +++ b/src/Magnum/GL/Test/BufferTextureTest.cpp @@ -47,7 +47,8 @@ void BufferTextureTest::constructNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void BufferTextureTest::constructCopy() { diff --git a/src/Magnum/GL/Test/ContextTest.cpp b/src/Magnum/GL/Test/ContextTest.cpp index 724010390..854a98d73 100644 --- a/src/Magnum/GL/Test/ContextTest.cpp +++ b/src/Magnum/GL/Test/ContextTest.cpp @@ -78,6 +78,9 @@ void ContextTest::constructNoCreate() { } CORRADE_VERIFY(!Context::hasCurrent()); + + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void ContextTest::constructCopyMove() { diff --git a/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp b/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp index f75c93957..9a1846e68 100644 --- a/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp @@ -47,7 +47,8 @@ void CubeMapTextureArrayTest::constructNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void CubeMapTextureArrayTest::constructCopy() { diff --git a/src/Magnum/GL/Test/CubeMapTextureTest.cpp b/src/Magnum/GL/Test/CubeMapTextureTest.cpp index 0e7401863..0c97341ca 100644 --- a/src/Magnum/GL/Test/CubeMapTextureTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureTest.cpp @@ -47,7 +47,8 @@ void CubeMapTextureTest::constructNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void CubeMapTextureTest::constructCopy() { diff --git a/src/Magnum/GL/Test/FramebufferTest.cpp b/src/Magnum/GL/Test/FramebufferTest.cpp index e53955e57..09e37e1ec 100644 --- a/src/Magnum/GL/Test/FramebufferTest.cpp +++ b/src/Magnum/GL/Test/FramebufferTest.cpp @@ -53,7 +53,8 @@ void FramebufferTest::constructNoCreate() { CORRADE_COMPARE(framebuffer.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void FramebufferTest::constructCopy() { diff --git a/src/Magnum/GL/Test/MeshTest.cpp b/src/Magnum/GL/Test/MeshTest.cpp index ac4b3ed4a..fe89a4bcf 100644 --- a/src/Magnum/GL/Test/MeshTest.cpp +++ b/src/Magnum/GL/Test/MeshTest.cpp @@ -89,7 +89,8 @@ void MeshTest::constructNoCreate() { CORRADE_COMPARE(mesh.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void MeshTest::constructViewNoCreate() { @@ -99,7 +100,8 @@ void MeshTest::constructViewNoCreate() { CORRADE_COMPARE(&view.mesh(), &mesh); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void MeshTest::constructCopy() { diff --git a/src/Magnum/GL/Test/MultisampleTextureTest.cpp b/src/Magnum/GL/Test/MultisampleTextureTest.cpp index bf48334b6..b324c9917 100644 --- a/src/Magnum/GL/Test/MultisampleTextureTest.cpp +++ b/src/Magnum/GL/Test/MultisampleTextureTest.cpp @@ -53,7 +53,8 @@ void MultisampleTextureTest::construct2DNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void MultisampleTextureTest::construct2DArrayNoCreate() { @@ -62,7 +63,8 @@ void MultisampleTextureTest::construct2DArrayNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void MultisampleTextureTest::constructCopy2D() { diff --git a/src/Magnum/GL/Test/PipelineStatisticsQueryTest.cpp b/src/Magnum/GL/Test/PipelineStatisticsQueryTest.cpp index b974b4a43..e3e212a85 100644 --- a/src/Magnum/GL/Test/PipelineStatisticsQueryTest.cpp +++ b/src/Magnum/GL/Test/PipelineStatisticsQueryTest.cpp @@ -47,7 +47,8 @@ void PipelineStatisticsQueryTest::constructNoCreate() { CORRADE_COMPARE(query.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void PipelineStatisticsQueryTest::constructCopy() { diff --git a/src/Magnum/GL/Test/PrimitiveQueryTest.cpp b/src/Magnum/GL/Test/PrimitiveQueryTest.cpp index 410fe825b..b58b198e0 100644 --- a/src/Magnum/GL/Test/PrimitiveQueryTest.cpp +++ b/src/Magnum/GL/Test/PrimitiveQueryTest.cpp @@ -47,7 +47,8 @@ void PrimitiveQueryTest::constructNoCreate() { CORRADE_COMPARE(query.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void PrimitiveQueryTest::constructCopy() { diff --git a/src/Magnum/GL/Test/RectangleTextureTest.cpp b/src/Magnum/GL/Test/RectangleTextureTest.cpp index 32e7cbdd1..fb53cf5d3 100644 --- a/src/Magnum/GL/Test/RectangleTextureTest.cpp +++ b/src/Magnum/GL/Test/RectangleTextureTest.cpp @@ -47,7 +47,8 @@ void RectangleTextureTest::constructNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void RectangleTextureTest::constructCopy() { diff --git a/src/Magnum/GL/Test/RenderbufferTest.cpp b/src/Magnum/GL/Test/RenderbufferTest.cpp index 79bdcb70e..114d0f541 100644 --- a/src/Magnum/GL/Test/RenderbufferTest.cpp +++ b/src/Magnum/GL/Test/RenderbufferTest.cpp @@ -47,7 +47,8 @@ void RenderbufferTest::constructNoCreate() { CORRADE_COMPARE(renderbuffer.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void RenderbufferTest::constructCopy() { diff --git a/src/Magnum/GL/Test/SampleQueryTest.cpp b/src/Magnum/GL/Test/SampleQueryTest.cpp index 8b8c185ed..3c10d6b7c 100644 --- a/src/Magnum/GL/Test/SampleQueryTest.cpp +++ b/src/Magnum/GL/Test/SampleQueryTest.cpp @@ -47,7 +47,8 @@ void SampleQueryTest::constructNoCreate() { CORRADE_COMPARE(query.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void SampleQueryTest::constructCopy() { diff --git a/src/Magnum/GL/Test/ShaderTest.cpp b/src/Magnum/GL/Test/ShaderTest.cpp index cb8cf047d..f79e675f1 100644 --- a/src/Magnum/GL/Test/ShaderTest.cpp +++ b/src/Magnum/GL/Test/ShaderTest.cpp @@ -51,7 +51,8 @@ void ShaderTest::constructNoCreate() { CORRADE_COMPARE(shader.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void ShaderTest::constructCopy() { diff --git a/src/Magnum/GL/Test/TextureArrayTest.cpp b/src/Magnum/GL/Test/TextureArrayTest.cpp index b9c2d50a5..b84baa07c 100644 --- a/src/Magnum/GL/Test/TextureArrayTest.cpp +++ b/src/Magnum/GL/Test/TextureArrayTest.cpp @@ -63,7 +63,8 @@ void TextureArrayTest::construct1DNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } #endif @@ -73,7 +74,8 @@ void TextureArrayTest::construct2DNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/GL/Test/TextureTest.cpp b/src/Magnum/GL/Test/TextureTest.cpp index cbf92149b..831cf89f5 100644 --- a/src/Magnum/GL/Test/TextureTest.cpp +++ b/src/Magnum/GL/Test/TextureTest.cpp @@ -76,7 +76,8 @@ void TextureTest::construct1DNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } #endif @@ -86,7 +87,8 @@ void TextureTest::construct2DNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) @@ -96,7 +98,8 @@ void TextureTest::construct3DNoCreate() { CORRADE_COMPARE(texture.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } #endif diff --git a/src/Magnum/GL/Test/TimeQueryTest.cpp b/src/Magnum/GL/Test/TimeQueryTest.cpp index cce5fc1b8..05c72ce45 100644 --- a/src/Magnum/GL/Test/TimeQueryTest.cpp +++ b/src/Magnum/GL/Test/TimeQueryTest.cpp @@ -47,7 +47,8 @@ void TimeQueryTest::constructNoCreate() { CORRADE_COMPARE(query.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void TimeQueryTest::constructCopy() { diff --git a/src/Magnum/GL/Test/TransformFeedbackTest.cpp b/src/Magnum/GL/Test/TransformFeedbackTest.cpp index 2dae91fa3..cc7a33805 100644 --- a/src/Magnum/GL/Test/TransformFeedbackTest.cpp +++ b/src/Magnum/GL/Test/TransformFeedbackTest.cpp @@ -47,7 +47,8 @@ void TransformFeedbackTest::constructNoCreate() { CORRADE_COMPARE(xfb.id(), 0); } - CORRADE_VERIFY(true); + /* Implicit construction is not allowed */ + CORRADE_VERIFY(!(std::is_convertible::value)); } void TransformFeedbackTest::constructCopy() {