2 * Copyright © 2016 Google, Inc.
3 * Copyright © 2018 Ebrahim Byagowi
5 * This is part of HarfBuzz, a text shaping library.
7 * Permission is hereby granted, without written agreement and without
8 * license or royalty fees, to use, copy, modify, and distribute this
9 * software and its documentation for any purpose, provided that the
10 * above copyright notice and the following two paragraphs appear in
11 * all copies of this software.
13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
19 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25 * Google Author(s): Sascha Brawer
32 /* Unit tests for hb-ot-color.h */
34 /* Test font with the following CPAL v0 table, as TTX and manual disassembly:
38 <numPaletteEntries value="2"/>
40 <color index="0" value="#000000FF"/>
41 <color index="1" value="#66CCFFFF"/>
44 <color index="0" value="#000000FF"/>
45 <color index="1" value="#800000FF"/>
50 2 | 0002 # numPaletteEntries=2
51 4 | 0002 # numPalettes=2
52 6 | 0004 # numColorRecords=4
53 8 | 00000010 # offsetToFirstColorRecord=16
54 12 | 0000 0002 # colorRecordIndex=[0, 2]
55 16 | 000000ff ffcc66ff # colorRecord #0, #1 (BGRA)
56 24 | 000000ff 000080ff # colorRecord #2, #3 (BGRA)
58 static hb_face_t *cpal_v0 = NULL;
60 /* Test font with the following CPAL v1 table, as TTX and manual disassembly:
64 <numPaletteEntries value="2"/>
65 <palette index="0" label="257" type="2">
66 <color index="0" value="#000000FF"/>
67 <color index="1" value="#66CCFFFF"/>
69 <palette index="1" label="65535" type="1">
70 <color index="0" value="#000000FF"/>
71 <color index="1" value="#FFCC66FF"/>
73 <palette index="2" label="258" type="0">
74 <color index="0" value="#000000FF"/>
75 <color index="1" value="#800000FF"/>
78 <label index="0" value="65535"/>
79 <label index="1" value="256"/>
84 2 | 0002 # numPaletteEntries=2
85 4 | 0003 # numPalettes=3
86 6 | 0006 # numColorRecords=6
87 8 | 0000001e # offsetToFirstColorRecord=30
88 12 | 0000 0002 0004 # colorRecordIndex=[0, 2, 4]
89 18 | 00000036 # offsetToPaletteTypeArray=54
90 22 | 00000042 # offsetToPaletteLabelArray=66
91 26 | 00000048 # offsetToPaletteEntryLabelArray=72
92 30 | 000000ff ffcc66ff 000000ff # colorRecord #0, #1, #2 (BGRA)
93 42 | 66ccffff 000000ff 000080ff # colorRecord #3, #4, #5 (BGRA)
94 54 | 00000002 00000001 00000000 # paletteFlags=[2, 1, 0]
95 66 | 0101 ffff 0102 # paletteName=[257, 0xffff, 258]
96 72 | ffff 0100 # paletteEntryLabel=[0xffff, 256]
98 static hb_face_t *cpal_v1 = NULL;
100 static hb_face_t *cpal = NULL;
101 static hb_face_t *cbdt = NULL;
102 static hb_face_t *sbix = NULL;
103 static hb_face_t *svg = NULL;
104 static hb_face_t *empty = NULL;
106 #define assert_color_rgba(colors, i, r, g, b, a) G_STMT_START { \
107 const hb_color_t *_colors = (colors); \
108 const size_t _i = (i); \
109 const uint8_t red = (r), green = (g), blue = (b), alpha = (a); \
110 if (hb_color_get_red (_colors[_i]) != red) { \
111 g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
112 "colors[" #i "]", _colors[_i], "==", red, 'x'); \
114 if (hb_color_get_green (_colors[_i]) != green) { \
115 g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
116 "colors[" #i "]", _colors[_i], "==", green, 'x'); \
118 if (hb_color_get_blue (_colors[_i]) != blue) { \
119 g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
120 "colors[" #i "]", colors[_i], "==", blue, 'x'); \
122 if (hb_color_get_alpha (_colors[_i]) != alpha) { \
123 g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
124 "colors[" #i "]", _colors[_i], "==", alpha, 'x'); \
130 test_hb_ot_color_palette_get_count (void)
132 g_assert_cmpint (hb_ot_color_palette_get_count (hb_face_get_empty()), ==, 0);
133 g_assert_cmpint (hb_ot_color_palette_get_count (cpal_v0), ==, 2);
134 g_assert_cmpint (hb_ot_color_palette_get_count (cpal_v1), ==, 3);
139 test_hb_ot_color_palette_get_name_id_empty (void)
141 /* numPalettes=0, so all calls are for out-of-bounds palette indices */
142 g_assert_cmpint (hb_ot_color_palette_get_name_id (hb_face_get_empty(), 0), ==, HB_OT_NAME_ID_INVALID);
143 g_assert_cmpint (hb_ot_color_palette_get_name_id (hb_face_get_empty(), 1), ==, HB_OT_NAME_ID_INVALID);
148 test_hb_ot_color_palette_get_name_id_v0 (void)
150 g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 0), ==, HB_OT_NAME_ID_INVALID);
151 g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 1), ==, HB_OT_NAME_ID_INVALID);
153 /* numPalettes=2, so palette #2 is out of bounds */
154 g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 2), ==, HB_OT_NAME_ID_INVALID);
159 test_hb_ot_color_palette_get_name_id_v1 (void)
161 g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 0), ==, 257);
162 g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 1), ==, HB_OT_NAME_ID_INVALID);
163 g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 2), ==, 258);
165 /* numPalettes=3, so palette #3 is out of bounds */
166 g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 3), ==, HB_OT_NAME_ID_INVALID);
171 test_hb_ot_color_palette_get_flags_empty (void)
173 /* numPalettes=0, so all calls are for out-of-bounds palette indices */
174 g_assert_cmpint (hb_ot_color_palette_get_flags (hb_face_get_empty(), 0), ==, HB_OT_COLOR_PALETTE_FLAG_DEFAULT);
175 g_assert_cmpint (hb_ot_color_palette_get_flags (hb_face_get_empty(), 1), ==, HB_OT_COLOR_PALETTE_FLAG_DEFAULT);
180 test_hb_ot_color_palette_get_flags_v0 (void)
182 g_assert_cmpint (hb_ot_color_palette_get_flags (cpal_v0, 0), ==, HB_OT_COLOR_PALETTE_FLAG_DEFAULT);
183 g_assert_cmpint (hb_ot_color_palette_get_flags (cpal_v0, 1), ==, HB_OT_COLOR_PALETTE_FLAG_DEFAULT);
185 /* numPalettes=2, so palette #2 is out of bounds */
186 g_assert_cmpint (hb_ot_color_palette_get_flags (cpal_v0, 2), ==, HB_OT_COLOR_PALETTE_FLAG_DEFAULT);
191 test_hb_ot_color_palette_get_flags_v1 (void)
193 g_assert_cmpint (hb_ot_color_palette_get_flags (cpal_v1, 0), ==, HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND);
194 g_assert_cmpint (hb_ot_color_palette_get_flags (cpal_v1, 1), ==, HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_LIGHT_BACKGROUND);
195 g_assert_cmpint (hb_ot_color_palette_get_flags (cpal_v0, 2), ==, HB_OT_COLOR_PALETTE_FLAG_DEFAULT);
197 /* numPalettes=3, so palette #3 is out of bounds */
198 g_assert_cmpint (hb_ot_color_palette_get_flags (cpal_v0, 3), ==, HB_OT_COLOR_PALETTE_FLAG_DEFAULT);
203 test_hb_ot_color_palette_get_colors_empty (void)
205 g_assert_cmpint (hb_ot_color_palette_get_colors (empty, 0, 0, NULL, NULL), ==, 0);
210 test_hb_ot_color_palette_get_colors_v0 (void)
212 unsigned int num_colors = hb_ot_color_palette_get_colors (cpal_v0, 0, 0, NULL, NULL);
213 hb_color_t *colors = (hb_color_t*) alloca (num_colors * sizeof (hb_color_t));
214 size_t colors_size = num_colors * sizeof(*colors);
215 g_assert_cmpint (num_colors, ==, 2);
217 /* Palette #0, start_index=0 */
218 g_assert_cmpint (hb_ot_color_palette_get_colors (cpal_v0, 0, 0, &num_colors, colors), ==, 2);
219 g_assert_cmpint (num_colors, ==, 2);
220 assert_color_rgba (colors, 0, 0x00, 0x00, 0x00, 0xff);
221 assert_color_rgba (colors, 1, 0x66, 0xcc, 0xff, 0xff);
223 /* Palette #1, start_index=0 */
224 g_assert_cmpint (hb_ot_color_palette_get_colors (cpal_v0, 1, 0, &num_colors, colors), ==, 2);
225 g_assert_cmpint (num_colors, ==, 2);
226 assert_color_rgba (colors, 0, 0x00, 0x00, 0x00, 0xff);
227 assert_color_rgba (colors, 1, 0x80, 0x00, 0x00, 0xff);
229 /* Palette #2 (there are only #0 and #1 in the font, so this is out of bounds) */
230 g_assert_cmpint (hb_ot_color_palette_get_colors (cpal_v0, 2, 0, &num_colors, colors), ==, 0);
232 /* Palette #0, start_index=1 */
233 memset(colors, 0x33, colors_size);
235 g_assert_cmpint (hb_ot_color_palette_get_colors (cpal_v0, 0, 1, &num_colors, colors), ==, 2);
236 g_assert_cmpint (num_colors, ==, 1);
237 assert_color_rgba (colors, 0, 0x66, 0xcc, 0xff, 0xff);
238 assert_color_rgba (colors, 1, 0x33, 0x33, 0x33, 0x33); /* untouched */
240 /* Palette #0, start_index=0, pretend that we have only allocated space for 1 color */
241 memset(colors, 0x44, colors_size);
243 g_assert_cmpint (hb_ot_color_palette_get_colors (cpal_v0, 0, 0, &num_colors, colors), ==, 2);
244 g_assert_cmpint (num_colors, ==, 1);
245 assert_color_rgba (colors, 0, 0x00, 0x00, 0x00, 0xff);
246 assert_color_rgba (colors, 1, 0x44, 0x44, 0x44, 0x44); /* untouched */
248 /* start_index > numPaletteEntries */
249 memset (colors, 0x44, colors_size);
251 g_assert_cmpint (hb_ot_color_palette_get_colors (cpal_v0, 0, 9876, &num_colors, colors), ==, 2);
252 g_assert_cmpint (num_colors, ==, 0);
253 assert_color_rgba (colors, 0, 0x44, 0x44, 0x44, 0x44); /* untouched */
254 assert_color_rgba (colors, 1, 0x44, 0x44, 0x44, 0x44); /* untouched */
259 test_hb_ot_color_palette_get_colors_v1 (void)
261 hb_color_t colors[3];
262 unsigned int num_colors = hb_ot_color_palette_get_colors (cpal_v1, 0, 0, NULL, NULL);
263 size_t colors_size = 3 * sizeof (hb_color_t);
264 g_assert_cmpint (num_colors, ==, 2);
266 /* Palette #0, start_index=0 */
267 memset (colors, 0x77, colors_size);
268 g_assert_cmpint (hb_ot_color_palette_get_colors (cpal_v1, 0, 0, &num_colors, colors), ==, 2);
269 g_assert_cmpint (num_colors, ==, 2);
270 assert_color_rgba (colors, 0, 0x00, 0x00, 0x00, 0xff);
271 assert_color_rgba (colors, 1, 0x66, 0xcc, 0xff, 0xff);
272 assert_color_rgba (colors, 2, 0x77, 0x77, 0x77, 0x77); /* untouched */
274 /* Palette #1, start_index=0 */
275 memset (colors, 0x77, colors_size);
276 g_assert_cmpint (hb_ot_color_palette_get_colors (cpal_v1, 1, 0, &num_colors, colors), ==, 2);
277 g_assert_cmpint (num_colors, ==, 2);
278 assert_color_rgba (colors, 0, 0x00, 0x00, 0x00, 0xff);
279 assert_color_rgba (colors, 1, 0xff, 0xcc, 0x66, 0xff);
280 assert_color_rgba (colors, 2, 0x77, 0x77, 0x77, 0x77); /* untouched */
282 /* Palette #2, start_index=0 */
283 memset (colors, 0x77, colors_size);
284 g_assert_cmpint (hb_ot_color_palette_get_colors (cpal_v1, 2, 0, &num_colors, colors), ==, 2);
285 g_assert_cmpint (num_colors, ==, 2);
286 assert_color_rgba (colors, 0, 0x00, 0x00, 0x00, 0xff);
287 assert_color_rgba (colors, 1, 0x80, 0x00, 0x00, 0xff);
288 assert_color_rgba (colors, 2, 0x77, 0x77, 0x77, 0x77); /* untouched */
290 /* Palette #3 (out of bounds), start_index=0 */
291 memset (colors, 0x77, colors_size);
292 g_assert_cmpint (hb_ot_color_palette_get_colors (cpal_v1, 3, 0, &num_colors, colors), ==, 0);
293 g_assert_cmpint (num_colors, ==, 0);
294 assert_color_rgba (colors, 0, 0x77, 0x77, 0x77, 0x77); /* untouched */
295 assert_color_rgba (colors, 1, 0x77, 0x77, 0x77, 0x77); /* untouched */
296 assert_color_rgba (colors, 2, 0x77, 0x77, 0x77, 0x77); /* untouched */
301 test_hb_ot_color_palette_color_get_name_id (void)
303 g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 0), ==, HB_OT_NAME_ID_INVALID);
304 g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 1), ==, HB_OT_NAME_ID_INVALID);
305 g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 2), ==, HB_OT_NAME_ID_INVALID);
306 g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 0), ==, HB_OT_NAME_ID_INVALID);
307 g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 1), ==, HB_OT_NAME_ID_INVALID);
308 g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 2), ==, HB_OT_NAME_ID_INVALID);
309 g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 0), ==, HB_OT_NAME_ID_INVALID);
310 g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 1), ==, 256);
311 g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 2), ==, HB_OT_NAME_ID_INVALID);
316 test_hb_ot_color_glyph_get_layers (void)
318 hb_ot_color_layer_t layers[1];
319 unsigned int count = 1;
320 unsigned int num_layers;
322 g_assert_cmpuint (hb_ot_color_glyph_get_layers (cpal_v1, 0, 0,
324 g_assert_cmpuint (hb_ot_color_glyph_get_layers (cpal_v1, 1, 0,
326 g_assert_cmpuint (hb_ot_color_glyph_get_layers (cpal_v1, 2, 0,
329 num_layers = hb_ot_color_glyph_get_layers (cpal_v1, 2, 0, &count, layers);
331 g_assert_cmpuint (num_layers, ==, 2);
332 g_assert_cmpuint (count, ==, 1);
333 g_assert_cmpuint (layers[0].glyph, ==, 3);
334 g_assert_cmpuint (layers[0].color_index, ==, 1);
337 hb_ot_color_glyph_get_layers (cpal_v1, 2, 1, &count, layers);
339 g_assert_cmpuint (num_layers, ==, 2);
340 g_assert_cmpuint (count, ==, 1);
341 g_assert_cmpuint (layers[0].glyph, ==, 4);
342 g_assert_cmpuint (layers[0].color_index, ==, 0);
346 test_hb_ot_color_has_data (void)
348 g_assert (hb_ot_color_has_layers (empty) == FALSE);
349 g_assert (hb_ot_color_has_layers (cpal_v0) == TRUE);
350 g_assert (hb_ot_color_has_layers (cpal_v1) == TRUE);
351 g_assert (hb_ot_color_has_layers (cpal) == TRUE);
352 g_assert (hb_ot_color_has_layers (cbdt) == FALSE);
353 g_assert (hb_ot_color_has_layers (sbix) == FALSE);
354 g_assert (hb_ot_color_has_layers (svg) == FALSE);
356 g_assert (hb_ot_color_has_palettes (empty) == FALSE);
357 g_assert (hb_ot_color_has_palettes (cpal_v0) == TRUE);
358 g_assert (hb_ot_color_has_palettes (cpal_v1) == TRUE);
359 g_assert (hb_ot_color_has_palettes (cpal) == TRUE);
360 g_assert (hb_ot_color_has_palettes (cbdt) == FALSE);
361 g_assert (hb_ot_color_has_palettes (sbix) == FALSE);
362 g_assert (hb_ot_color_has_palettes (svg) == FALSE);
364 g_assert (hb_ot_color_has_svg (empty) == FALSE);
365 g_assert (hb_ot_color_has_svg (cpal_v0) == FALSE);
366 g_assert (hb_ot_color_has_svg (cpal_v1) == FALSE);
367 g_assert (hb_ot_color_has_svg (cpal) == FALSE);
368 g_assert (hb_ot_color_has_svg (cbdt) == FALSE);
369 g_assert (hb_ot_color_has_svg (sbix) == FALSE);
370 g_assert (hb_ot_color_has_svg (svg) == TRUE);
372 g_assert (hb_ot_color_has_png (empty) == FALSE);
373 g_assert (hb_ot_color_has_png (cpal_v0) == FALSE);
374 g_assert (hb_ot_color_has_png (cpal_v1) == FALSE);
375 g_assert (hb_ot_color_has_png (cpal) == FALSE);
376 g_assert (hb_ot_color_has_png (cbdt) == TRUE);
377 g_assert (hb_ot_color_has_png (sbix) == TRUE);
378 g_assert (hb_ot_color_has_png (svg) == FALSE);
382 test_hb_ot_color_svg (void)
388 blob = hb_ot_color_glyph_reference_svg (svg, 0);
389 g_assert (hb_blob_get_length (blob) == 0);
391 blob = hb_ot_color_glyph_reference_svg (svg, 1);
392 data = hb_blob_get_data (blob, &length);
393 g_assert_cmpuint (length, ==, 146);
394 g_assert (strncmp (data, "<?xml", 4) == 0);
395 g_assert (strncmp (data + 140, "</svg>", 5) == 0);
396 hb_blob_destroy (blob);
398 blob = hb_ot_color_glyph_reference_svg (empty, 0);
399 g_assert (hb_blob_get_length (blob) == 0);
404 test_hb_ot_color_png (void)
409 hb_glyph_extents_t extents;
410 hb_font_t *cbdt_font;
413 hb_font_t *sbix_font;
414 sbix_font = hb_font_create (sbix);
415 blob = hb_ot_color_glyph_reference_png (sbix_font, 0);
416 hb_font_get_glyph_extents (sbix_font, 0, &extents);
417 g_assert_cmpint (extents.x_bearing, ==, 0);
418 g_assert_cmpint (extents.y_bearing, ==, 0);
419 g_assert_cmpint (extents.width, ==, 0);
420 g_assert_cmpint (extents.height, ==, 0);
421 g_assert (hb_blob_get_length (blob) == 0);
423 blob = hb_ot_color_glyph_reference_png (sbix_font, 1);
424 data = hb_blob_get_data (blob, &length);
425 g_assert_cmpuint (length, ==, 224);
426 g_assert (strncmp (data + 1, "PNG", 3) == 0);
427 hb_font_get_glyph_extents (sbix_font, 1, &extents);
428 g_assert_cmpint (extents.x_bearing, ==, 0);
429 g_assert_cmpint (extents.y_bearing, ==, 0);
430 g_assert_cmpint (extents.width, ==, 800);
431 g_assert_cmpint (extents.height, ==, 800);
432 hb_blob_destroy (blob);
433 hb_font_destroy (sbix_font);
436 cbdt_font = hb_font_create (cbdt);
437 blob = hb_ot_color_glyph_reference_png (cbdt_font, 0);
438 g_assert (hb_blob_get_length (blob) == 0);
440 blob = hb_ot_color_glyph_reference_png (cbdt_font, 1);
441 data = hb_blob_get_data (blob, &length);
442 g_assert_cmpuint (length, ==, 88);
443 g_assert (strncmp (data + 1, "PNG", 3) == 0);
444 hb_font_get_glyph_extents (cbdt_font, 1, &extents);
445 g_assert_cmpint (extents.x_bearing, ==, 0);
446 g_assert_cmpint (extents.y_bearing, ==, 1024);
447 g_assert_cmpint (extents.width, ==, 1024);
448 g_assert_cmpint (extents.height, ==, -1024);
449 hb_blob_destroy (blob);
450 hb_font_destroy (cbdt_font);
454 main (int argc, char **argv)
458 hb_test_init (&argc, &argv);
459 cpal_v0 = hb_test_open_font_file ("fonts/cpal-v0.ttf");
460 cpal_v1 = hb_test_open_font_file ("fonts/cpal-v1.ttf");
461 cpal = hb_test_open_font_file ("fonts/chromacheck-colr.ttf");
462 cbdt = hb_test_open_font_file ("fonts/chromacheck-cbdt.ttf");
463 sbix = hb_test_open_font_file ("fonts/chromacheck-sbix.ttf");
464 svg = hb_test_open_font_file ("fonts/chromacheck-svg.ttf");
465 empty = hb_face_get_empty ();
466 hb_test_add (test_hb_ot_color_palette_get_count);
467 hb_test_add (test_hb_ot_color_palette_get_name_id_empty);
468 hb_test_add (test_hb_ot_color_palette_get_name_id_v0);
469 hb_test_add (test_hb_ot_color_palette_get_name_id_v1);
470 hb_test_add (test_hb_ot_color_palette_get_flags_empty);
471 hb_test_add (test_hb_ot_color_palette_get_flags_v0);
472 hb_test_add (test_hb_ot_color_palette_get_flags_v1);
473 hb_test_add (test_hb_ot_color_palette_get_colors_empty);
474 hb_test_add (test_hb_ot_color_palette_get_colors_v0);
475 hb_test_add (test_hb_ot_color_palette_get_colors_v1);
476 hb_test_add (test_hb_ot_color_palette_color_get_name_id);
477 hb_test_add (test_hb_ot_color_glyph_get_layers);
478 hb_test_add (test_hb_ot_color_has_data);
479 hb_test_add (test_hb_ot_color_png);
480 hb_test_add (test_hb_ot_color_svg);
481 status = hb_test_run();
482 hb_face_destroy (cpal_v0);
483 hb_face_destroy (cpal_v1);
484 hb_face_destroy (cpal);
485 hb_face_destroy (cbdt);
486 hb_face_destroy (sbix);
487 hb_face_destroy (svg);