GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/unittests/resources/sdlimagehelper.cc Lines: 339 339 100.0 %
Date: 2018-09-09 Branches: 578 1454 39.8 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2014-2018  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
22
    const int rmask = 0x000000ff;
64
22
    const int gmask = 0x0000ff00;
65
22
    const int bmask = 0x00ff0000;
66
22
    const int amask = 0xff000000;
67
#endif  // SDL_BYTEORDER == SDL_BIG_ENDIAN
68
69











22
    return MSDL_CreateRGBSurface(SDL_SWSURFACE,
70
        width, height, 32, rmask, gmask, bmask, amask);
71
}
72
73
13
TEST_CASE("sdlimagehelper combineSurface", "")
74
{
75
11
    setEnv("SDL_VIDEODRIVER", "dummy");
76
77
11
    client = new Client;
78
33
    VirtFs::mountDirSilent("data", Append_false);
79
33
    VirtFs::mountDirSilent("../data", Append_false);
80
81
11
    mainGraphics = new SDLGraphics;
82
22
    imageHelper = new SDLImageHelper;
83
84
11
    Dirs::initRootDir();
85
11
    Dirs::initHomeDir();
86
87
11
    setBrandingDefaults(branding);
88
11
    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
11
    graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
97
#endif  // USE_SDL2
98
99
11
    userPalette = new UserPalette;
100
101
11
    theme = new Theme;
102
11
    Theme::selectSkin();
103
104
11
    ActorSprite::load();
105
106



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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


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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



4
        REQUIRE(ptr1[15] == 0xf0001020);
546
547
1
        MSDL_FreeSurface(surface1);
548
1
        MSDL_FreeSurface(surface2);
549
    }
550
551
11
    delete2(userPalette);
552
11
    delete2(theme);
553
11
    delete2(client);
554
33
    VirtFs::unmountDirSilent("data");
555
33
    VirtFs::unmountDirSilent("../data");
556

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