GCC Code Coverage Report


Directory: src/gate/
File: src/gate/graphics/tests/gategraphics_cpp_test/test_images.cpp
Date: 2026-02-03 22:06:38
Exec Total Coverage
Lines: 98 98 100.0%
Functions: 14 14 100.0%
Branches: 206 624 33.0%

Line Branch Exec Source
1 #include "gate/tests.hpp"
2 #include "gate/graphics/images.hpp"
3 #include "gate/graphics/drawing.hpp"
4 #include "gate/graphics/imageformats.hpp"
5 #include "gate/graphics/pixmapimages.hpp"
6 #include "gate/graphics/bitmapimages.hpp"
7 #include "gate/graphics/gifimages.hpp"
8 #include "gate/graphics/jpegimages.hpp"
9 #include "gate/graphics/pngimages.hpp"
10
11 using namespace gate;
12 using namespace gate::graph;
13
14
2/7
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
6 GATEXX_TEST_UNIT(Images)
15 {
16
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage emptyImage;
17
5/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
2 GATEXX_TEST_CHECK(!emptyImage == true);
18
19
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage image(64, 64);
20
5/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
2 GATEXX_TEST_CHECK(image.c_impl() != NULL);
21
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(image.getPixelFormat());
22
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(image.clear(Color::Black));
23
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(image.setPixel(32, 32, Color::White));
24
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(image.getPixel(32, 32));
25
5/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
2 GATEXX_TEST_CHECK(image.getPixelPtr(32, 32) != NULL);
26
27
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 Drawer d(image);
28
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(d.line(0, 0, 32, 16, Color::White));
29
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(d.rectangle(0, 0, 32, 16, Color::White));
30
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(d.box(48, 16, 54, 32, Color::White));
31
32
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage image2 = image.flipX();
33
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage image3 = image.flipY();
34
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage image4 = image.rollOver();
35
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage image5 = image.rotateLeft();
36
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage image6 = image.rotateRight();
37
38
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_argb4, image));
39
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_bgr24, image));
40
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_bgr32, image));
41
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_bgra, image));
42
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_gray8, image));
43
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_pal8, image));
44
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_rgb24, image));
45
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_rgb32, image));
46
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_rgb555, image));
47
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_rgb565, image));
48
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_rgba, image));
49
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(RasterImage(RasterImage::PixelFormat_yuv2, image));
50
51
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 RasterImage dup(image.c_impl());
52
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(dup.makeGrayscale());
53
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(dup.makeMonochrome());
54
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage frame(128, 128);
55
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
2 frame.clear(Color(128, 128, 128, 128));
56
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(frame.paste(image, 32, 32, 0, 0, 64, 64, true));
57
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage subset;
58
5/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(subset = frame.subset(32, 32, 64, 64));
59
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage original(64, 64);
60
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(original.resampleFrom(subset));
61
62 2 }
63
64
65 5 static void checkImageFormats(RasterImage const& sourceImage, ImageFormats::FormatEnum format)
66 {
67
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
10 MemStream stream;
68
4/14
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 5 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
5 GATEXX_TEST_CHECK_NOTHROW(ImageFormats::save(sourceImage, format, stream, 0));
69
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
10 RasterImage newImage = ImageFormats::load(format, stream, 0);
70
6/16
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 5 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 5 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 5 times.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
5 GATEXX_TEST_CHECK_EQUAL(newImage.getWidth(), sourceImage.getWidth());
71
6/16
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 5 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 5 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 5 times.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
5 GATEXX_TEST_CHECK_EQUAL(newImage.getHeight(), sourceImage.getHeight());
72 5 }
73
74
2/7
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
6 GATEXX_TEST_UNIT(ImageFormats)
75 {
76 2 unsigned dim = 128;
77
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage image(dim, dim);
78
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 image.clear(Color::Blue);
79
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 Drawer d(image);
80
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 d.line(0, 0, dim - 1, dim - 1, Color::Yellow);
81
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 d.rectangle(0, 0, dim - 1, dim - 1, Color::Green);
82
83
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 checkImageFormats(image, ImageFormats::Format_Bitmap);
84
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 checkImageFormats(image, ImageFormats::Format_Gif);
85
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 checkImageFormats(image, ImageFormats::Format_Jpeg);
86
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 checkImageFormats(image, ImageFormats::Format_Pixmap);
87
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 checkImageFormats(image, ImageFormats::Format_Png);
88 2 }
89
90 5 static void checkLoaderSaver(RasterImage const& sourceImage, ImageFormats::SaverFunction saver, ImageFormats::LoaderFunction loader)
91 {
92
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
10 MemStream stream;
93
4/14
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 5 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
5 GATEXX_TEST_CHECK_NOTHROW(saver(sourceImage, stream, 0));
94
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
10 RasterImage newImage;
95
4/14
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 5 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
5 GATEXX_TEST_CHECK_NOTHROW(loader(newImage, stream, 0));
96 5 }
97
98
2/7
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
6 GATEXX_TEST_UNIT(ImageFormatsDirect)
99 {
100 2 unsigned dim = 128;
101
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage image(dim, dim);
102
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 image.clear(Color::Blue);
103
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 Drawer d(image);
104
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 d.line(0, 0, dim - 1, dim - 1, Color::Yellow);
105
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 d.rectangle(0, 0, dim - 1, dim - 1, Color::Green);
106
107
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 checkLoaderSaver(image, &PixmapImages::save, &PixmapImages::load);
108
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 checkLoaderSaver(image, &BitmapImages::save, &BitmapImages::load);
109
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 checkLoaderSaver(image, &JpegImages::save, &JpegImages::load);
110
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 checkLoaderSaver(image, &PngImages::save, &PngImages::load);
111
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 checkLoaderSaver(image, &GifImages::save, &GifImages::load);
112 2 }
113
114 static const uint8_t icon256[2102] = {
115 0x42, 0x4d, 0x36, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x04, 0x00, 0x00, 0x28, 0x00,
116 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00,
117 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xc4, 0x0e, 0x00, 0x00, 0xc4, 0x0e, 0x00, 0x00, 0x00, 0x00,
118 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,
119 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x80,
120 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0x00, 0xc0, 0xdc, 0xc0, 0x00, 0xf0, 0xca, 0xa6, 0x00, 0x00, 0x20,
121 0x40, 0x00, 0x00, 0x20, 0x60, 0x00, 0x00, 0x20, 0x80, 0x00, 0x00, 0x20, 0xa0, 0x00, 0x00, 0x20,
122 0xc0, 0x00, 0x00, 0x20, 0xe0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x20, 0x00, 0x00, 0x40,
123 0x40, 0x00, 0x00, 0x40, 0x60, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x40, 0xa0, 0x00, 0x00, 0x40,
124 0xc0, 0x00, 0x00, 0x40, 0xe0, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x20, 0x00, 0x00, 0x60,
125 0x40, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x80, 0x00, 0x00, 0x60, 0xa0, 0x00, 0x00, 0x60,
126 0xc0, 0x00, 0x00, 0x60, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0x80,
127 0x40, 0x00, 0x00, 0x80, 0x60, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xa0, 0x00, 0x00, 0x80,
128 0xc0, 0x00, 0x00, 0x80, 0xe0, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xa0, 0x20, 0x00, 0x00, 0xa0,
129 0x40, 0x00, 0x00, 0xa0, 0x60, 0x00, 0x00, 0xa0, 0x80, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x00, 0xa0,
130 0xc0, 0x00, 0x00, 0xa0, 0xe0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x00, 0x00, 0xc0,
131 0x40, 0x00, 0x00, 0xc0, 0x60, 0x00, 0x00, 0xc0, 0x80, 0x00, 0x00, 0xc0, 0xa0, 0x00, 0x00, 0xc0,
132 0xc0, 0x00, 0x00, 0xc0, 0xe0, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0x20, 0x00, 0x00, 0xe0,
133 0x40, 0x00, 0x00, 0xe0, 0x60, 0x00, 0x00, 0xe0, 0x80, 0x00, 0x00, 0xe0, 0xa0, 0x00, 0x00, 0xe0,
134 0xc0, 0x00, 0x00, 0xe0, 0xe0, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x20, 0x00, 0x40, 0x00,
135 0x40, 0x00, 0x40, 0x00, 0x60, 0x00, 0x40, 0x00, 0x80, 0x00, 0x40, 0x00, 0xa0, 0x00, 0x40, 0x00,
136 0xc0, 0x00, 0x40, 0x00, 0xe0, 0x00, 0x40, 0x20, 0x00, 0x00, 0x40, 0x20, 0x20, 0x00, 0x40, 0x20,
137 0x40, 0x00, 0x40, 0x20, 0x60, 0x00, 0x40, 0x20, 0x80, 0x00, 0x40, 0x20, 0xa0, 0x00, 0x40, 0x20,
138 0xc0, 0x00, 0x40, 0x20, 0xe0, 0x00, 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x20, 0x00, 0x40, 0x40,
139 0x40, 0x00, 0x40, 0x40, 0x60, 0x00, 0x40, 0x40, 0x80, 0x00, 0x40, 0x40, 0xa0, 0x00, 0x40, 0x40,
140 0xc0, 0x00, 0x40, 0x40, 0xe0, 0x00, 0x40, 0x60, 0x00, 0x00, 0x40, 0x60, 0x20, 0x00, 0x40, 0x60,
141 0x40, 0x00, 0x40, 0x60, 0x60, 0x00, 0x40, 0x60, 0x80, 0x00, 0x40, 0x60, 0xa0, 0x00, 0x40, 0x60,
142 0xc0, 0x00, 0x40, 0x60, 0xe0, 0x00, 0x40, 0x80, 0x00, 0x00, 0x40, 0x80, 0x20, 0x00, 0x40, 0x80,
143 0x40, 0x00, 0x40, 0x80, 0x60, 0x00, 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0xa0, 0x00, 0x40, 0x80,
144 0xc0, 0x00, 0x40, 0x80, 0xe0, 0x00, 0x40, 0xa0, 0x00, 0x00, 0x40, 0xa0, 0x20, 0x00, 0x40, 0xa0,
145 0x40, 0x00, 0x40, 0xa0, 0x60, 0x00, 0x40, 0xa0, 0x80, 0x00, 0x40, 0xa0, 0xa0, 0x00, 0x40, 0xa0,
146 0xc0, 0x00, 0x40, 0xa0, 0xe0, 0x00, 0x40, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x20, 0x00, 0x40, 0xc0,
147 0x40, 0x00, 0x40, 0xc0, 0x60, 0x00, 0x40, 0xc0, 0x80, 0x00, 0x40, 0xc0, 0xa0, 0x00, 0x40, 0xc0,
148 0xc0, 0x00, 0x40, 0xc0, 0xe0, 0x00, 0x40, 0xe0, 0x00, 0x00, 0x40, 0xe0, 0x20, 0x00, 0x40, 0xe0,
149 0x40, 0x00, 0x40, 0xe0, 0x60, 0x00, 0x40, 0xe0, 0x80, 0x00, 0x40, 0xe0, 0xa0, 0x00, 0x40, 0xe0,
150 0xc0, 0x00, 0x40, 0xe0, 0xe0, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x00,
151 0x40, 0x00, 0x80, 0x00, 0x60, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xa0, 0x00, 0x80, 0x00,
152 0xc0, 0x00, 0x80, 0x00, 0xe0, 0x00, 0x80, 0x20, 0x00, 0x00, 0x80, 0x20, 0x20, 0x00, 0x80, 0x20,
153 0x40, 0x00, 0x80, 0x20, 0x60, 0x00, 0x80, 0x20, 0x80, 0x00, 0x80, 0x20, 0xa0, 0x00, 0x80, 0x20,
154 0xc0, 0x00, 0x80, 0x20, 0xe0, 0x00, 0x80, 0x40, 0x00, 0x00, 0x80, 0x40, 0x20, 0x00, 0x80, 0x40,
155 0x40, 0x00, 0x80, 0x40, 0x60, 0x00, 0x80, 0x40, 0x80, 0x00, 0x80, 0x40, 0xa0, 0x00, 0x80, 0x40,
156 0xc0, 0x00, 0x80, 0x40, 0xe0, 0x00, 0x80, 0x60, 0x00, 0x00, 0x80, 0x60, 0x20, 0x00, 0x80, 0x60,
157 0x40, 0x00, 0x80, 0x60, 0x60, 0x00, 0x80, 0x60, 0x80, 0x00, 0x80, 0x60, 0xa0, 0x00, 0x80, 0x60,
158 0xc0, 0x00, 0x80, 0x60, 0xe0, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x20, 0x00, 0x80, 0x80,
159 0x40, 0x00, 0x80, 0x80, 0x60, 0x00, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0xa0, 0x00, 0x80, 0x80,
160 0xc0, 0x00, 0x80, 0x80, 0xe0, 0x00, 0x80, 0xa0, 0x00, 0x00, 0x80, 0xa0, 0x20, 0x00, 0x80, 0xa0,
161 0x40, 0x00, 0x80, 0xa0, 0x60, 0x00, 0x80, 0xa0, 0x80, 0x00, 0x80, 0xa0, 0xa0, 0x00, 0x80, 0xa0,
162 0xc0, 0x00, 0x80, 0xa0, 0xe0, 0x00, 0x80, 0xc0, 0x00, 0x00, 0x80, 0xc0, 0x20, 0x00, 0x80, 0xc0,
163 0x40, 0x00, 0x80, 0xc0, 0x60, 0x00, 0x80, 0xc0, 0x80, 0x00, 0x80, 0xc0, 0xa0, 0x00, 0x80, 0xc0,
164 0xc0, 0x00, 0x80, 0xc0, 0xe0, 0x00, 0x80, 0xe0, 0x00, 0x00, 0x80, 0xe0, 0x20, 0x00, 0x80, 0xe0,
165 0x40, 0x00, 0x80, 0xe0, 0x60, 0x00, 0x80, 0xe0, 0x80, 0x00, 0x80, 0xe0, 0xa0, 0x00, 0x80, 0xe0,
166 0xc0, 0x00, 0x80, 0xe0, 0xe0, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x20, 0x00, 0xc0, 0x00,
167 0x40, 0x00, 0xc0, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x80, 0x00, 0xc0, 0x00, 0xa0, 0x00, 0xc0, 0x00,
168 0xc0, 0x00, 0xc0, 0x00, 0xe0, 0x00, 0xc0, 0x20, 0x00, 0x00, 0xc0, 0x20, 0x20, 0x00, 0xc0, 0x20,
169 0x40, 0x00, 0xc0, 0x20, 0x60, 0x00, 0xc0, 0x20, 0x80, 0x00, 0xc0, 0x20, 0xa0, 0x00, 0xc0, 0x20,
170 0xc0, 0x00, 0xc0, 0x20, 0xe0, 0x00, 0xc0, 0x40, 0x00, 0x00, 0xc0, 0x40, 0x20, 0x00, 0xc0, 0x40,
171 0x40, 0x00, 0xc0, 0x40, 0x60, 0x00, 0xc0, 0x40, 0x80, 0x00, 0xc0, 0x40, 0xa0, 0x00, 0xc0, 0x40,
172 0xc0, 0x00, 0xc0, 0x40, 0xe0, 0x00, 0xc0, 0x60, 0x00, 0x00, 0xc0, 0x60, 0x20, 0x00, 0xc0, 0x60,
173 0x40, 0x00, 0xc0, 0x60, 0x60, 0x00, 0xc0, 0x60, 0x80, 0x00, 0xc0, 0x60, 0xa0, 0x00, 0xc0, 0x60,
174 0xc0, 0x00, 0xc0, 0x60, 0xe0, 0x00, 0xc0, 0x80, 0x00, 0x00, 0xc0, 0x80, 0x20, 0x00, 0xc0, 0x80,
175 0x40, 0x00, 0xc0, 0x80, 0x60, 0x00, 0xc0, 0x80, 0x80, 0x00, 0xc0, 0x80, 0xa0, 0x00, 0xc0, 0x80,
176 0xc0, 0x00, 0xc0, 0x80, 0xe0, 0x00, 0xc0, 0xa0, 0x00, 0x00, 0xc0, 0xa0, 0x20, 0x00, 0xc0, 0xa0,
177 0x40, 0x00, 0xc0, 0xa0, 0x60, 0x00, 0xc0, 0xa0, 0x80, 0x00, 0xc0, 0xa0, 0xa0, 0x00, 0xc0, 0xa0,
178 0xc0, 0x00, 0xc0, 0xa0, 0xe0, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0xc0, 0xc0, 0x20, 0x00, 0xc0, 0xc0,
179 0x40, 0x00, 0xc0, 0xc0, 0x60, 0x00, 0xc0, 0xc0, 0x80, 0x00, 0xc0, 0xc0, 0xa0, 0x00, 0xf0, 0xfb,
180 0xff, 0x00, 0xa4, 0xa0, 0xa0, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff,
181 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff,
182 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
183 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
184 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
185 0xff, 0xff, 0x00, 0x00, 0xf8, 0x00, 0x99, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
186 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
187 0x00, 0x00, 0xf8, 0xf8, 0xec, 0x00, 0xec, 0x99, 0x99, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
188 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
189 0xf8, 0xf8, 0xec, 0xec, 0xec, 0x00, 0xec, 0xec, 0xec, 0x99, 0x99, 0x00, 0x00, 0xff, 0xff, 0xff,
190 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xf8,
191 0xec, 0xec, 0xec, 0xec, 0xec, 0x00, 0xec, 0xec, 0xec, 0xec, 0xec, 0x99, 0x99, 0x00, 0x00, 0xff,
192 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xf8, 0xec, 0xec,
193 0xec, 0xec, 0xec, 0xec, 0xec, 0x00, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0x99, 0x99, 0x00,
194 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xf8, 0xec, 0xec, 0xec, 0xec,
195 0xec, 0xec, 0xec, 0xec, 0xec, 0x00, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec,
196 0xec, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xf8, 0xec, 0xec, 0xeb, 0xec, 0xec, 0x09,
197 0xed, 0xec, 0xec, 0xeb, 0xec, 0x00, 0xec, 0xec, 0xeb, 0x09, 0x09, 0x08, 0x07, 0x09, 0xec, 0xec,
198 0xec, 0xec, 0x99, 0x00, 0x00, 0xff, 0x00, 0xf8, 0xec, 0xec, 0xec, 0xec, 0x09, 0x00, 0xf6, 0xff,
199 0xf6, 0xf6, 0xed, 0xec, 0xec, 0x00, 0xec, 0xec, 0xec, 0x09, 0x00, 0xff, 0xff, 0xff, 0xf6, 0x07,
200 0xec, 0xec, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0xec, 0xec, 0x09, 0xff, 0xff, 0xff, 0xff,
201 0xff, 0xf6, 0x08, 0xec, 0xec, 0x00, 0xec, 0xec, 0x09, 0x00, 0xff, 0xf6, 0xf6, 0xff, 0xff, 0xf6,
202 0x08, 0xec, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0xeb, 0x09, 0xff, 0xff, 0xf6, 0x09, 0x09,
203 0x00, 0xff, 0xf6, 0xed, 0xec, 0x00, 0xec, 0xec, 0x09, 0xff, 0xf6, 0xf6, 0x07, 0x09, 0x00, 0xff,
204 0xf6, 0xed, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0xf3, 0x00, 0xf6, 0x00, 0xeb, 0xeb, 0xec,
205 0x08, 0x00, 0xf6, 0xf5, 0xec, 0x00, 0xec, 0xec, 0x09, 0xff, 0xf6, 0xec, 0xec, 0xeb, 0xec, 0x00,
206 0xf6, 0xed, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0x09, 0x00, 0xf6, 0xed, 0xeb, 0xec, 0xec,
207 0x09, 0x00, 0xf6, 0x09, 0xec, 0x00, 0xec, 0xec, 0x00, 0xff, 0xf6, 0xec, 0xf3, 0x00, 0xbe, 0x00,
208 0xf6, 0xed, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0x08, 0xf6, 0xf6, 0xe4, 0xeb, 0xec, 0x09,
209 0x09, 0x00, 0xf6, 0xed, 0xec, 0x00, 0xec, 0xec, 0xf4, 0xff, 0xf6, 0xed, 0xf3, 0x00, 0xff, 0xff,
210 0xf6, 0xed, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0x08, 0xf6, 0xf6, 0xe4, 0xeb, 0xec, 0xec,
211 0xbe, 0xff, 0xf6, 0xec, 0xec, 0x00, 0xec, 0xec, 0xec, 0x00, 0xf6, 0x07, 0x09, 0xf5, 0xf6, 0xf6,
212 0xf6, 0xed, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0x08, 0xf6, 0xf6, 0xed, 0xec, 0xec, 0x09,
213 0x00, 0xf6, 0x09, 0xec, 0xec, 0x00, 0xec, 0xec, 0xeb, 0x09, 0xff, 0xf6, 0x09, 0xec, 0xec, 0xec,
214 0x09, 0xed, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0x08, 0x00, 0xf6, 0xf6, 0x07, 0x08, 0xff,
215 0xff, 0x08, 0xec, 0xec, 0xec, 0x00, 0xec, 0xec, 0xec, 0xec, 0x08, 0xff, 0xf6, 0xf6, 0xf5, 0x09,
216 0x08, 0xec, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0xf4, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
217 0x08, 0xec, 0xeb, 0xec, 0x00, 0x00, 0x00, 0xec, 0xec, 0xec, 0x09, 0x08, 0x00, 0xff, 0xff, 0xff,
218 0xf6, 0xed, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0xec, 0x09, 0x08, 0x00, 0xff, 0x08, 0x09,
219 0x09, 0xeb, 0x00, 0x00, 0xf8, 0xf8, 0x99, 0x00, 0x00, 0xec, 0xec, 0xec, 0xf5, 0x08, 0xff, 0xff,
220 0xf6, 0xed, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0xec, 0xec, 0xec, 0x09, 0xeb, 0xec, 0xeb,
221 0x00, 0x00, 0xf8, 0xf8, 0xec, 0xec, 0xec, 0x99, 0x99, 0x00, 0x00, 0xec, 0xeb, 0xec, 0x09, 0x09,
222 0xed, 0xec, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0x00, 0x00,
223 0xf8, 0xf8, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0x99, 0x99, 0x00, 0x00, 0xec, 0xec, 0xec,
224 0xec, 0xec, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0xec, 0xec, 0xec, 0x00, 0x00, 0xf8, 0xf8,
225 0xec, 0xeb, 0x00, 0xff, 0xff, 0xff, 0xf6, 0xec, 0xec, 0xec, 0xec, 0x99, 0x99, 0x00, 0x00, 0xec,
226 0xec, 0xec, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0xec, 0xec, 0x00, 0x00, 0xf8, 0xf8, 0xec, 0xec,
227 0xeb, 0x00, 0xf6, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0x99, 0x99, 0x00,
228 0x00, 0xec, 0xec, 0x99, 0x00, 0xff, 0x00, 0xf8, 0x00, 0x00, 0xf8, 0xf8, 0xec, 0xec, 0xec, 0xec,
229 0xf4, 0xf6, 0xed, 0x00, 0xff, 0xf6, 0xff, 0xff, 0x00, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec, 0x99,
230 0x99, 0x00, 0x00, 0x99, 0x00, 0xff, 0x00, 0x00, 0xf8, 0xf8, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec,
231 0xf4, 0xf6, 0x09, 0xf6, 0xec, 0x00, 0xf6, 0xf4, 0xf6, 0xed, 0xec, 0xec, 0xec, 0xec, 0xec, 0xec,
232 0xec, 0x99, 0x99, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xf8, 0xec, 0xec, 0xec, 0xec,
233 0x09, 0x00, 0xed, 0x00, 0xee, 0x00, 0xf6, 0xeb, 0x00, 0xee, 0xec, 0xec, 0xec, 0xec, 0xec, 0x99,
234 0x99, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xf8, 0xec, 0xec,
235 0xeb, 0x00, 0xf6, 0x00, 0xff, 0xff, 0xf6, 0x00, 0x00, 0x00, 0xec, 0xec, 0xec, 0x99, 0x99, 0x00,
236 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xf8,
237 0xec, 0x09, 0x00, 0xf6, 0xec, 0xec, 0xec, 0x00, 0xf6, 0xed, 0xec, 0x99, 0x99, 0x00, 0x00, 0xff,
238 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
239 0xf8, 0xf8, 0xeb, 0x00, 0xff, 0xff, 0xff, 0xf6, 0xed, 0x99, 0x99, 0x00, 0x00, 0xff, 0xff, 0xff,
240 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
241 0x00, 0x00, 0xf8, 0xf8, 0xec, 0xec, 0xec, 0x99, 0x99, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
242 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
243 0xff, 0xff, 0x00, 0x00, 0xf8, 0xf8, 0x99, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
244 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
245 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
246 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
247 };
248
249
250 static const uint8_t icon16[630] = {
251 0x42, 0x4d, 0x76, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00,
252 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00,
253 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xc4, 0x0e, 0x00, 0x00, 0xc4, 0x0e, 0x00, 0x00, 0x00, 0x00,
254 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,
255 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x80,
256 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff,
257 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff,
258 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff,
259 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x70, 0x60, 0x0f,
260 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x77, 0x70, 0x76, 0x60,
261 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x77, 0x77, 0x70, 0x77, 0x76,
262 0x60, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x77, 0x77, 0x77, 0x70, 0x77, 0x77,
263 0x76, 0x60, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x77, 0x77, 0x77, 0x77, 0x70, 0x77, 0x77,
264 0x77, 0x76, 0x60, 0x0f, 0xff, 0xff, 0xff, 0x00, 0x77, 0x77, 0x77, 0x77, 0x77, 0x70, 0x77, 0x77,
265 0x77, 0x77, 0x77, 0x70, 0x0f, 0xff, 0x00, 0x77, 0x77, 0x77, 0x78, 0x87, 0x77, 0x70, 0x77, 0x78,
266 0x88, 0x88, 0x77, 0x77, 0x60, 0x0f, 0x07, 0x77, 0x77, 0x80, 0xff, 0xff, 0x87, 0x70, 0x77, 0x78,
267 0x0f, 0xff, 0xf8, 0x77, 0x76, 0x0f, 0x07, 0x77, 0x78, 0xff, 0xff, 0xff, 0x87, 0x70, 0x77, 0x80,
268 0xff, 0xff, 0xff, 0x87, 0x76, 0x0f, 0x07, 0x77, 0x8f, 0xff, 0x88, 0x0f, 0xf8, 0x70, 0x77, 0x8f,
269 0xff, 0x88, 0x0f, 0xf8, 0x76, 0x0f, 0x07, 0x77, 0x0f, 0x07, 0x77, 0x80, 0xf8, 0x70, 0x77, 0x8f,
270 0xf7, 0x77, 0x70, 0xf8, 0x76, 0x0f, 0x07, 0x78, 0x0f, 0x87, 0x77, 0x80, 0xf8, 0x70, 0x77, 0x0f,
271 0xf7, 0x70, 0x80, 0xf8, 0x76, 0x0f, 0x07, 0x78, 0xff, 0x77, 0x78, 0x80, 0xf8, 0x70, 0x77, 0x8f,
272 0xf8, 0x70, 0xff, 0xf8, 0x76, 0x0f, 0x07, 0x78, 0xff, 0x77, 0x77, 0x8f, 0xf7, 0x70, 0x77, 0x70,
273 0xf8, 0x88, 0xff, 0xf8, 0x76, 0x0f, 0x07, 0x78, 0xff, 0x87, 0x78, 0x0f, 0x87, 0x70, 0x77, 0x78,
274 0xff, 0x87, 0x77, 0x88, 0x76, 0x0f, 0x07, 0x78, 0x0f, 0xf8, 0x8f, 0xf8, 0x77, 0x70, 0x77, 0x77,
275 0x8f, 0xff, 0x88, 0x87, 0x76, 0x0f, 0x07, 0x78, 0x0f, 0xff, 0xff, 0x87, 0x77, 0x00, 0x07, 0x77,
276 0x88, 0x0f, 0xff, 0xf8, 0x76, 0x0f, 0x07, 0x77, 0x88, 0x0f, 0x88, 0x87, 0x00, 0x77, 0x60, 0x07,
277 0x77, 0x88, 0xff, 0xf8, 0x76, 0x0f, 0x07, 0x77, 0x77, 0x87, 0x77, 0x00, 0x77, 0x77, 0x76, 0x60,
278 0x07, 0x77, 0x88, 0x87, 0x76, 0x0f, 0x07, 0x77, 0x77, 0x77, 0x00, 0x77, 0x77, 0x77, 0x77, 0x76,
279 0x60, 0x07, 0x77, 0x77, 0x76, 0x0f, 0x07, 0x77, 0x77, 0x00, 0x77, 0x77, 0x0f, 0xff, 0xf7, 0x77,
280 0x76, 0x60, 0x07, 0x77, 0x76, 0x0f, 0x07, 0x77, 0x00, 0x77, 0x77, 0x70, 0xf7, 0x77, 0x77, 0x77,
281 0x77, 0x76, 0x60, 0x07, 0x76, 0x0f, 0x07, 0x00, 0x77, 0x77, 0x77, 0x8f, 0x80, 0xff, 0xff, 0x07,
282 0x77, 0x77, 0x76, 0x60, 0x06, 0x0f, 0x00, 0x77, 0x77, 0x77, 0x77, 0x8f, 0x8f, 0x70, 0xf8, 0xf8,
283 0x77, 0x77, 0x77, 0x76, 0x60, 0x0f, 0xff, 0x00, 0x77, 0x77, 0x77, 0x80, 0x80, 0x80, 0xf7, 0x08,
284 0x77, 0x77, 0x76, 0x60, 0x0f, 0xff, 0xff, 0xff, 0x00, 0x77, 0x77, 0x70, 0xf0, 0xff, 0xf0, 0x00,
285 0x77, 0x76, 0x60, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x77, 0x78, 0x0f, 0x77, 0x70, 0xf8,
286 0x76, 0x60, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x77, 0x70, 0xff, 0xff, 0x86,
287 0x60, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x77, 0x77, 0x76, 0x60,
288 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x77, 0x60, 0x0f,
289 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff,
290 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
291 };
292
293 static const uint8_t icon2[190] = {
294 0x42, 0x4d, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00,
295 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
296 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc4, 0x0e, 0x00, 0x00, 0xc4, 0x0e, 0x00, 0x00, 0x00, 0x00,
297 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xfc,
298 0x7f, 0xff, 0xff, 0xf2, 0x1f, 0xff, 0xff, 0xce, 0x87, 0xff, 0xff, 0x3e, 0xe1, 0xff, 0xfc, 0xfe,
299 0xf8, 0x7f, 0xf3, 0xfe, 0xfe, 0x1f, 0xcf, 0xfe, 0xff, 0xe7, 0x3f, 0xfe, 0xff, 0xf1, 0x7e, 0xfe,
300 0xf7, 0xf9, 0x7f, 0xfe, 0xef, 0xf9, 0x7f, 0xde, 0xff, 0x79, 0x75, 0xee, 0xff, 0xb9, 0x77, 0xee,
301 0xde, 0xb9, 0x7f, 0xee, 0xfe, 0xf9, 0x7f, 0xfe, 0xef, 0xf9, 0x7f, 0xde, 0xff, 0xf9, 0x77, 0xfe,
302 0xff, 0xf9, 0x77, 0xfc, 0x7d, 0xf9, 0x7d, 0xf3, 0x1f, 0xf9, 0x7f, 0xcf, 0x87, 0xf9, 0x7f, 0x3f,
303 0xe1, 0xf9, 0x7c, 0xf7, 0xf8, 0x79, 0x73, 0xef, 0xfe, 0x19, 0x4f, 0xfb, 0xdf, 0x81, 0x3f, 0xfe,
304 0xff, 0xe1, 0xcf, 0xea, 0xdf, 0x87, 0xf3, 0xeb, 0x8e, 0x1f, 0xfc, 0xf7, 0xb8, 0x7f, 0xff, 0x3b,
305 0xe1, 0xff, 0xff, 0xcf, 0x87, 0xff, 0xff, 0xf3, 0x1f, 0xff, 0xff, 0xfc, 0x7f, 0xff
306 };
307
308
309
310
2/7
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
6 GATEXX_TEST_UNIT(BitmapImages)
311 {
312 2 unsigned dim = 128;
313
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage image(dim, dim);
314
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 image.clear(Color::Blue);
315
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 Drawer d(image);
316
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 d.line(0, 0, dim - 1, dim - 1, Color::Yellow);
317
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 d.rectangle(0, 0, dim - 1, dim - 1, Color::Green);
318
319 { // 1-bit image
320
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 LocalMemStream stream(&icon2[0], sizeof(icon2));
321
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage loadedImage;
322
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(BitmapImages::load(loadedImage, stream));
323 }
324
325 { // 4-bit image
326
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 LocalMemStream stream(&icon16[0], sizeof(icon16));
327
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage loadedImage;
328
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(BitmapImages::load(loadedImage, stream));
329 }
330
331 { // 8-bit image
332
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 LocalMemStream stream(&icon256[0], sizeof(icon256));
333
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
4 RasterImage loadedImage;
334
4/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
2 GATEXX_TEST_CHECK_NOTHROW(BitmapImages::load(loadedImage, stream));
335 }
336 2 }
337