Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2011 Google, Inc. |
| 3 | * |
| 4 | * This is part of HarfBuzz, a text shaping library. |
| 5 | * |
| 6 | * Permission is hereby granted, without written agreement and without |
| 7 | * license or royalty fees, to use, copy, modify, and distribute this |
| 8 | * software and its documentation for any purpose, provided that the |
| 9 | * above copyright notice and the following two paragraphs appear in |
| 10 | * all copies of this software. |
| 11 | * |
| 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
| 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
| 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
| 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
| 16 | * DAMAGE. |
| 17 | * |
| 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
| 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
| 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
| 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 23 | * |
| 24 | * Google Author(s): Behdad Esfahbod |
| 25 | */ |
| 26 | |
| 27 | #include "hb-test.h" |
| 28 | |
| 29 | /* Unit tests for hb-font.h */ |
| 30 | |
| 31 | |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 32 | static const char test_data[] = "test\0data"; |
| 33 | |
| 34 | |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 35 | static void |
| 36 | test_face_empty (void) |
| 37 | { |
Philip Withnall | a6ced90 | 2017-02-08 02:18:33 +0000 | [diff] [blame] | 38 | hb_face_t *created_from_empty; |
| 39 | hb_face_t *created_from_null; |
| 40 | |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 41 | g_assert (hb_face_get_empty ()); |
Philip Withnall | a6ced90 | 2017-02-08 02:18:33 +0000 | [diff] [blame] | 42 | |
| 43 | created_from_empty = hb_face_create (hb_blob_get_empty (), 0); |
| 44 | g_assert (hb_face_get_empty () != created_from_empty); |
| 45 | |
| 46 | created_from_null = hb_face_create (NULL, 0); |
| 47 | g_assert (hb_face_get_empty () != created_from_null); |
Behdad Esfahbod | 74d9fa3 | 2011-05-11 23:07:47 -0400 | [diff] [blame] | 48 | |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 49 | g_assert (hb_face_reference_table (hb_face_get_empty (), HB_TAG ('h','e','a','d')) == hb_blob_get_empty ()); |
| 50 | |
| 51 | g_assert_cmpint (hb_face_get_upem (hb_face_get_empty ()), ==, 1000); |
Philip Withnall | a6ced90 | 2017-02-08 02:18:33 +0000 | [diff] [blame] | 52 | |
| 53 | hb_face_destroy (created_from_null); |
| 54 | hb_face_destroy (created_from_empty); |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | static void |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 58 | test_face_create (void) |
| 59 | { |
| 60 | hb_face_t *face; |
| 61 | hb_blob_t *blob; |
| 62 | |
| 63 | blob = hb_blob_create (test_data, sizeof (test_data), HB_MEMORY_MODE_READONLY, NULL, NULL); |
| 64 | face = hb_face_create (blob, 0); |
| 65 | hb_blob_destroy (blob); |
| 66 | |
| 67 | g_assert (hb_face_reference_table (face, HB_TAG ('h','e','a','d')) == hb_blob_get_empty ()); |
| 68 | |
| 69 | g_assert_cmpint (hb_face_get_upem (face), ==, 1000); |
| 70 | |
| 71 | hb_face_destroy (face); |
| 72 | } |
| 73 | |
| 74 | |
| 75 | static void |
Behdad Esfahbod | ea93e7b | 2011-05-11 23:22:55 -0400 | [diff] [blame] | 76 | free_up (void *user_data) |
| 77 | { |
| 78 | int *freed = (int *) user_data; |
| 79 | |
| 80 | g_assert (!*freed); |
| 81 | |
| 82 | (*freed)++; |
| 83 | } |
| 84 | |
| 85 | static hb_blob_t * |
Behdad Esfahbod | dcfcb95 | 2018-09-30 18:14:50 +0200 | [diff] [blame] | 86 | get_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data HB_UNUSED) |
Behdad Esfahbod | ea93e7b | 2011-05-11 23:22:55 -0400 | [diff] [blame] | 87 | { |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 88 | if (tag == HB_TAG ('a','b','c','d')) |
| 89 | return hb_blob_create (test_data, sizeof (test_data), HB_MEMORY_MODE_READONLY, NULL, NULL); |
| 90 | |
Behdad Esfahbod | ea93e7b | 2011-05-11 23:22:55 -0400 | [diff] [blame] | 91 | return hb_blob_get_empty (); |
| 92 | } |
| 93 | |
| 94 | static void |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 95 | test_face_createfortables (void) |
Behdad Esfahbod | ea93e7b | 2011-05-11 23:22:55 -0400 | [diff] [blame] | 96 | { |
| 97 | hb_face_t *face; |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 98 | hb_blob_t *blob; |
| 99 | const char *data; |
| 100 | unsigned int len; |
Behdad Esfahbod | ea93e7b | 2011-05-11 23:22:55 -0400 | [diff] [blame] | 101 | int freed = 0; |
| 102 | |
| 103 | face = hb_face_create_for_tables (get_table, &freed, free_up); |
| 104 | g_assert (!freed); |
| 105 | |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 106 | g_assert (hb_face_reference_table (face, HB_TAG ('h','e','a','d')) == hb_blob_get_empty ()); |
| 107 | |
| 108 | blob = hb_face_reference_table (face, HB_TAG ('a','b','c','d')); |
| 109 | g_assert (blob != hb_blob_get_empty ()); |
| 110 | |
| 111 | data = hb_blob_get_data (blob, &len); |
| 112 | g_assert_cmpint (len, ==, sizeof (test_data)); |
| 113 | g_assert (0 == memcmp (data, test_data, sizeof (test_data))); |
| 114 | hb_blob_destroy (blob); |
| 115 | |
| 116 | g_assert_cmpint (hb_face_get_upem (face), ==, 1000); |
| 117 | |
Behdad Esfahbod | ea93e7b | 2011-05-11 23:22:55 -0400 | [diff] [blame] | 118 | hb_face_destroy (face); |
| 119 | g_assert (freed); |
| 120 | } |
| 121 | |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 122 | static void |
| 123 | _test_font_nil_funcs (hb_font_t *font) |
| 124 | { |
Behdad Esfahbod | 0fd8c2f | 2011-05-12 15:14:13 -0400 | [diff] [blame] | 125 | hb_codepoint_t glyph; |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 126 | hb_position_t x, y; |
| 127 | hb_glyph_extents_t extents; |
Behdad Esfahbod | 88da7bb | 2015-10-02 14:38:20 +0100 | [diff] [blame] | 128 | unsigned int upem = hb_face_get_upem (hb_font_get_face (font)); |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 129 | |
| 130 | x = y = 13; |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 131 | g_assert (!hb_font_get_glyph_contour_point (font, 17, 2, &x, &y)); |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 132 | g_assert_cmpint (x, ==, 0); |
| 133 | g_assert_cmpint (y, ==, 0); |
| 134 | |
Behdad Esfahbod | 2d8ebcb | 2011-05-25 11:27:33 -0400 | [diff] [blame] | 135 | x = hb_font_get_glyph_h_advance (font, 17); |
Behdad Esfahbod | 88da7bb | 2015-10-02 14:38:20 +0100 | [diff] [blame] | 136 | g_assert_cmpint (x, ==, upem); |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 137 | |
| 138 | extents.x_bearing = extents.y_bearing = 13; |
| 139 | extents.width = extents.height = 15; |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 140 | hb_font_get_glyph_extents (font, 17, &extents); |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 141 | g_assert_cmpint (extents.x_bearing, ==, 0); |
| 142 | g_assert_cmpint (extents.y_bearing, ==, 0); |
| 143 | g_assert_cmpint (extents.width, ==, 0); |
| 144 | g_assert_cmpint (extents.height, ==, 0); |
| 145 | |
Behdad Esfahbod | 0fd8c2f | 2011-05-12 15:14:13 -0400 | [diff] [blame] | 146 | glyph = 3; |
| 147 | g_assert (!hb_font_get_glyph (font, 17, 2, &glyph)); |
| 148 | g_assert_cmpint (glyph, ==, 0); |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | static void |
| 152 | _test_fontfuncs_nil (hb_font_funcs_t *ffuncs) |
| 153 | { |
| 154 | hb_blob_t *blob; |
| 155 | hb_face_t *face; |
| 156 | hb_font_t *font; |
| 157 | hb_font_t *subfont; |
| 158 | int freed = 0; |
| 159 | |
| 160 | blob = hb_blob_create (test_data, sizeof (test_data), HB_MEMORY_MODE_READONLY, NULL, NULL); |
| 161 | face = hb_face_create (blob, 0); |
| 162 | hb_blob_destroy (blob); |
Behdad Esfahbod | 7fc5a30 | 2011-05-12 17:48:20 -0400 | [diff] [blame] | 163 | g_assert (!hb_face_is_immutable (face)); |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 164 | font = hb_font_create (face); |
Behdad Esfahbod | 744970a | 2011-05-16 18:15:37 -0400 | [diff] [blame] | 165 | g_assert (font); |
Behdad Esfahbod | 7fc5a30 | 2011-05-12 17:48:20 -0400 | [diff] [blame] | 166 | g_assert (hb_face_is_immutable (face)); |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 167 | hb_face_destroy (face); |
| 168 | |
| 169 | |
| 170 | hb_font_set_funcs (font, ffuncs, &freed, free_up); |
| 171 | g_assert_cmpint (freed, ==, 0); |
| 172 | |
| 173 | _test_font_nil_funcs (font); |
| 174 | |
| 175 | subfont = hb_font_create_sub_font (font); |
Behdad Esfahbod | 744970a | 2011-05-16 18:15:37 -0400 | [diff] [blame] | 176 | g_assert (subfont); |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 177 | |
| 178 | g_assert_cmpint (freed, ==, 0); |
| 179 | hb_font_destroy (font); |
| 180 | g_assert_cmpint (freed, ==, 0); |
| 181 | |
| 182 | _test_font_nil_funcs (subfont); |
| 183 | |
| 184 | hb_font_destroy (subfont); |
| 185 | g_assert_cmpint (freed, ==, 1); |
| 186 | } |
Behdad Esfahbod | ea93e7b | 2011-05-11 23:22:55 -0400 | [diff] [blame] | 187 | |
| 188 | static void |
| 189 | test_fontfuncs_empty (void) |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 190 | { |
| 191 | g_assert (hb_font_funcs_get_empty ()); |
| 192 | g_assert (hb_font_funcs_is_immutable (hb_font_funcs_get_empty ())); |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 193 | _test_fontfuncs_nil (hb_font_funcs_get_empty ()); |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | static void |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 197 | test_fontfuncs_nil (void) |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 198 | { |
Behdad Esfahbod | 14f1e81 | 2011-05-12 00:18:28 -0400 | [diff] [blame] | 199 | hb_font_funcs_t *ffuncs; |
| 200 | |
| 201 | ffuncs = hb_font_funcs_create (); |
| 202 | |
| 203 | g_assert (!hb_font_funcs_is_immutable (ffuncs)); |
| 204 | _test_fontfuncs_nil (hb_font_funcs_get_empty ()); |
| 205 | |
| 206 | hb_font_funcs_destroy (ffuncs); |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 207 | } |
| 208 | |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 209 | static hb_bool_t |
Behdad Esfahbod | dcfcb95 | 2018-09-30 18:14:50 +0200 | [diff] [blame] | 210 | contour_point_func1 (hb_font_t *font HB_UNUSED, void *font_data HB_UNUSED, |
| 211 | hb_codepoint_t glyph, unsigned int point_index HB_UNUSED, |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 212 | hb_position_t *x, hb_position_t *y, |
Behdad Esfahbod | dcfcb95 | 2018-09-30 18:14:50 +0200 | [diff] [blame] | 213 | void *user_data HB_UNUSED) |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 214 | { |
| 215 | if (glyph == 1) { |
| 216 | *x = 2; |
| 217 | *y = 3; |
| 218 | return TRUE; |
| 219 | } |
| 220 | if (glyph == 2) { |
| 221 | *x = 4; |
| 222 | *y = 5; |
| 223 | return TRUE; |
| 224 | } |
| 225 | |
| 226 | return FALSE; |
| 227 | } |
| 228 | |
| 229 | static hb_bool_t |
Behdad Esfahbod | dcfcb95 | 2018-09-30 18:14:50 +0200 | [diff] [blame] | 230 | contour_point_func2 (hb_font_t *font, void *font_data HB_UNUSED, |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 231 | hb_codepoint_t glyph, unsigned int point_index, |
| 232 | hb_position_t *x, hb_position_t *y, |
Behdad Esfahbod | dcfcb95 | 2018-09-30 18:14:50 +0200 | [diff] [blame] | 233 | void *user_data HB_UNUSED) |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 234 | { |
| 235 | if (glyph == 1) { |
| 236 | *x = 6; |
| 237 | *y = 7; |
| 238 | return TRUE; |
| 239 | } |
| 240 | |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 241 | return hb_font_get_glyph_contour_point (hb_font_get_parent (font), |
| 242 | glyph, point_index, x, y); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 243 | } |
| 244 | |
Behdad Esfahbod | 2d8ebcb | 2011-05-25 11:27:33 -0400 | [diff] [blame] | 245 | static hb_position_t |
Behdad Esfahbod | dcfcb95 | 2018-09-30 18:14:50 +0200 | [diff] [blame] | 246 | glyph_h_advance_func1 (hb_font_t *font HB_UNUSED, void *font_data HB_UNUSED, |
Behdad Esfahbod | 744970a | 2011-05-16 18:15:37 -0400 | [diff] [blame] | 247 | hb_codepoint_t glyph, |
Behdad Esfahbod | dcfcb95 | 2018-09-30 18:14:50 +0200 | [diff] [blame] | 248 | void *user_data HB_UNUSED) |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 249 | { |
Behdad Esfahbod | 2d8ebcb | 2011-05-25 11:27:33 -0400 | [diff] [blame] | 250 | if (glyph == 1) |
| 251 | return 8; |
| 252 | |
| 253 | return 0; |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | static void |
| 257 | test_fontfuncs_subclassing (void) |
| 258 | { |
| 259 | hb_blob_t *blob; |
| 260 | hb_face_t *face; |
| 261 | |
| 262 | hb_font_funcs_t *ffuncs1; |
| 263 | hb_font_funcs_t *ffuncs2; |
| 264 | |
| 265 | hb_font_t *font1; |
| 266 | hb_font_t *font2; |
| 267 | hb_font_t *font3; |
| 268 | |
| 269 | hb_position_t x; |
| 270 | hb_position_t y; |
| 271 | |
| 272 | blob = hb_blob_create (test_data, sizeof (test_data), HB_MEMORY_MODE_READONLY, NULL, NULL); |
| 273 | face = hb_face_create (blob, 0); |
| 274 | hb_blob_destroy (blob); |
| 275 | font1 = hb_font_create (face); |
| 276 | hb_face_destroy (face); |
| 277 | hb_font_set_scale (font1, 10, 10); |
| 278 | |
| 279 | /* setup font1 */ |
| 280 | ffuncs1 = hb_font_funcs_create (); |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 281 | hb_font_funcs_set_glyph_contour_point_func (ffuncs1, contour_point_func1, NULL, NULL); |
Behdad Esfahbod | 744970a | 2011-05-16 18:15:37 -0400 | [diff] [blame] | 282 | hb_font_funcs_set_glyph_h_advance_func (ffuncs1, glyph_h_advance_func1, NULL, NULL); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 283 | hb_font_set_funcs (font1, ffuncs1, NULL, NULL); |
| 284 | hb_font_funcs_destroy (ffuncs1); |
| 285 | |
| 286 | x = y = 1; |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 287 | g_assert (hb_font_get_glyph_contour_point_for_origin (font1, 1, 2, HB_DIRECTION_LTR, &x, &y)); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 288 | g_assert_cmpint (x, ==, 2); |
| 289 | g_assert_cmpint (y, ==, 3); |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 290 | g_assert (hb_font_get_glyph_contour_point_for_origin (font1, 2, 5, HB_DIRECTION_LTR, &x, &y)); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 291 | g_assert_cmpint (x, ==, 4); |
| 292 | g_assert_cmpint (y, ==, 5); |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 293 | g_assert (!hb_font_get_glyph_contour_point_for_origin (font1, 3, 7, HB_DIRECTION_RTL, &x, &y)); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 294 | g_assert_cmpint (x, ==, 0); |
| 295 | g_assert_cmpint (y, ==, 0); |
Behdad Esfahbod | 2d8ebcb | 2011-05-25 11:27:33 -0400 | [diff] [blame] | 296 | x = hb_font_get_glyph_h_advance (font1, 1); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 297 | g_assert_cmpint (x, ==, 8); |
Behdad Esfahbod | 2d8ebcb | 2011-05-25 11:27:33 -0400 | [diff] [blame] | 298 | x = hb_font_get_glyph_h_advance (font1, 2); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 299 | g_assert_cmpint (x, ==, 0); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 300 | |
Behdad Esfahbod | 1866e17 | 2015-10-02 14:21:29 +0100 | [diff] [blame] | 301 | /* creating sub-font doesn't make the parent font immutable; |
| 302 | * making a font immutable however makes it's lineage immutable. |
| 303 | */ |
| 304 | font2 = hb_font_create_sub_font (font1); |
| 305 | font3 = hb_font_create_sub_font (font2); |
| 306 | g_assert (!hb_font_is_immutable (font1)); |
| 307 | g_assert (!hb_font_is_immutable (font2)); |
| 308 | g_assert (!hb_font_is_immutable (font3)); |
| 309 | hb_font_make_immutable (font3); |
| 310 | g_assert (hb_font_is_immutable (font1)); |
| 311 | g_assert (hb_font_is_immutable (font2)); |
| 312 | g_assert (hb_font_is_immutable (font3)); |
| 313 | hb_font_destroy (font2); |
| 314 | hb_font_destroy (font3); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 315 | |
| 316 | font2 = hb_font_create_sub_font (font1); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 317 | hb_font_destroy (font1); |
| 318 | |
| 319 | /* setup font2 to override some funcs */ |
| 320 | ffuncs2 = hb_font_funcs_create (); |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 321 | hb_font_funcs_set_glyph_contour_point_func (ffuncs2, contour_point_func2, NULL, NULL); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 322 | hb_font_set_funcs (font2, ffuncs2, NULL, NULL); |
| 323 | hb_font_funcs_destroy (ffuncs2); |
| 324 | |
| 325 | x = y = 1; |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 326 | g_assert (hb_font_get_glyph_contour_point_for_origin (font2, 1, 2, HB_DIRECTION_LTR, &x, &y)); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 327 | g_assert_cmpint (x, ==, 6); |
| 328 | g_assert_cmpint (y, ==, 7); |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 329 | g_assert (hb_font_get_glyph_contour_point_for_origin (font2, 2, 5, HB_DIRECTION_RTL, &x, &y)); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 330 | g_assert_cmpint (x, ==, 4); |
| 331 | g_assert_cmpint (y, ==, 5); |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 332 | g_assert (!hb_font_get_glyph_contour_point_for_origin (font2, 3, 7, HB_DIRECTION_LTR, &x, &y)); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 333 | g_assert_cmpint (x, ==, 0); |
| 334 | g_assert_cmpint (y, ==, 0); |
Behdad Esfahbod | 2d8ebcb | 2011-05-25 11:27:33 -0400 | [diff] [blame] | 335 | x = hb_font_get_glyph_h_advance (font2, 1); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 336 | g_assert_cmpint (x, ==, 8); |
Behdad Esfahbod | 2d8ebcb | 2011-05-25 11:27:33 -0400 | [diff] [blame] | 337 | x = hb_font_get_glyph_h_advance (font2, 2); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 338 | g_assert_cmpint (x, ==, 0); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 339 | |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 340 | /* setup font3 to override scale */ |
Behdad Esfahbod | 1866e17 | 2015-10-02 14:21:29 +0100 | [diff] [blame] | 341 | font3 = hb_font_create_sub_font (font2); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 342 | hb_font_set_scale (font3, 20, 30); |
| 343 | |
| 344 | x = y = 1; |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 345 | g_assert (hb_font_get_glyph_contour_point_for_origin (font3, 1, 2, HB_DIRECTION_RTL, &x, &y)); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 346 | g_assert_cmpint (x, ==, 6*2); |
| 347 | g_assert_cmpint (y, ==, 7*3); |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 348 | g_assert (hb_font_get_glyph_contour_point_for_origin (font3, 2, 5, HB_DIRECTION_LTR, &x, &y)); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 349 | g_assert_cmpint (x, ==, 4*2); |
| 350 | g_assert_cmpint (y, ==, 5*3); |
Behdad Esfahbod | d316912 | 2011-05-25 11:01:32 -0400 | [diff] [blame] | 351 | g_assert (!hb_font_get_glyph_contour_point_for_origin (font3, 3, 7, HB_DIRECTION_LTR, &x, &y)); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 352 | g_assert_cmpint (x, ==, 0*2); |
| 353 | g_assert_cmpint (y, ==, 0*3); |
Behdad Esfahbod | 2d8ebcb | 2011-05-25 11:27:33 -0400 | [diff] [blame] | 354 | x = hb_font_get_glyph_h_advance (font3, 1); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 355 | g_assert_cmpint (x, ==, 8*2); |
Behdad Esfahbod | 2d8ebcb | 2011-05-25 11:27:33 -0400 | [diff] [blame] | 356 | x = hb_font_get_glyph_h_advance (font3, 2); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 357 | g_assert_cmpint (x, ==, 0*2); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 358 | |
| 359 | |
| 360 | hb_font_destroy (font3); |
Ebrahim Byagowi | ef9307f | 2018-09-22 16:45:31 +0330 | [diff] [blame] | 361 | hb_font_destroy (font2); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 362 | } |
| 363 | |
Behdad Esfahbod | 77d5c3d | 2018-10-19 19:01:01 -0700 | [diff] [blame] | 364 | static hb_bool_t |
| 365 | nominal_glyph_func (hb_font_t *font HB_UNUSED, |
| 366 | void *font_data HB_UNUSED, |
Ebrahim Byagowi | 8931bc4 | 2018-10-20 23:23:32 +0330 | [diff] [blame] | 367 | hb_codepoint_t unicode HB_UNUSED, |
Behdad Esfahbod | 77d5c3d | 2018-10-19 19:01:01 -0700 | [diff] [blame] | 368 | hb_codepoint_t *glyph, |
| 369 | void *user_data HB_UNUSED) |
| 370 | { |
| 371 | *glyph = 0; |
| 372 | return FALSE; |
| 373 | } |
| 374 | |
| 375 | static unsigned int |
| 376 | nominal_glyphs_func (hb_font_t *font HB_UNUSED, |
| 377 | void *font_data HB_UNUSED, |
| 378 | unsigned int count HB_UNUSED, |
| 379 | const hb_codepoint_t *first_unicode HB_UNUSED, |
| 380 | unsigned int unicode_stride HB_UNUSED, |
| 381 | hb_codepoint_t *first_glyph HB_UNUSED, |
| 382 | unsigned int glyph_stride HB_UNUSED, |
| 383 | void *user_data HB_UNUSED) |
| 384 | { |
| 385 | return 0; |
| 386 | } |
| 387 | |
| 388 | static void |
| 389 | test_fontfuncs_parallels (void) |
| 390 | { |
| 391 | hb_blob_t *blob; |
| 392 | hb_face_t *face; |
| 393 | |
| 394 | hb_font_funcs_t *ffuncs1; |
| 395 | hb_font_funcs_t *ffuncs2; |
| 396 | |
| 397 | hb_font_t *font0; |
| 398 | hb_font_t *font1; |
| 399 | hb_font_t *font2; |
Chun-wei Fan | 1e09add | 2018-12-12 01:32:01 +0800 | [diff] [blame] | 400 | hb_codepoint_t glyph; |
Behdad Esfahbod | 77d5c3d | 2018-10-19 19:01:01 -0700 | [diff] [blame] | 401 | |
| 402 | blob = hb_blob_create (test_data, sizeof (test_data), HB_MEMORY_MODE_READONLY, NULL, NULL); |
| 403 | face = hb_face_create (blob, 0); |
| 404 | hb_blob_destroy (blob); |
| 405 | font0 = hb_font_create (face); |
| 406 | hb_face_destroy (face); |
| 407 | |
| 408 | /* setup sub-font1 */ |
| 409 | font1 = hb_font_create_sub_font (font0); |
| 410 | hb_font_destroy (font0); |
| 411 | ffuncs1 = hb_font_funcs_create (); |
| 412 | hb_font_funcs_set_nominal_glyph_func (ffuncs1, nominal_glyph_func, NULL, NULL); |
| 413 | hb_font_set_funcs (font1, ffuncs1, NULL, NULL); |
| 414 | hb_font_funcs_destroy (ffuncs1); |
| 415 | |
| 416 | /* setup sub-font2 */ |
| 417 | font2 = hb_font_create_sub_font (font1); |
| 418 | hb_font_destroy (font1); |
| 419 | ffuncs2 = hb_font_funcs_create (); |
| 420 | hb_font_funcs_set_nominal_glyphs_func (ffuncs1, nominal_glyphs_func, NULL, NULL); |
| 421 | hb_font_set_funcs (font2, ffuncs2, NULL, NULL); |
| 422 | hb_font_funcs_destroy (ffuncs2); |
| 423 | |
| 424 | /* Just test that calling get_nominal_glyph doesn't infinite-loop. */ |
Behdad Esfahbod | 77d5c3d | 2018-10-19 19:01:01 -0700 | [diff] [blame] | 425 | hb_font_get_nominal_glyph (font2, 0x0020u, &glyph); |
Behdad Esfahbod | f11c557 | 2018-10-20 11:56:30 -0700 | [diff] [blame] | 426 | |
| 427 | hb_font_destroy (font2); |
Behdad Esfahbod | 77d5c3d | 2018-10-19 19:01:01 -0700 | [diff] [blame] | 428 | } |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 429 | |
| 430 | static void |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 431 | test_font_empty (void) |
| 432 | { |
Philip Withnall | a6ced90 | 2017-02-08 02:18:33 +0000 | [diff] [blame] | 433 | hb_font_t *created_from_empty; |
| 434 | hb_font_t *created_from_null; |
| 435 | hb_font_t *created_sub_from_null; |
| 436 | |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 437 | g_assert (hb_font_get_empty ()); |
Philip Withnall | a6ced90 | 2017-02-08 02:18:33 +0000 | [diff] [blame] | 438 | |
| 439 | created_from_empty = hb_font_create (hb_face_get_empty ()); |
| 440 | g_assert (hb_font_get_empty () != created_from_empty); |
| 441 | |
| 442 | created_from_null = hb_font_create (NULL); |
| 443 | g_assert (hb_font_get_empty () != created_from_null); |
| 444 | |
| 445 | created_sub_from_null = hb_font_create_sub_font (NULL); |
| 446 | g_assert (hb_font_get_empty () != created_sub_from_null); |
| 447 | |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 448 | g_assert (hb_font_is_immutable (hb_font_get_empty ())); |
Behdad Esfahbod | 74d9fa3 | 2011-05-11 23:07:47 -0400 | [diff] [blame] | 449 | |
| 450 | g_assert (hb_font_get_face (hb_font_get_empty ()) == hb_face_get_empty ()); |
| 451 | g_assert (hb_font_get_parent (hb_font_get_empty ()) == NULL); |
Philip Withnall | a6ced90 | 2017-02-08 02:18:33 +0000 | [diff] [blame] | 452 | |
| 453 | hb_font_destroy (created_sub_from_null); |
| 454 | hb_font_destroy (created_from_null); |
| 455 | hb_font_destroy (created_from_empty); |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 456 | } |
| 457 | |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 458 | static void |
| 459 | test_font_properties (void) |
| 460 | { |
| 461 | hb_blob_t *blob; |
| 462 | hb_face_t *face; |
| 463 | hb_font_t *font; |
Behdad Esfahbod | cdb1531 | 2011-05-11 23:12:58 -0400 | [diff] [blame] | 464 | hb_font_t *subfont; |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 465 | int x_scale, y_scale; |
| 466 | unsigned int x_ppem, y_ppem; |
Behdad Esfahbod | 88da7bb | 2015-10-02 14:38:20 +0100 | [diff] [blame] | 467 | unsigned int upem; |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 468 | |
| 469 | blob = hb_blob_create (test_data, sizeof (test_data), HB_MEMORY_MODE_READONLY, NULL, NULL); |
| 470 | face = hb_face_create (blob, 0); |
| 471 | hb_blob_destroy (blob); |
| 472 | font = hb_font_create (face); |
| 473 | hb_face_destroy (face); |
| 474 | |
| 475 | |
Behdad Esfahbod | db9f4eb | 2011-05-11 23:06:02 -0400 | [diff] [blame] | 476 | g_assert (hb_font_get_face (font) == face); |
Behdad Esfahbod | da29b43 | 2015-11-04 20:22:44 -0800 | [diff] [blame] | 477 | g_assert (hb_font_get_parent (font) == hb_font_get_empty ()); |
Behdad Esfahbod | 3e905e3 | 2015-10-08 12:51:02 -0400 | [diff] [blame] | 478 | subfont = hb_font_create_sub_font (font); |
| 479 | g_assert (hb_font_get_parent (subfont) == font); |
| 480 | hb_font_set_parent(subfont, NULL); |
| 481 | g_assert (hb_font_get_parent (subfont) == hb_font_get_empty()); |
| 482 | hb_font_set_parent(subfont, font); |
| 483 | g_assert (hb_font_get_parent (subfont) == font); |
| 484 | hb_font_set_parent(subfont, NULL); |
| 485 | hb_font_make_immutable (subfont); |
| 486 | g_assert (hb_font_get_parent (subfont) == hb_font_get_empty()); |
| 487 | hb_font_set_parent(subfont, font); |
| 488 | g_assert (hb_font_get_parent (subfont) == hb_font_get_empty()); |
| 489 | hb_font_destroy (subfont); |
Behdad Esfahbod | db9f4eb | 2011-05-11 23:06:02 -0400 | [diff] [blame] | 490 | |
| 491 | |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 492 | /* Check scale */ |
| 493 | |
Behdad Esfahbod | 88da7bb | 2015-10-02 14:38:20 +0100 | [diff] [blame] | 494 | upem = hb_face_get_upem (hb_font_get_face (font)); |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 495 | hb_font_get_scale (font, NULL, NULL); |
| 496 | x_scale = y_scale = 13; |
| 497 | hb_font_get_scale (font, &x_scale, NULL); |
Behdad Esfahbod | 88da7bb | 2015-10-02 14:38:20 +0100 | [diff] [blame] | 498 | g_assert_cmpint (x_scale, ==, upem); |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 499 | x_scale = y_scale = 13; |
| 500 | hb_font_get_scale (font, NULL, &y_scale); |
Behdad Esfahbod | 88da7bb | 2015-10-02 14:38:20 +0100 | [diff] [blame] | 501 | g_assert_cmpint (y_scale, ==, upem); |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 502 | x_scale = y_scale = 13; |
| 503 | hb_font_get_scale (font, &x_scale, &y_scale); |
Behdad Esfahbod | 88da7bb | 2015-10-02 14:38:20 +0100 | [diff] [blame] | 504 | g_assert_cmpint (x_scale, ==, upem); |
| 505 | g_assert_cmpint (y_scale, ==, upem); |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 506 | |
| 507 | hb_font_set_scale (font, 17, 19); |
| 508 | |
| 509 | x_scale = y_scale = 13; |
| 510 | hb_font_get_scale (font, &x_scale, &y_scale); |
| 511 | g_assert_cmpint (x_scale, ==, 17); |
| 512 | g_assert_cmpint (y_scale, ==, 19); |
| 513 | |
| 514 | |
| 515 | /* Check ppem */ |
| 516 | |
| 517 | hb_font_get_ppem (font, NULL, NULL); |
| 518 | x_ppem = y_ppem = 13; |
| 519 | hb_font_get_ppem (font, &x_ppem, NULL); |
| 520 | g_assert_cmpint (x_ppem, ==, 0); |
| 521 | x_ppem = y_ppem = 13; |
| 522 | hb_font_get_ppem (font, NULL, &y_ppem); |
| 523 | g_assert_cmpint (y_ppem, ==, 0); |
| 524 | x_ppem = y_ppem = 13; |
| 525 | hb_font_get_ppem (font, &x_ppem, &y_ppem); |
| 526 | g_assert_cmpint (x_ppem, ==, 0); |
| 527 | g_assert_cmpint (y_ppem, ==, 0); |
| 528 | |
| 529 | hb_font_set_ppem (font, 17, 19); |
| 530 | |
| 531 | x_ppem = y_ppem = 13; |
| 532 | hb_font_get_ppem (font, &x_ppem, &y_ppem); |
| 533 | g_assert_cmpint (x_ppem, ==, 17); |
| 534 | g_assert_cmpint (y_ppem, ==, 19); |
| 535 | |
Behdad Esfahbod | 777c224 | 2018-11-04 02:40:20 -0500 | [diff] [blame] | 536 | /* Check ptem */ |
| 537 | g_assert_cmpint (hb_font_get_ptem (font), ==, 0); |
| 538 | hb_font_set_ptem (font, 42); |
| 539 | g_assert_cmpint (hb_font_get_ptem (font), ==, 42); |
| 540 | |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 541 | |
| 542 | /* Check immutable */ |
| 543 | |
| 544 | g_assert (!hb_font_is_immutable (font)); |
| 545 | hb_font_make_immutable (font); |
| 546 | g_assert (hb_font_is_immutable (font)); |
| 547 | |
| 548 | hb_font_set_scale (font, 10, 12); |
| 549 | x_scale = y_scale = 13; |
| 550 | hb_font_get_scale (font, &x_scale, &y_scale); |
| 551 | g_assert_cmpint (x_scale, ==, 17); |
| 552 | g_assert_cmpint (y_scale, ==, 19); |
| 553 | |
| 554 | hb_font_set_ppem (font, 10, 12); |
| 555 | x_ppem = y_ppem = 13; |
| 556 | hb_font_get_ppem (font, &x_ppem, &y_ppem); |
| 557 | g_assert_cmpint (x_ppem, ==, 17); |
| 558 | g_assert_cmpint (y_ppem, ==, 19); |
| 559 | |
| 560 | |
Behdad Esfahbod | cdb1531 | 2011-05-11 23:12:58 -0400 | [diff] [blame] | 561 | /* sub_font now */ |
| 562 | subfont = hb_font_create_sub_font (font); |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 563 | hb_font_destroy (font); |
Behdad Esfahbod | cdb1531 | 2011-05-11 23:12:58 -0400 | [diff] [blame] | 564 | |
| 565 | g_assert (hb_font_get_parent (subfont) == font); |
| 566 | g_assert (hb_font_get_face (subfont) == face); |
| 567 | |
| 568 | /* scale */ |
| 569 | x_scale = y_scale = 13; |
| 570 | hb_font_get_scale (subfont, &x_scale, &y_scale); |
| 571 | g_assert_cmpint (x_scale, ==, 17); |
| 572 | g_assert_cmpint (y_scale, ==, 19); |
| 573 | hb_font_set_scale (subfont, 10, 12); |
| 574 | x_scale = y_scale = 13; |
| 575 | hb_font_get_scale (subfont, &x_scale, &y_scale); |
| 576 | g_assert_cmpint (x_scale, ==, 10); |
| 577 | g_assert_cmpint (y_scale, ==, 12); |
| 578 | x_scale = y_scale = 13; |
| 579 | hb_font_get_scale (font, &x_scale, &y_scale); |
| 580 | g_assert_cmpint (x_scale, ==, 17); |
| 581 | g_assert_cmpint (y_scale, ==, 19); |
| 582 | |
| 583 | /* ppem */ |
| 584 | x_ppem = y_ppem = 13; |
| 585 | hb_font_get_ppem (subfont, &x_ppem, &y_ppem); |
| 586 | g_assert_cmpint (x_ppem, ==, 17); |
| 587 | g_assert_cmpint (y_ppem, ==, 19); |
| 588 | hb_font_set_ppem (subfont, 10, 12); |
| 589 | x_ppem = y_ppem = 13; |
| 590 | hb_font_get_ppem (subfont, &x_ppem, &y_ppem); |
| 591 | g_assert_cmpint (x_ppem, ==, 10); |
| 592 | g_assert_cmpint (y_ppem, ==, 12); |
| 593 | x_ppem = y_ppem = 13; |
| 594 | hb_font_get_ppem (font, &x_ppem, &y_ppem); |
| 595 | g_assert_cmpint (x_ppem, ==, 17); |
| 596 | g_assert_cmpint (y_ppem, ==, 19); |
| 597 | |
| 598 | hb_font_destroy (subfont); |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 599 | } |
| 600 | |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 601 | int |
| 602 | main (int argc, char **argv) |
| 603 | { |
| 604 | hb_test_init (&argc, &argv); |
| 605 | |
| 606 | hb_test_add (test_face_empty); |
Behdad Esfahbod | 2ca0b5a | 2011-05-11 23:57:36 -0400 | [diff] [blame] | 607 | hb_test_add (test_face_create); |
| 608 | hb_test_add (test_face_createfortables); |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 609 | |
Behdad Esfahbod | ea93e7b | 2011-05-11 23:22:55 -0400 | [diff] [blame] | 610 | hb_test_add (test_fontfuncs_empty); |
Behdad Esfahbod | f2c1dd4 | 2011-05-12 00:35:12 -0400 | [diff] [blame] | 611 | hb_test_add (test_fontfuncs_nil); |
| 612 | hb_test_add (test_fontfuncs_subclassing); |
Behdad Esfahbod | 77d5c3d | 2018-10-19 19:01:01 -0700 | [diff] [blame] | 613 | hb_test_add (test_fontfuncs_parallels); |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 614 | |
| 615 | hb_test_add (test_font_empty); |
Behdad Esfahbod | 606923b | 2011-05-11 23:05:02 -0400 | [diff] [blame] | 616 | hb_test_add (test_font_properties); |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 617 | |
Behdad Esfahbod | da603e8 | 2011-05-11 22:52:35 -0400 | [diff] [blame] | 618 | return hb_test_run(); |
| 619 | } |