diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-01-10 12:59:25 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-02-17 14:01:09 -0600 |
commit | 5d605a632d092d1dcfb548af5b1120d1e3189389 (patch) | |
tree | c4100d044cc67501eb8fe22432a57e1fd25f74bb | |
parent | 536fbc944d0298ec447114db3ba701a3e9e82af3 (diff) | |
download | pango-5d605a632d092d1dcfb548af5b1120d1e3189389.tar.gz |
Drop test-ot-tags
-rw-r--r-- | tests/meson.build | 3 | ||||
-rw-r--r-- | tests/test-ot-tags.c | 135 |
2 files changed, 0 insertions, 138 deletions
diff --git a/tests/meson.build b/tests/meson.build index 84fe3370..de054f79 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -31,9 +31,6 @@ tests = [ if build_pangoft2 test_cflags += '-DHAVE_FREETYPE' - tests += [ - [ 'test-ot-tags', [ 'test-ot-tags.c' ], [ libpangoft2_dep ] ], - ] endif if cairo_dep.found() diff --git a/tests/test-ot-tags.c b/tests/test-ot-tags.c deleted file mode 100644 index e4acbfa6..00000000 --- a/tests/test-ot-tags.c +++ /dev/null @@ -1,135 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* Pango - * testscript.c: Test cases for PangoScriptIter - * - * Copyright (C) 2002 Red Hat Software - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#undef PANGO_DISABLE_DEPRECATED -#include <pango/pango-ot.h> - -#undef VERBOSE - -#define ASSERT(stmt) G_STMT_START { \ - if (stmt) { } \ - else \ - { \ - g_warning ("%s:%d (%s): assertion '%s' failed", \ - __FILE__, __LINE__, G_STRFUNC, #stmt); \ - exit (1); \ - } \ -} G_STMT_END - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - -static void -test_script_tags (void) -{ - gunichar ch; - PangoScript i, max_script; - - /* we need to know what the maximum script number is. but we don't - * provide an api for that. instead of looking into internal tables, - * we'll go over all chars and see what their script is, taking the max! - */ - - max_script = PANGO_SCRIPT_INVALID_CODE; - for (ch = 0; ch <= 0x10FFFF; ch++) - max_script = MAX (max_script, pango_script_for_unichar (ch)); - - for (i = PANGO_SCRIPT_COMMON; i <= max_script; i++) - { - PangoOTTag tag = pango_ot_tag_from_script (i); - PangoScript j = pango_ot_tag_to_script (tag); - - if (tag == FT_MAKE_TAG ('k', 'a', 'n', 'a')) - { - /* Hiragana and Katakana both map to tag 'kana' */ - ASSERT (i == PANGO_SCRIPT_HIRAGANA || i == PANGO_SCRIPT_KATAKANA); - ASSERT (j == PANGO_SCRIPT_HIRAGANA || j == PANGO_SCRIPT_KATAKANA); - } - else - { - if (j != i) - g_error ("Got back %d for script %d (OT tag '%c%c%c%c')", j, i, - tag>>24, (tag>>16)&255, (tag>>8)&255, tag&255); - } - } - - ASSERT (pango_ot_tag_to_script (FT_MAKE_TAG ('X', 'Y', 'Z', ' ')) == PANGO_SCRIPT_UNKNOWN); -} - -static void -test_language_tags (void) -{ - /* just test it for a few known languages to make sure it's working */ - const char languages[][6] = { - "xy", /* hopefully nonexistent */ - "aa", - "az_IR", - "en", - "en_US", - "fa", - "fa_IR", - "fr", - "zh_CN", - "zu" - }; - unsigned int i; - - for (i = 0; i < G_N_ELEMENTS (languages); i++) - { - PangoLanguage *l = pango_language_from_string (languages[i]); - PangoOTTag tag = pango_ot_tag_from_language (l); -#if 0 - PangoLanguage *m = pango_ot_tag_to_language (tag); -#endif - - if (i == 0) - { - ASSERT (tag == PANGO_OT_TAG_DEFAULT_LANGUAGE); - } - else - { - if (tag == PANGO_OT_TAG_DEFAULT_LANGUAGE) - g_error ("Got PANGO_OT_TAG_DEFAULT_LANGUAGE for language '%s'", pango_language_to_string (l)); - - /* The following test can't work without proper BCP 47 language tag - * support. So, disable it. */ -#if 0 - if (!pango_language_matches (l, pango_language_to_string (m))) - g_error ("Got back %s for language %s (OT tag '%c%c%c%c')", - pango_language_to_string (m), pango_language_to_string (l), - tag>>24, (tag>>16)&255, (tag>>8)&255, tag&255); -#endif - } - } -} - -int -main (int argc, char **argv) -{ - g_test_init (&argc, &argv, NULL); - - g_test_add_func ("/tags/script", test_script_tags); - g_test_add_func ("/tags/language", test_language_tags); - - return g_test_run (); -} - -G_GNUC_END_IGNORE_DEPRECATIONS |