GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/unittests/resources/sdlimagehelper.cc Lines: 339 339 100.0 %
Date: 2017-11-29 Branches: 582 1466 39.7 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2014-2017  The ManaPlus Developers
4
 *
5
 *  This file is part of The ManaPlus Client.
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
#ifndef USE_SDL2
22
#include "localconsts.h"
23
PRAGMA48(GCC diagnostic push)
24
PRAGMA48(GCC diagnostic ignored "-Wshadow")
25
#include <SDL_endian.h>
26
PRAGMA48(GCC diagnostic pop)
27
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
28
29
#include "unittests/unittests.h"
30
31
#include "client.h"
32
#include "configmanager.h"
33
#include "configuration.h"
34
#include "dirs.h"
35
#include "graphicsmanager.h"
36
37
#include "being/actorsprite.h"
38
39
#include "fs/virtfs/fs.h"
40
41
#include "gui/userpalette.h"
42
#include "gui/theme.h"
43
44
#include "utils/delete2.h"
45
#include "utils/env.h"
46
47
#include "render/sdlgraphics.h"
48
49
#include "resources/sdlimagehelper.h"
50
51
#include "debug.h"
52
53
static SDL_Surface *createSoftware32BitSurface(int width,
54
                                               int height)
55
{
56
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
57
    const int rmask = 0xff000000;
58
    const int gmask = 0x00ff0000;
59
    const int bmask = 0x0000ff00;
60
    const int amask = 0x000000ff;
61
#else  // SDL_BYTEORDER == SDL_BIG_ENDIAN
62
63
44
    const int rmask = 0x000000ff;
64
44
    const int gmask = 0x0000ff00;
65
44
    const int bmask = 0x00ff0000;
66
44
    const int amask = 0xff000000;
67
#endif  // SDL_BYTEORDER == SDL_BIG_ENDIAN
68
69











44
    return MSDL_CreateRGBSurface(SDL_SWSURFACE,
70
        width, height, 32, rmask, gmask, bmask, amask);
71
}
72
73
26
TEST_CASE("sdlimagehelper combineSurface", "")
74
{
75
22
    setEnv("SDL_VIDEODRIVER", "dummy");
76
77
22
    client = new Client;
78

88
    VirtFs::mountDirSilent("data", Append_false);
79

88
    VirtFs::mountDirSilent("../data", Append_false);
80
81
22
    mainGraphics = new SDLGraphics;
82
44
    imageHelper = new SDLImageHelper;
83
84
22
    Dirs::initRootDir();
85
22
    Dirs::initHomeDir();
86
87
22
    setBrandingDefaults(branding);
88
22
    ConfigManager::initConfiguration();
89
90
#ifdef USE_SDL2
91
    SDLImageHelper::setRenderer(graphicsManager.createRenderer(
92
        graphicsManager.createWindow(640, 480, 0,
93
        SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE));
94
#else  // USE_SDL2
95
96
22
    graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
97
#endif  // USE_SDL2
98
99
22
    userPalette = new UserPalette;
100
101
22
    theme = new Theme;
102
22
    Theme::selectSkin();
103
104
22
    ActorSprite::load();
105
106



154
    SECTION("empty copy1")
107
    {
108
2
        SDL_Surface *surface1 = createSoftware32BitSurface(2, 2);
109
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
110
10
        for (int f = 0; f < 2 * 2; f ++)
111
8
            ptr1[f] = 0xff000000;
112
2
        SDL_Surface *surface2 = createSoftware32BitSurface(2, 2);
113
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
114
115
2
        ptr2[0] = 0xff000000;
116
2
        ptr2[1] = 0x00ff0000;
117
2
        ptr2[2] = 0x0000ff00;
118
2
        ptr2[3] = 0x000000ff;
119
120
2
        SDLImageHelper::combineSurface(surface2,
121
            nullptr,
122
            surface1,
123
            nullptr);
124
125
        // src image test
126



8
        REQUIRE(ptr2[0] == 0xff000000);
127



8
        REQUIRE(ptr2[1] == 0x00ff0000);
128



8
        REQUIRE(ptr2[2] == 0x0000ff00);
129



8
        REQUIRE(ptr2[3] == 0x000000ff);
130
131



8
        REQUIRE(ptr1[0] == 0xff000000);
132



8
        REQUIRE(ptr1[1] == 0xff000000);
133



8
        REQUIRE(ptr1[2] == 0xff000000);
134



8
        REQUIRE(ptr1[3] == 0xff000000);
135
2
        MSDL_FreeSurface(surface1);
136
2
        MSDL_FreeSurface(surface2);
137
    }
138
139



132
    SECTION("empty copy2")
140
    {
141
2
        SDL_Surface *surface1 = createSoftware32BitSurface(2, 2);
142
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
143
10
        for (int f = 0; f < 2 * 2; f ++)
144
8
            ptr1[f] = 0xff000000;
145
2
        SDL_Surface *surface2 = createSoftware32BitSurface(2, 2);
146
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
147
148
2
        ptr2[0] = 0xff112233;
149
2
        ptr2[1] = 0xff003344;
150
2
        ptr2[2] = 0xff330055;
151
2
        ptr2[3] = 0xff445500;
152
153
2
        SDLImageHelper::combineSurface(surface2,
154
            nullptr,
155
            surface1,
156
            nullptr);
157
158



8
        REQUIRE(ptr1[0] == 0xff112233);
159



8
        REQUIRE(ptr1[1] == 0xff003344);
160



8
        REQUIRE(ptr1[2] == 0xff330055);
161



8
        REQUIRE(ptr1[3] == 0xff445500);
162
2
        MSDL_FreeSurface(surface1);
163
2
        MSDL_FreeSurface(surface2);
164
    }
165
166



154
    SECTION("empty copy3")
167
    {
168
2
        SDL_Surface *surface1 = createSoftware32BitSurface(2, 2);
169
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
170
10
        for (int f = 0; f < 2 * 2; f ++)
171
8
            ptr1[f] = 0x00000000;
172
2
        SDL_Surface *surface2 = createSoftware32BitSurface(2, 2);
173
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
174
175
2
        ptr2[0] = 0xff112233;
176
2
        ptr2[1] = 0xff003344;
177
2
        ptr2[2] = 0xff330055;
178
2
        ptr2[3] = 0xff445500;
179
180
2
        SDLImageHelper::combineSurface(surface2,
181
            nullptr,
182
            surface1,
183
            nullptr);
184
185



8
        REQUIRE(ptr1[0] == 0xff112233);
186



8
        REQUIRE(ptr1[1] == 0xff003344);
187



8
        REQUIRE(ptr1[2] == 0xff330055);
188



8
        REQUIRE(ptr1[3] == 0xff445500);
189
2
        MSDL_FreeSurface(surface1);
190
2
        MSDL_FreeSurface(surface2);
191
    }
192
193



154
    SECTION("empty copy4")
194
    {
195
2
        SDL_Surface *surface1 = createSoftware32BitSurface(2, 2);
196
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
197
10
        for (int f = 0; f < 2 * 2; f ++)
198
8
            ptr1[f] = 0xff000000;
199
2
        SDL_Surface *surface2 = createSoftware32BitSurface(2, 2);
200
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
201
202
2
        ptr2[0] = 0x50112233;
203
2
        ptr2[1] = 0x50003344;
204
2
        ptr2[2] = 0x50330055;
205
2
        ptr2[3] = 0x50445500;
206
207
2
        SDLImageHelper::combineSurface(surface2,
208
            nullptr,
209
            surface1,
210
            nullptr);
211
212



8
        REQUIRE(ptr1[0] == 0xff09121c);
213



8
        REQUIRE(ptr1[1] == 0xff001c25);
214



8
        REQUIRE(ptr1[2] == 0xff1c002f);
215



8
        REQUIRE(ptr1[3] == 0xff252f00);
216
2
        MSDL_FreeSurface(surface1);
217
2
        MSDL_FreeSurface(surface2);
218
    }
219
220



154
    SECTION("empty copy5")
221
    {
222
2
        SDL_Surface *surface1 = createSoftware32BitSurface(2, 2);
223
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
224
10
        for (int f = 0; f < 2 * 2; f ++)
225
8
            ptr1[f] = 0x00000000;
226
2
        SDL_Surface *surface2 = createSoftware32BitSurface(2, 2);
227
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
228
229
2
        ptr2[0] = 0x50112233;
230
2
        ptr2[1] = 0x50003344;
231
2
        ptr2[2] = 0x50330055;
232
2
        ptr2[3] = 0x50445500;
233
234
2
        SDLImageHelper::combineSurface(surface2,
235
            nullptr,
236
            surface1,
237
            nullptr);
238
239



8
        REQUIRE(ptr1[0] == 0x8e09121c);
240



8
        REQUIRE(ptr1[1] == 0x8e001c25);
241



8
        REQUIRE(ptr1[2] == 0x8e1c002f);
242



8
        REQUIRE(ptr1[3] == 0x8e252f00);
243
2
        MSDL_FreeSurface(surface1);
244
2
        MSDL_FreeSurface(surface2);
245
    }
246
247



154
    SECTION("empty copy6")
248
    {
249
2
        SDL_Surface *surface1 = createSoftware32BitSurface(2, 2);
250
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
251
2
        ptr1[0] = 0x50112233;
252
2
        ptr1[1] = 0x50003344;
253
2
        ptr1[2] = 0x50330055;
254
2
        ptr1[3] = 0x50445500;
255
2
        SDL_Surface *surface2 = createSoftware32BitSurface(2, 2);
256
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
257
258
10
        for (int f = 0; f < 2 * 2; f ++)
259
8
            ptr2[f] = 0x00000000;
260
261
2
        SDLImageHelper::combineSurface(surface2,
262
            nullptr,
263
            surface1,
264
            nullptr);
265
266



8
        REQUIRE(ptr1[0] == 0x50112233);
267



8
        REQUIRE(ptr1[1] == 0x50003344);
268



8
        REQUIRE(ptr1[2] == 0x50330055);
269



8
        REQUIRE(ptr1[3] == 0x50445500);
270
2
        MSDL_FreeSurface(surface1);
271
2
        MSDL_FreeSurface(surface2);
272
    }
273
274



154
    SECTION("mix 1")
275
    {
276
2
        SDL_Surface *surface1 = createSoftware32BitSurface(2, 2);
277
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
278
2
        ptr1[0] = 0x50112233;
279
2
        ptr1[1] = 0x50003344;
280
2
        ptr1[2] = 0x50330055;
281
2
        ptr1[3] = 0x50445500;
282
2
        SDL_Surface *surface2 = createSoftware32BitSurface(2, 2);
283
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
284
285
2
        ptr2[0] = 0x50003344;
286
2
        ptr2[1] = 0x50330055;
287
2
        ptr2[2] = 0x50445500;
288
2
        ptr2[3] = 0x50112233;
289
290
2
        SDLImageHelper::combineSurface(surface2,
291
            nullptr,
292
            surface1,
293
            nullptr);
294
295



8
        REQUIRE(ptr1[0] == 0xdf082b3c);
296



8
        REQUIRE(ptr1[1] == 0xdf1d174d);
297



8
        REQUIRE(ptr1[2] == 0xdf3d2f26);
298



8
        REQUIRE(ptr1[3] == 0xdf29391c);
299
2
        MSDL_FreeSurface(surface1);
300
2
        MSDL_FreeSurface(surface2);
301
    }
302
303



154
    SECTION("mix 2")
304
    {
305
2
        SDL_Surface *surface1 = createSoftware32BitSurface(2, 2);
306
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
307
2
        ptr1[0] = 0x10112233;
308
2
        ptr1[1] = 0x20003344;
309
2
        ptr1[2] = 0x30330055;
310
2
        ptr1[3] = 0x40445500;
311
2
        SDL_Surface *surface2 = createSoftware32BitSurface(2, 2);
312
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
313
314
2
        ptr2[0] = 0x50003344;
315
2
        ptr2[1] = 0x60330055;
316
2
        ptr2[2] = 0x70445500;
317
2
        ptr2[3] = 0x80112233;
318
319
2
        SDLImageHelper::combineSurface(surface2,
320
            nullptr,
321
            surface1,
322
            nullptr);
323
324



8
        REQUIRE(ptr1[0] == 0x9f082b3c);
325



8
        REQUIRE(ptr1[1] == 0xbd1f144e);
326



8
        REQUIRE(ptr1[2] == 0xb93f391e);
327



8
        REQUIRE(ptr1[3] == 0xf5213224);
328
2
        MSDL_FreeSurface(surface1);
329
2
        MSDL_FreeSurface(surface2);
330
    }
331
332



154
    SECTION("part mix 1")
333
    {
334
// 11 11 00 00
335
// 11 11 00 00
336
// 00 00 00 00
337
// 00 00 00 00
338
339
2
        SDL_Surface *surface1 = createSoftware32BitSurface(4, 4);
340
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
341
2
        ptr1[0] = 0x10112233;
342
2
        ptr1[1] = 0x20003344;
343
2
        ptr1[2] = 0x10203040;
344
2
        ptr1[3] = 0x20304050;
345
2
        ptr1[4] = 0x30330055;
346
2
        ptr1[5] = 0x40445500;
347
2
        ptr1[6] = 0x30405060;
348
2
        ptr1[7] = 0x708090a0;
349
350
2
        ptr1[8] = 0x8090a0b0;
351
2
        ptr1[9] = 0x90a0b0c0;
352
2
        ptr1[10] = 0xa0b0c0d0;
353
2
        ptr1[11] = 0xb0c0d0e0;
354
2
        ptr1[12] = 0xc0d0e0f0;
355
2
        ptr1[13] = 0xd0e0f000;
356
2
        ptr1[14] = 0xe0f00010;
357
2
        ptr1[15] = 0xf0001020;
358
359
2
        SDL_Surface *surface2 = createSoftware32BitSurface(2, 2);
360
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
361
362
2
        ptr2[0] = 0x50003344;
363
2
        ptr2[1] = 0x60330055;
364
2
        ptr2[2] = 0x70445500;
365
2
        ptr2[3] = 0x80112233;
366
367
2
        SDLImageHelper::combineSurface(surface2,
368
            nullptr,
369
            surface1,
370
            nullptr);
371
372



8
        REQUIRE(ptr1[0] == 0x9f082b3c);
373



8
        REQUIRE(ptr1[1] == 0xbd1f144e);
374



8
        REQUIRE(ptr1[2] == 0x10203040);
375



8
        REQUIRE(ptr1[3] == 0x20304050);
376



8
        REQUIRE(ptr1[4] == 0xb93f391e);
377



8
        REQUIRE(ptr1[5] == 0xf5213224);
378



8
        REQUIRE(ptr1[6] == 0x30405060);
379



8
        REQUIRE(ptr1[7] == 0x708090a0);
380
381



8
        REQUIRE(ptr1[8] == 0x8090a0b0);
382



8
        REQUIRE(ptr1[9] == 0x90a0b0c0);
383



8
        REQUIRE(ptr1[10] == 0xa0b0c0d0);
384



6
        REQUIRE(ptr1[11] == 0xb0c0d0e0);
385



8
        REQUIRE(ptr1[12] == 0xc0d0e0f0);
386



8
        REQUIRE(ptr1[13] == 0xd0e0f000);
387



8
        REQUIRE(ptr1[14] == 0xe0f00010);
388



8
        REQUIRE(ptr1[15] == 0xf0001020);
389
390
2
        MSDL_FreeSurface(surface1);
391
2
        MSDL_FreeSurface(surface2);
392
    }
393
394



154
    SECTION("part mix 2")
395
    {
396
// 00 00 00 00
397
// 00 11 11 00
398
// 00 11 11 00
399
// 00 00 00 00
400
401
2
        SDL_Surface *surface1 = createSoftware32BitSurface(4, 4);
402
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
403
404
2
        ptr1[0] = 0x10203040;
405
2
        ptr1[1] = 0x20304050;
406
2
        ptr1[2] = 0x30405060;
407
2
        ptr1[3] = 0x708090a0;
408
2
        ptr1[4] = 0x8090a0b0;
409
410
2
        ptr1[5] = 0x10112233;  // +
411
2
        ptr1[6] = 0x20003344;  // +
412
413
2
        ptr1[7] = 0x90a0b0c0;
414
2
        ptr1[8] = 0xa0b0c0d0;
415
416
2
        ptr1[9] = 0x30330055;  // +
417
2
        ptr1[10] = 0x40445500;  // +
418
419
2
        ptr1[11] = 0xb0c0d0e0;
420
2
        ptr1[12] = 0xc0d0e0f0;
421
2
        ptr1[13] = 0xd0e0f000;
422
2
        ptr1[14] = 0xe0f00010;
423
2
        ptr1[15] = 0xf0001020;
424
425
2
        SDL_Surface *surface2 = createSoftware32BitSurface(2, 2);
426
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
427
428
2
        ptr2[0] = 0x50003344;
429
2
        ptr2[1] = 0x60330055;
430
2
        ptr2[2] = 0x70445500;
431
2
        ptr2[3] = 0x80112233;
432
433
        SDL_Rect rect1;
434
        SDL_Rect rect2;
435
2
        rect1.x = 1;
436
2
        rect1.y = 1;
437
2
        rect1.w = 2;
438
2
        rect1.h = 2;
439
2
        rect2.x = 0;
440
2
        rect2.y = 0;
441
2
        rect2.w = 2;
442
2
        rect2.h = 2;
443
2
        SDLImageHelper::combineSurface(surface2,
444
            &rect2,
445
            surface1,
446
            &rect1);
447
448



8
        REQUIRE(ptr1[0] == 0x10203040);
449



8
        REQUIRE(ptr1[1] == 0x20304050);
450



8
        REQUIRE(ptr1[2] == 0x30405060);
451



8
        REQUIRE(ptr1[3] == 0x708090a0);
452



8
        REQUIRE(ptr1[4] == 0x8090a0b0);
453
454



8
        REQUIRE(ptr1[5] == 0x9f082b3c);  // +
455



8
        REQUIRE(ptr1[6] == 0xbd1f144e);  // +
456
457



8
        REQUIRE(ptr1[7] == 0x90a0b0c0);
458



8
        REQUIRE(ptr1[8] == 0xa0b0c0d0);
459
460



8
        REQUIRE(ptr1[9] == 0xb93f391e);  // +
461



8
        REQUIRE(ptr1[10] == 0xf5213224);  // +
462
463



8
        REQUIRE(ptr1[11] == 0xb0c0d0e0);
464



8
        REQUIRE(ptr1[12] == 0xc0d0e0f0);
465



8
        REQUIRE(ptr1[13] == 0xd0e0f000);
466



8
        REQUIRE(ptr1[14] == 0xe0f00010);
467



8
        REQUIRE(ptr1[15] == 0xf0001020);
468
469
2
        MSDL_FreeSurface(surface1);
470
2
        MSDL_FreeSurface(surface2);
471
    }
472
473



154
    SECTION("part mix 3")
474
    {
475
2
        SDL_Surface *surface1 = createSoftware32BitSurface(4, 4);
476
2
        uint32_t *ptr1 = static_cast<uint32_t*>(surface1->pixels);
477
478
2
        ptr1[0] = 0x10203040;
479
2
        ptr1[1] = 0x20304050;
480
2
        ptr1[2] = 0x30405060;
481
2
        ptr1[3] = 0x708090a0;
482
2
        ptr1[4] = 0x8090a0b0;
483
2
        ptr1[5] = 0x10112233;
484
2
        ptr1[6] = 0x20003344;
485
2
        ptr1[7] = 0x90a0b0c0;
486
2
        ptr1[8] = 0xa0b0c0d0;
487
2
        ptr1[9] = 0x30330055;
488
2
        ptr1[10] = 0x40445500;
489
2
        ptr1[11] = 0xb0c0d0e0;
490
2
        ptr1[12] = 0xc0d0e0f0;
491
2
        ptr1[13] = 0xd0e0f000;
492
2
        ptr1[14] = 0xe0f00010;
493
2
        ptr1[15] = 0xf0001020;
494
495
2
        SDL_Surface *surface2 = createSoftware32BitSurface(4, 4);
496
2
        uint32_t *ptr2 = static_cast<uint32_t*>(surface2->pixels);
497
498
2
        ptr2[0] = 0x50003344;
499
2
        ptr2[1] = 0x60330055;
500
2
        ptr2[2] = 0x70445500;
501
2
        ptr2[3] = 0x80112233;
502
2
        ptr2[4] = 0x90111111;
503
2
        ptr2[5] = 0x90111111;
504
2
        ptr2[6] = 0xff000000;
505
2
        ptr2[7] = 0xff000000;
506
2
        ptr2[8] = 0xff000000;
507
2
        ptr2[9] = 0xff000000;
508
2
        ptr2[10] = 0xff000000;
509
2
        ptr2[11] = 0xff000000;
510
2
        ptr2[12] = 0xff000000;
511
2
        ptr2[13] = 0xff000000;
512
2
        ptr2[14] = 0xff000000;
513
2
        ptr2[15] = 0xff000000;
514
515
        SDL_Rect rect1;
516
        SDL_Rect rect2;
517
2
        rect1.x = 1;
518
2
        rect1.y = 1;
519
2
        rect1.w = 2;
520
2
        rect1.h = 2;
521
2
        rect2.x = 0;
522
2
        rect2.y = 0;
523
2
        rect2.w = 2;
524
2
        rect2.h = 2;
525
2
        SDLImageHelper::combineSurface(surface2,
526
            &rect2,
527
            surface1,
528
            &rect1);
529
530



8
        REQUIRE(ptr1[0] == 0x10203040);
531



8
        REQUIRE(ptr1[1] == 0x20304050);
532



8
        REQUIRE(ptr1[2] == 0x30405060);
533



8
        REQUIRE(ptr1[3] == 0x708090a0);
534



8
        REQUIRE(ptr1[4] == 0x8090a0b0);
535



8
        REQUIRE(ptr1[5] == 0x9f082b3c);
536



8
        REQUIRE(ptr1[6] == 0xbd1f144e);
537



8
        REQUIRE(ptr1[7] == 0x90a0b0c0);
538



8
        REQUIRE(ptr1[8] == 0xa0b0c0d0);
539



8
        REQUIRE(ptr1[9] == 0xbf1b0d23);
540



8
        REQUIRE(ptr1[10] == 0xff1f230c);
541



8
        REQUIRE(ptr1[11] == 0xb0c0d0e0);
542



8
        REQUIRE(ptr1[12] == 0xc0d0e0f0);
543



8
        REQUIRE(ptr1[13] == 0xd0e0f000);
544



8
        REQUIRE(ptr1[14] == 0xe0f00010);
545



8
        REQUIRE(ptr1[15] == 0xf0001020);
546
547
2
        MSDL_FreeSurface(surface1);
548
2
        MSDL_FreeSurface(surface2);
549
    }
550
551
22
    delete2(userPalette);
552
22
    delete2(theme);
553
22
    delete2(client);
554

88
    VirtFs::unmountDirSilent("data");
555

88
    VirtFs::unmountDirSilent("../data");
556

28
}
557
558
#endif  // SDL_BYTEORDER == SDL_LIL_ENDIAN
559
#endif  // USE_SDL2