Browse Source

Test that Context is only move-constructible.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
e6965e7131
  1. 14
      src/Magnum/Test/ContextGLTest.cpp

14
src/Magnum/Test/ContextGLTest.cpp

@ -32,6 +32,8 @@ namespace Magnum { namespace Test {
struct ContextGLTest: AbstractOpenGLTester {
explicit ContextGLTest();
void constructCopyMove();
void isVersionSupported();
void supportedVersion();
void isExtensionSupported();
@ -39,12 +41,22 @@ struct ContextGLTest: AbstractOpenGLTester {
};
ContextGLTest::ContextGLTest() {
addTests({&ContextGLTest::isVersionSupported,
addTests({&ContextGLTest::constructCopyMove,
&ContextGLTest::isVersionSupported,
&ContextGLTest::supportedVersion,
&ContextGLTest::isExtensionSupported,
&ContextGLTest::isExtensionDisabled});
}
void ContextGLTest::constructCopyMove() {
/* Only move-construction allowed */
CORRADE_VERIFY(!(std::is_constructible<Context, const Context&>{}));
CORRADE_VERIFY((std::is_constructible<Context, Context&&>{}));
CORRADE_VERIFY(!(std::is_assignable<Context, const Context&>{}));
CORRADE_VERIFY(!(std::is_assignable<Context, Context&&>{}));
}
void ContextGLTest::isVersionSupported() {
const Version v = Context::current()->version();
CORRADE_VERIFY(Context::current()->isVersionSupported(v));

Loading…
Cancel
Save