From 43397b8052155ccdaa956d07c32550a31324b8e4 Mon Sep 17 00:00:00 2001 From: Max Schwarz Date: Thu, 4 Apr 2019 13:55:21 +0200 Subject: [PATCH] GL: add unit test for Platform::GLContext{NoCreate, ...} --- src/Magnum/GL/Test/ContextGLTest.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Magnum/GL/Test/ContextGLTest.cpp b/src/Magnum/GL/Test/ContextGLTest.cpp index 63c234f0b..b91841b5d 100644 --- a/src/Magnum/GL/Test/ContextGLTest.cpp +++ b/src/Magnum/GL/Test/ContextGLTest.cpp @@ -29,11 +29,15 @@ #include "Magnum/GL/Extensions.h" #include "Magnum/GL/OpenGLTester.h" +#include "Magnum/Platform/GLContext.h" + namespace Magnum { namespace GL { namespace Test { namespace { struct ContextGLTest: OpenGLTester { explicit ContextGLTest(); + void constructNoCreate(); + void isVersionSupported(); #ifndef MAGNUM_TARGET_GLES void isVersionSupportedES(); @@ -44,7 +48,8 @@ struct ContextGLTest: OpenGLTester { }; ContextGLTest::ContextGLTest() { - addTests({&ContextGLTest::isVersionSupported, + addTests({&ContextGLTest::constructNoCreate, + &ContextGLTest::isVersionSupported, #ifndef MAGNUM_TARGET_GLES &ContextGLTest::isVersionSupportedES, #endif @@ -53,6 +58,16 @@ ContextGLTest::ContextGLTest() { &ContextGLTest::isExtensionDisabled}); } +void ContextGLTest::constructNoCreate() { + { + char dummyArgv[] = "dummy"; + char* argv[] = {dummyArgv}; + Platform::GLContext context{NoCreate, 1, argv}; + } + + CORRADE_VERIFY(true); +} + void ContextGLTest::isVersionSupported() { const Version v = Context::current().version(); CORRADE_VERIFY(Context::current().isVersionSupported(v));