diff --git a/src/Makefile.am b/src/Makefile.am index ec5565626..976f11fa7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -392,7 +392,14 @@ dist_check_SCRIPTS = \ check-symbols.sh \ $(NULL) -TESTS = $(dist_check_SCRIPTS) +check_PROGRAMS = \ + test-ot-tag \ + $(NULL) +test_ot_tag_SOURCES = hb-ot-tag.cc +test_ot_tag_CPPFLAGS = $(HBCFLAGS) -DMAIN +test_ot_tag_LDADD = libharfbuzz.la $(HBLIBS) + +TESTS = $(dist_check_SCRIPTS) $(check_PROGRAMS) TESTS_ENVIRONMENT = \ srcdir="$(srcdir)" \ MAKE="$(MAKE) $(AM_MAKEFLAGS)" \ diff --git a/src/hb-ot-tag.cc b/src/hb-ot-tag.cc index a2e5728fc..fc8cf45a9 100644 --- a/src/hb-ot-tag.cc +++ b/src/hb-ot-tag.cc @@ -928,4 +928,27 @@ hb_ot_tag_to_language (hb_tag_t tag) } } +static inline void +test_langs_sorted (void) +{ + for (unsigned int i = 1; i < ARRAY_LENGTH (ot_languages); i++) + { + int c = lang_compare_first_component (ot_languages[i-1].language, ot_languages[i].language); + if (c >= 0) + { + fprintf (stderr, "ot_languages not sorted at index %d: %s %d %s\n", + i, ot_languages[i-1].language, c, ot_languages[i].language); + abort(); + } + } +} +#ifdef MAIN +int +main (void) +{ + test_langs_sorted (); + return 0; +} + +#endif