2 * Copyright © 2011 Codethink Limited
3 * Copyright © 2011 Google, Inc.
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 * Codethink Author(s): Ryan Lortie
26 * Google Author(s): Behdad Esfahbod
31 /* Unit tests for hb-unicode.h */
42 /* Some useful stuff */
44 #define MAGIC0 0x12345678
45 #define MAGIC1 0x76543210
52 static void free_up (void *p)
54 data_t *data = (data_t *) p;
56 g_assert (data->value == MAGIC0 || data->value == MAGIC1);
57 g_assert (data->freed == FALSE);
62 simple_get_script (hb_unicode_funcs_t *ufuncs,
63 hb_codepoint_t codepoint,
66 data_t *data = (data_t *) user_data;
68 g_assert (hb_unicode_funcs_get_parent (ufuncs) == NULL);
69 g_assert (data->value == MAGIC0);
70 g_assert (data->freed == FALSE);
72 if ('a' <= codepoint && codepoint <= 'z')
73 return HB_SCRIPT_LATIN;
75 return HB_SCRIPT_UNKNOWN;
79 a_is_for_arabic_get_script (hb_unicode_funcs_t *ufuncs,
80 hb_codepoint_t codepoint,
83 data_t *data = (data_t *) user_data;
85 g_assert (hb_unicode_funcs_get_parent (ufuncs) != NULL);
86 g_assert (data->value == MAGIC1);
87 g_assert (data->freed == FALSE);
89 if (codepoint == 'a') {
90 return HB_SCRIPT_ARABIC;
92 hb_unicode_funcs_t *parent = hb_unicode_funcs_get_parent (ufuncs);
94 return hb_unicode_get_script (parent, codepoint);
100 /* Check all properties */
102 /* Some of the following tables where adapted from glib/glib/tests/utf8-misc.c.
103 * The license is compatible. */
106 hb_codepoint_t unicode;
110 static const test_pair_t combining_class_tests[] =
148 static const test_pair_t combining_class_tests_more[] =
150 /* Unicode-5.2 character additions */
153 /* Unicode-6.0 character additions */
159 static const test_pair_t eastasian_width_tests[] =
200 static const test_pair_t eastasian_width_tests_more[] =
202 /* Default Wide blocks */
211 /* Uniode-5.2 character additions */
215 /* Uniode-6.0 character additions */
223 static const test_pair_t general_category_tests[] =
225 { 0x000D, HB_UNICODE_GENERAL_CATEGORY_CONTROL },
226 { 0x200E, HB_UNICODE_GENERAL_CATEGORY_FORMAT },
227 { 0x0378, HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED },
228 { 0xE000, HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE },
229 { 0xD800, HB_UNICODE_GENERAL_CATEGORY_SURROGATE },
230 { 0x0061, HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER },
231 { 0x02B0, HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER },
232 { 0x3400, HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER },
233 { 0x01C5, HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER },
234 { 0xFF21, HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER },
235 { 0x0903, HB_UNICODE_GENERAL_CATEGORY_COMBINING_MARK },
236 { 0x20DD, HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK },
237 { 0xA806, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK },
238 { 0xFF10, HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER },
239 { 0x16EE, HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER },
240 { 0x17F0, HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER },
241 { 0x005F, HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION },
242 { 0x058A, HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION },
243 { 0x0F3B, HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION },
244 { 0x2019, HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION },
245 { 0x2018, HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION },
246 { 0x2016, HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION },
247 { 0x0F3A, HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION },
248 { 0x20A0, HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL },
249 { 0x309B, HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL },
250 { 0xFB29, HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL },
251 { 0x00A6, HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL },
252 { 0x2028, HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR },
253 { 0x2029, HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR },
254 { 0x202F, HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR },
256 { 0x111111, HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED }
258 static const test_pair_t general_category_tests_more[] =
260 /* Unicode-5.2 character additions */
261 { 0x1F131, HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL },
263 /* Unicode-6.0 character additions */
264 { 0x0620, HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER },
266 { 0x111111, HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED }
269 static const test_pair_t mirroring_tests[] =
271 /* Some characters that do NOT mirror */
276 { 0xE01EF, 0xE01EF },
277 { 0x1D7C3, 0x1D7C3 },
278 { 0x100000, 0x100000 },
280 /* Some characters that do mirror */
300 { 0x111111, 0x111111 },
302 static const test_pair_t mirroring_tests_more[] =
304 /* No new mirroring characters have been encoded in recent Unicode versions. */
305 { 0x111111, 0x111111 }
308 static const test_pair_t script_tests[] =
310 { 0x002A, HB_SCRIPT_COMMON },
311 { 0x0670, HB_SCRIPT_INHERITED },
312 { 0x060D, HB_SCRIPT_ARABIC },
313 { 0x0559, HB_SCRIPT_ARMENIAN },
314 { 0x09CD, HB_SCRIPT_BENGALI },
315 { 0x31B6, HB_SCRIPT_BOPOMOFO },
316 { 0x13A2, HB_SCRIPT_CHEROKEE },
317 { 0x2CFD, HB_SCRIPT_COPTIC },
318 { 0x0482, HB_SCRIPT_CYRILLIC },
319 { 0x10401, HB_SCRIPT_DESERET },
320 { 0x094D, HB_SCRIPT_DEVANAGARI },
321 { 0x1258, HB_SCRIPT_ETHIOPIC },
322 { 0x10FC, HB_SCRIPT_GEORGIAN },
323 { 0x10341, HB_SCRIPT_GOTHIC },
324 { 0x0375, HB_SCRIPT_GREEK },
325 { 0x0A83, HB_SCRIPT_GUJARATI },
326 { 0x0A3C, HB_SCRIPT_GURMUKHI },
327 { 0x3005, HB_SCRIPT_HAN },
328 { 0x1100, HB_SCRIPT_HANGUL },
329 { 0x05BF, HB_SCRIPT_HEBREW },
330 { 0x309F, HB_SCRIPT_HIRAGANA },
331 { 0x0CBC, HB_SCRIPT_KANNADA },
332 { 0x30FF, HB_SCRIPT_KATAKANA },
333 { 0x17DD, HB_SCRIPT_KHMER },
334 { 0x0EDD, HB_SCRIPT_LAO },
335 { 0x0061, HB_SCRIPT_LATIN },
336 { 0x0D3D, HB_SCRIPT_MALAYALAM },
337 { 0x1843, HB_SCRIPT_MONGOLIAN },
338 { 0x1031, HB_SCRIPT_MYANMAR },
339 { 0x169C, HB_SCRIPT_OGHAM },
340 { 0x10322, HB_SCRIPT_OLD_ITALIC },
341 { 0x0B3C, HB_SCRIPT_ORIYA },
342 { 0x16EF, HB_SCRIPT_RUNIC },
343 { 0x0DBD, HB_SCRIPT_SINHALA },
344 { 0x0711, HB_SCRIPT_SYRIAC },
345 { 0x0B82, HB_SCRIPT_TAMIL },
346 { 0x0C03, HB_SCRIPT_TELUGU },
347 { 0x07B1, HB_SCRIPT_THAANA },
348 { 0x0E31, HB_SCRIPT_THAI },
349 { 0x0FD4, HB_SCRIPT_TIBETAN },
350 { 0x1401, HB_SCRIPT_CANADIAN_ABORIGINAL },
351 { 0xA015, HB_SCRIPT_YI },
352 { 0x1700, HB_SCRIPT_TAGALOG },
353 { 0x1720, HB_SCRIPT_HANUNOO },
354 { 0x1740, HB_SCRIPT_BUHID },
355 { 0x1760, HB_SCRIPT_TAGBANWA },
357 /* Unicode-4.0 additions */
358 { 0x2800, HB_SCRIPT_BRAILLE },
359 { 0x10808, HB_SCRIPT_CYPRIOT },
360 { 0x1932, HB_SCRIPT_LIMBU },
361 { 0x10480, HB_SCRIPT_OSMANYA },
362 { 0x10450, HB_SCRIPT_SHAVIAN },
363 { 0x10000, HB_SCRIPT_LINEAR_B },
364 { 0x1950, HB_SCRIPT_TAI_LE },
365 { 0x1039F, HB_SCRIPT_UGARITIC },
367 /* Unicode-4.1 additions */
368 { 0x1980, HB_SCRIPT_NEW_TAI_LUE },
369 { 0x1A1F, HB_SCRIPT_BUGINESE },
370 { 0x2C00, HB_SCRIPT_GLAGOLITIC },
371 { 0x2D6F, HB_SCRIPT_TIFINAGH },
372 { 0xA800, HB_SCRIPT_SYLOTI_NAGRI },
373 { 0x103D0, HB_SCRIPT_OLD_PERSIAN },
374 { 0x10A3F, HB_SCRIPT_KHAROSHTHI },
376 /* Unicode-5.0 additions */
377 { 0x0378, HB_SCRIPT_UNKNOWN },
378 { 0x1B04, HB_SCRIPT_BALINESE },
379 { 0x12000, HB_SCRIPT_CUNEIFORM },
380 { 0x10900, HB_SCRIPT_PHOENICIAN },
381 { 0xA840, HB_SCRIPT_PHAGS_PA },
382 { 0x07C0, HB_SCRIPT_NKO },
384 /* Unicode-5.1 additions */
385 { 0xA900, HB_SCRIPT_KAYAH_LI },
386 { 0x1C00, HB_SCRIPT_LEPCHA },
387 { 0xA930, HB_SCRIPT_REJANG },
388 { 0x1B80, HB_SCRIPT_SUNDANESE },
389 { 0xA880, HB_SCRIPT_SAURASHTRA },
390 { 0xAA00, HB_SCRIPT_CHAM },
391 { 0x1C50, HB_SCRIPT_OL_CHIKI },
392 { 0xA500, HB_SCRIPT_VAI },
393 { 0x102A0, HB_SCRIPT_CARIAN },
394 { 0x10280, HB_SCRIPT_LYCIAN },
395 { 0x1093F, HB_SCRIPT_LYDIAN },
397 { 0x111111, HB_SCRIPT_UNKNOWN }
399 static const test_pair_t script_tests_more[] =
401 /* Unicode-5.2 additions */
402 { 0x10B00, HB_SCRIPT_AVESTAN },
403 { 0xA6A0, HB_SCRIPT_BAMUM },
404 { 0x13000, HB_SCRIPT_EGYPTIAN_HIEROGLYPHS },
405 { 0x10840, HB_SCRIPT_IMPERIAL_ARAMAIC },
406 { 0x10B60, HB_SCRIPT_INSCRIPTIONAL_PAHLAVI },
407 { 0x10B40, HB_SCRIPT_INSCRIPTIONAL_PARTHIAN },
408 { 0xA980, HB_SCRIPT_JAVANESE },
409 { 0x11082, HB_SCRIPT_KAITHI },
410 { 0xA4D0, HB_SCRIPT_LISU },
411 { 0xABE5, HB_SCRIPT_MEETEI_MAYEK },
412 { 0x10A60, HB_SCRIPT_OLD_SOUTH_ARABIAN },
413 { 0x10C00, HB_SCRIPT_OLD_TURKIC },
414 { 0x0800, HB_SCRIPT_SAMARITAN },
415 { 0x1A20, HB_SCRIPT_TAI_THAM },
416 { 0xAA80, HB_SCRIPT_TAI_VIET },
418 /* Unicode-6.0 additions */
419 { 0x1BC0, HB_SCRIPT_BATAK },
420 { 0x11000, HB_SCRIPT_BRAHMI },
421 { 0x0840, HB_SCRIPT_MANDAIC },
423 /* Unicode-5.2 character additions */
424 { 0x1CED, HB_SCRIPT_INHERITED },
425 { 0x1400, HB_SCRIPT_CANADIAN_ABORIGINAL },
427 { 0x111111, HB_SCRIPT_UNKNOWN }
431 typedef unsigned int (*get_func_t) (hb_unicode_funcs_t *ufuncs,
432 hb_codepoint_t unicode,
434 typedef unsigned int (*func_setter_func_t) (hb_unicode_funcs_t *ufuncs,
437 hb_destroy_func_t destroy);
438 typedef unsigned int (*getter_func_t) (hb_unicode_funcs_t *ufuncs,
439 hb_codepoint_t unicode);
443 func_setter_func_t func_setter;
444 getter_func_t getter;
445 const test_pair_t *tests;
446 unsigned int num_tests;
447 const test_pair_t *tests_more;
448 unsigned int num_tests_more;
449 unsigned int default_value;
452 #define RETURNS_UNICODE_ITSELF ((unsigned int) -1)
454 #define PROPERTY(name, DEFAULT) \
457 (func_setter_func_t) hb_unicode_funcs_set_##name##_func, \
458 (getter_func_t) hb_unicode_get_##name, \
460 G_N_ELEMENTS (name##_tests), \
462 G_N_ELEMENTS (name##_tests_more), \
465 static const property_t properties[] =
467 PROPERTY (combining_class, 0),
468 PROPERTY (eastasian_width, 1),
469 PROPERTY (general_category, (unsigned int) HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER),
470 PROPERTY (mirroring, RETURNS_UNICODE_ITSELF),
471 PROPERTY (script, (unsigned int) HB_SCRIPT_UNKNOWN),
476 test_unicode_properties (gconstpointer user_data)
478 hb_unicode_funcs_t *uf = (hb_unicode_funcs_t *) user_data;
480 gboolean failed = TRUE;
482 g_assert (hb_unicode_funcs_is_immutable (uf));
484 for (i = 0; i < G_N_ELEMENTS (properties); i++) {
485 const property_t *p = &properties[i];
486 const test_pair_t *tests;
488 g_test_message ("Testing property %s", p->name);
490 for (j = 0; j < p->num_tests; j++) {
491 g_test_message ("Test %s #%d: U+%04X", p->name, j, tests[j].unicode);
492 g_assert_cmphex (p->getter (uf, tests[j].unicode), ==, tests[j].value);
494 /* These tests are from Unicode 5.2 onward and older glib/ICU
495 * don't get them right. Just warn instead of assert. */
496 tests = p->tests_more;
497 for (j = 0; j < p->num_tests_more; j++) {
498 g_test_message ("Test %s more #%d: U+%04X", p->name, j, tests[j].unicode);
499 if (p->getter (uf, tests[j].unicode) != tests[j].value) {
500 g_test_message ("Soft fail: Received %x, expected %x", p->getter (uf, tests[j].unicode), tests[j].value);
507 g_message ("Some property tests failed. You probably have an old version of one of the libraries used. Rerun with --verbose for details");
510 static hb_codepoint_t
511 default_value (hb_codepoint_t default_value, hb_codepoint_t unicode)
513 return default_value == RETURNS_UNICODE_ITSELF ? unicode : default_value;
517 _test_unicode_properties_nil (hb_unicode_funcs_t *uf)
521 for (i = 0; i < G_N_ELEMENTS (properties); i++) {
522 const property_t *p = &properties[i];
523 const test_pair_t *tests;
525 g_test_message ("Testing property %s", p->name);
527 for (j = 0; j < p->num_tests; j++) {
528 g_test_message ("Test %s #%d: U+%04X", p->name, j, tests[j].unicode);
529 g_assert_cmphex (p->getter (uf, tests[j].unicode), ==, default_value (p->default_value, tests[j].unicode));
531 tests = p->tests_more;
532 for (j = 0; j < p->num_tests_more; j++) {
533 g_test_message ("Test %s more #%d: U+%04X", p->name, j, tests[j].unicode);
534 g_assert_cmphex (p->getter (uf, tests[j].unicode), ==, default_value (p->default_value, tests[j].unicode));
540 test_unicode_properties_nil (void)
542 hb_unicode_funcs_t *uf = hb_unicode_funcs_create (NULL);
544 g_assert (!hb_unicode_funcs_is_immutable (uf));
545 _test_unicode_properties_nil (uf);
547 hb_unicode_funcs_destroy (uf);
552 test_unicode_chainup (void)
554 hb_unicode_funcs_t *uf, *uf2;
556 /* Chain-up to nil */
558 uf = hb_unicode_funcs_create (NULL);
559 g_assert (!hb_unicode_funcs_is_immutable (uf));
561 uf2 = hb_unicode_funcs_create (uf);
562 g_assert (hb_unicode_funcs_is_immutable (uf));
563 hb_unicode_funcs_destroy (uf);
565 g_assert (!hb_unicode_funcs_is_immutable (uf2));
566 _test_unicode_properties_nil (uf2);
568 hb_unicode_funcs_destroy (uf2);
570 /* Chain-up to default */
572 uf = hb_unicode_funcs_create (hb_unicode_funcs_get_default ());
573 g_assert (!hb_unicode_funcs_is_immutable (uf));
575 uf2 = hb_unicode_funcs_create (uf);
576 g_assert (hb_unicode_funcs_is_immutable (uf));
577 hb_unicode_funcs_destroy (uf);
579 g_assert (!hb_unicode_funcs_is_immutable (uf2));
580 hb_unicode_funcs_make_immutable (uf2);
581 test_unicode_properties (uf2);
583 hb_unicode_funcs_destroy (uf2);
588 test_unicode_setters (void)
590 hb_unicode_funcs_t *uf;
593 /* This is cruel: we use script-returning functions to test all properties,
596 for (i = 0; i < G_N_ELEMENTS (properties); i++) {
597 const property_t *p = &properties[i];
598 data_t data[2] = {{MAGIC0, FALSE}, {MAGIC1, FALSE}};
600 g_test_message ("Testing property %s", p->name);
602 uf = hb_unicode_funcs_create (NULL);
603 g_assert (!hb_unicode_funcs_is_immutable (uf));
605 p->func_setter (uf, (get_func_t) simple_get_script, &data[0], free_up);
607 g_assert_cmphex (p->getter (uf, 'a'), ==, HB_SCRIPT_LATIN);
608 g_assert_cmphex (p->getter (uf, '0'), ==, HB_SCRIPT_UNKNOWN);
610 g_assert (!hb_unicode_funcs_is_immutable (uf));
611 hb_unicode_funcs_make_immutable (uf);
612 g_assert (hb_unicode_funcs_is_immutable (uf));
614 /* Since uf is immutable now, the following setter should do nothing. */
615 p->func_setter (uf, (get_func_t) a_is_for_arabic_get_script, &data[1], free_up);
617 g_assert (!data[0].freed && !data[1].freed);
618 hb_unicode_funcs_destroy (uf);
619 g_assert (data[0].freed && !data[1].freed);
621 hb_unicode_funcs_destroy (uf);
632 data_fixture_init (data_fixture_t *f, gconstpointer user_data)
634 f->data[0].value = MAGIC0;
635 f->data[1].value = MAGIC1;
638 data_fixture_finish (data_fixture_t *f, gconstpointer user_data)
643 test_unicode_subclassing_nil (data_fixture_t *f, gconstpointer user_data)
645 hb_unicode_funcs_t *uf, *aa;
647 uf = hb_unicode_funcs_create (NULL);
649 aa = hb_unicode_funcs_create (uf);
651 hb_unicode_funcs_destroy (uf);
653 hb_unicode_funcs_set_script_func (aa, a_is_for_arabic_get_script,
654 &f->data[1], free_up);
656 g_assert_cmphex (hb_unicode_get_script (aa, 'a'), ==, HB_SCRIPT_ARABIC);
657 g_assert_cmphex (hb_unicode_get_script (aa, 'b'), ==, HB_SCRIPT_UNKNOWN);
659 g_assert (!f->data[0].freed && !f->data[1].freed);
660 hb_unicode_funcs_destroy (aa);
661 g_assert (!f->data[0].freed && f->data[1].freed);
665 test_unicode_subclassing_default (data_fixture_t *f, gconstpointer user_data)
667 hb_unicode_funcs_t *uf, *aa;
669 uf = hb_unicode_funcs_get_default ();
670 aa = hb_unicode_funcs_create (uf);
672 hb_unicode_funcs_set_script_func (aa, a_is_for_arabic_get_script,
673 &f->data[1], free_up);
675 g_assert_cmphex (hb_unicode_get_script (aa, 'a'), ==, HB_SCRIPT_ARABIC);
676 g_assert_cmphex (hb_unicode_get_script (aa, 'b'), ==, HB_SCRIPT_LATIN);
678 g_assert (!f->data[0].freed && !f->data[1].freed);
679 hb_unicode_funcs_destroy (aa);
680 g_assert (!f->data[0].freed && f->data[1].freed);
684 test_unicode_subclassing_deep (data_fixture_t *f, gconstpointer user_data)
686 hb_unicode_funcs_t *uf, *aa;
688 uf = hb_unicode_funcs_create (NULL);
690 hb_unicode_funcs_set_script_func (uf, simple_get_script,
691 &f->data[0], free_up);
693 aa = hb_unicode_funcs_create (uf);
695 hb_unicode_funcs_destroy (uf);
697 /* make sure the 'uf' didn't get freed, since 'aa' holds a ref */
698 g_assert (!f->data[0].freed);
700 hb_unicode_funcs_set_script_func (aa, a_is_for_arabic_get_script,
701 &f->data[1], free_up);
703 g_assert_cmphex (hb_unicode_get_script (aa, 'a'), ==, HB_SCRIPT_ARABIC);
704 g_assert_cmphex (hb_unicode_get_script (aa, 'b'), ==, HB_SCRIPT_LATIN);
705 g_assert_cmphex (hb_unicode_get_script (aa, '0'), ==, HB_SCRIPT_UNKNOWN);
707 g_assert (!f->data[0].freed && !f->data[1].freed);
708 hb_unicode_funcs_destroy (aa);
709 g_assert (f->data[0].freed && f->data[1].freed);
714 main (int argc, char **argv)
716 hb_test_init (&argc, &argv);
718 hb_test_add (test_unicode_properties_nil);
720 hb_test_add_data_flavor (hb_unicode_funcs_get_default (), "default", test_unicode_properties);
722 hb_test_add_data_flavor (hb_glib_get_unicode_funcs (), "glib", test_unicode_properties);
725 hb_test_add_data_flavor (hb_icu_get_unicode_funcs (), "icu", test_unicode_properties);
728 hb_test_add (test_unicode_chainup);
730 hb_test_add (test_unicode_setters);
732 hb_test_add_fixture (data_fixture, NULL, test_unicode_subclassing_nil);
733 hb_test_add_fixture (data_fixture, NULL, test_unicode_subclassing_default);
734 hb_test_add_fixture (data_fixture, NULL, test_unicode_subclassing_deep);
736 /* XXX test glib & icu two-way script conversion */
738 return hb_test_run ();