test,base: Added GTest for base/loader/image_file_data.cc
[gem5.git] / src / base / loader / small_image_file.test.hh
1 /*
2 * Copyright (c) 2019 The Regents of the University of California
3 * All rights reserved
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Bobby R. Bruce
29 */
30
31 #ifndef __SMALL_IMAGE_FILE_HH__
32 #define __SMALL_IMAGE_FILE_HH__
33
34 #include <cstdint>
35
36 /**
37 * This image file contains the text "This is a test image.\n" 31 times.
38 */
39 const uint8_t image_file[] = {
40 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
41 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x69,
42 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68,
43 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20,
44 0x74, 0x65, 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61,
45 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73,
46 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65,
47 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
48 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69,
49 0x73, 0x20, 0x61, 0x20, 0x74, 0x65, 0x73, 0x74,
50 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a,
51 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
52 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x69,
53 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68,
54 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20,
55 0x74, 0x65, 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61,
56 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73,
57 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65,
58 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
59 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69,
60 0x73, 0x20, 0x61, 0x20, 0x74, 0x65, 0x73, 0x74,
61 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a,
62 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
63 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x69,
64 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68,
65 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20,
66 0x74, 0x65, 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61,
67 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73,
68 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65,
69 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
70 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69,
71 0x73, 0x20, 0x61, 0x20, 0x74, 0x65, 0x73, 0x74,
72 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a,
73 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
74 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x69,
75 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68,
76 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20,
77 0x74, 0x65, 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61,
78 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73,
79 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65,
80 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
81 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69,
82 0x73, 0x20, 0x61, 0x20, 0x74, 0x65, 0x73, 0x74,
83 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a,
84 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
85 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x69,
86 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68,
87 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20,
88 0x74, 0x65, 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61,
89 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73,
90 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65,
91 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
92 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69,
93 0x73, 0x20, 0x61, 0x20, 0x74, 0x65, 0x73, 0x74,
94 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a,
95 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
96 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x69,
97 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68,
98 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20,
99 0x74, 0x65, 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61,
100 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73,
101 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65,
102 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
103 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69,
104 0x73, 0x20, 0x61, 0x20, 0x74, 0x65, 0x73, 0x74,
105 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a,
106 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
107 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x69,
108 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68,
109 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20,
110 0x74, 0x65, 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61,
111 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73,
112 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65,
113 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
114 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69,
115 0x73, 0x20, 0x61, 0x20, 0x74, 0x65, 0x73, 0x74,
116 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a,
117 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
118 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x69,
119 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68,
120 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20,
121 0x74, 0x65, 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61,
122 0x67, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73,
123 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65,
124 0x73, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
125 0x2e, 0x0a
126 };
127
128 /**
129 * This is "image_file" compressed using GZip.
130 */
131 const uint8_t image_file_gzipped[] = {
132 0x1f, 0x8b, 0x08, 0x08, 0x48, 0x4b, 0xcb, 0x5d,
133 0x00, 0x03, 0x62, 0x6c, 0x61, 0x2e, 0x69, 0x6d,
134 0x67, 0x00, 0x0b, 0xc9, 0xc8, 0x2c, 0x56, 0x00,
135 0xa2, 0x44, 0x85, 0x92, 0xd4, 0xe2, 0x12, 0x85,
136 0xcc, 0xdc, 0xc4, 0xf4, 0x54, 0x3d, 0xae, 0x90,
137 0x51, 0xd1, 0x51, 0xd1, 0x41, 0x26, 0x0a, 0x00,
138 0xc9, 0x58, 0x6c, 0x4e, 0xaa, 0x02, 0x00, 0x00
139 };
140
141 #endif // __SMALL_IMAGE_FILE_HH__