Browse Source

GL: add unit test for Platform::GLContext{NoCreate, ...}

pull/331/head
Max Schwarz 7 years ago
parent
commit
43397b8052
  1. 17
      src/Magnum/GL/Test/ContextGLTest.cpp

17
src/Magnum/GL/Test/ContextGLTest.cpp

@ -29,11 +29,15 @@
#include "Magnum/GL/Extensions.h" #include "Magnum/GL/Extensions.h"
#include "Magnum/GL/OpenGLTester.h" #include "Magnum/GL/OpenGLTester.h"
#include "Magnum/Platform/GLContext.h"
namespace Magnum { namespace GL { namespace Test { namespace { namespace Magnum { namespace GL { namespace Test { namespace {
struct ContextGLTest: OpenGLTester { struct ContextGLTest: OpenGLTester {
explicit ContextGLTest(); explicit ContextGLTest();
void constructNoCreate();
void isVersionSupported(); void isVersionSupported();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
void isVersionSupportedES(); void isVersionSupportedES();
@ -44,7 +48,8 @@ struct ContextGLTest: OpenGLTester {
}; };
ContextGLTest::ContextGLTest() { ContextGLTest::ContextGLTest() {
addTests({&ContextGLTest::isVersionSupported, addTests({&ContextGLTest::constructNoCreate,
&ContextGLTest::isVersionSupported,
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
&ContextGLTest::isVersionSupportedES, &ContextGLTest::isVersionSupportedES,
#endif #endif
@ -53,6 +58,16 @@ ContextGLTest::ContextGLTest() {
&ContextGLTest::isExtensionDisabled}); &ContextGLTest::isExtensionDisabled});
} }
void ContextGLTest::constructNoCreate() {
{
char dummyArgv[] = "dummy";
char* argv[] = {dummyArgv};
Platform::GLContext context{NoCreate, 1, argv};
}
CORRADE_VERIFY(true);
}
void ContextGLTest::isVersionSupported() { void ContextGLTest::isVersionSupported() {
const Version v = Context::current().version(); const Version v = Context::current().version();
CORRADE_VERIFY(Context::current().isVersionSupported(v)); CORRADE_VERIFY(Context::current().isVersionSupported(v));

Loading…
Cancel
Save