@ -45,22 +45,28 @@ namespace Magnum { namespace Text { namespace Test { namespace {
struct GlyphCacheGLTest : GL : : OpenGLTester {
struct GlyphCacheGLTest : GL : : OpenGLTester {
explicit GlyphCacheGLTest ( ) ;
explicit GlyphCacheGLTest ( ) ;
void initialize ( ) ;
void construct ( ) ;
void initializeCustomFormat ( ) ;
void constructCustomFormat ( ) ;
void constructCopy ( ) ;
void constructMove ( ) ;
void setImage ( ) ;
void setImage ( ) ;
void setImageCustomFormat ( ) ;
void setImageCustomFormat ( ) ;
} ;
} ;
GlyphCacheGLTest : : GlyphCacheGLTest ( ) {
GlyphCacheGLTest : : GlyphCacheGLTest ( ) {
addTests ( { & GlyphCacheGLTest : : initialize ,
addTests ( { & GlyphCacheGLTest : : construct ,
& GlyphCacheGLTest : : initializeCustomFormat ,
& GlyphCacheGLTest : : constructCustomFormat ,
& GlyphCacheGLTest : : constructCopy ,
& GlyphCacheGLTest : : constructMove ,
& GlyphCacheGLTest : : setImage ,
& GlyphCacheGLTest : : setImage ,
& GlyphCacheGLTest : : setImageCustomFormat } ) ;
& GlyphCacheGLTest : : setImageCustomFormat } ) ;
}
}
void GlyphCacheGLTest : : initialize ( ) {
void GlyphCacheGLTest : : construct ( ) {
GlyphCache cache { { 1024 , 2048 } } ;
GlyphCache cache { { 1024 , 2048 } } ;
MAGNUM_VERIFY_NO_GL_ERROR ( ) ;
MAGNUM_VERIFY_NO_GL_ERROR ( ) ;
@ -70,7 +76,7 @@ void GlyphCacheGLTest::initialize() {
# endif
# endif
}
}
void GlyphCacheGLTest : : initialize CustomFormat( ) {
void GlyphCacheGLTest : : construct CustomFormat( ) {
GlyphCache cache {
GlyphCache cache {
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
GL : : TextureFormat : : RGBA8 ,
GL : : TextureFormat : : RGBA8 ,
@ -86,6 +92,25 @@ void GlyphCacheGLTest::initializeCustomFormat() {
# endif
# endif
}
}
void GlyphCacheGLTest : : constructCopy ( ) {
CORRADE_VERIFY ( ! std : : is_copy_constructible < GlyphCache > { } ) ;
CORRADE_VERIFY ( ! std : : is_copy_assignable < GlyphCache > { } ) ;
}
void GlyphCacheGLTest : : constructMove ( ) {
GlyphCache a { { 1024 , 512 } } ;
GlyphCache b = Utility : : move ( a ) ;
CORRADE_COMPARE ( b . size ( ) , ( Vector3i { 1024 , 512 , 1 } ) ) ;
GlyphCache c { { 2 , 3 } } ;
c = Utility : : move ( b ) ;
CORRADE_COMPARE ( c . size ( ) , ( Vector3i { 1024 , 512 , 1 } ) ) ;
CORRADE_VERIFY ( std : : is_nothrow_move_constructible < GlyphCache > : : value ) ;
CORRADE_VERIFY ( std : : is_nothrow_move_assignable < GlyphCache > : : value ) ;
}
const UnsignedByte InputData [ ] {
const UnsignedByte InputData [ ] {
0x00 , 0x11 , 0x22 , 0x33 , 0x44 , 0x55 , 0x66 , 0x77 ,
0x00 , 0x11 , 0x22 , 0x33 , 0x44 , 0x55 , 0x66 , 0x77 ,
0x88 , 0x99 , 0xaa , 0xbb , 0xcc , 0xdd , 0xee , 0xff ,
0x88 , 0x99 , 0xaa , 0xbb , 0xcc , 0xdd , 0xee , 0xff ,