Fredrik Roubert | 0596fae | 2017-04-18 21:34:02 +0200 | [diff] [blame] | 1 | // © 2016 and later: Unicode, Inc. and others. |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 2 | // License & terms of use: http://www.unicode.org/copyright.html |
Jean-Baptiste Queru | b13da9d | 2009-07-17 17:53:22 -0700 | [diff] [blame] | 3 | /******************************************************************** |
claireho | 50294ea | 2010-05-03 15:44:48 -0700 | [diff] [blame] | 4 | * COPYRIGHT: |
ccornelius | f9878a2 | 2014-11-20 18:09:39 -0800 | [diff] [blame] | 5 | * Copyright (c) 1997-2014, International Business Machines Corporation and |
Jean-Baptiste Queru | b13da9d | 2009-07-17 17:53:22 -0700 | [diff] [blame] | 6 | * others. All Rights Reserved. |
| 7 | ********************************************************************/ |
| 8 | /******************************************************************************** |
| 9 | * |
| 10 | * File CLOCTST.H |
| 11 | * |
| 12 | * Modification History: |
| 13 | * Name Description |
| 14 | * Madhu Katragadda Converted to C |
| 15 | ********************************************************************************* |
| 16 | */ |
| 17 | #ifndef _CLOCTEST |
| 18 | #define _CLOCTEST |
| 19 | |
| 20 | #include "cintltst.h" |
| 21 | /*C API TEST FOR LOCALE */ |
| 22 | |
| 23 | /** |
| 24 | * Test functions to set and get data fields |
| 25 | **/ |
| 26 | static void TestBasicGetters(void); |
| 27 | static void TestPrefixes(void); |
| 28 | /** |
| 29 | * Use Locale to access Resource file data and compare against expected values |
| 30 | **/ |
| 31 | static void TestSimpleResourceInfo(void); |
| 32 | /** |
| 33 | * Use Locale to access Resource file display names and compare against expected values |
| 34 | **/ |
| 35 | static void TestDisplayNames(void); |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 36 | static void TestGetDisplayScriptPreFlighting21160(void); |
| 37 | |
Jean-Baptiste Queru | b13da9d | 2009-07-17 17:53:22 -0700 | [diff] [blame] | 38 | /** |
| 39 | * Test getAvailableLocales |
| 40 | **/ |
Nikita Iashchenko | 4c0e286 | 2019-11-05 16:38:00 +0000 | [diff] [blame] | 41 | static void TestGetAvailableLocales(void); |
| 42 | static void TestGetAvailableLocalesByType(void); |
Jean-Baptiste Queru | b13da9d | 2009-07-17 17:53:22 -0700 | [diff] [blame] | 43 | /** |
| 44 | * Test functions to set and access a custom data directory |
| 45 | **/ |
| 46 | static void TestDataDirectory(void); |
| 47 | /** |
| 48 | * Test functions to test get ISO countries and Languages |
| 49 | **/ |
| 50 | static void TestISOFunctions(void); |
| 51 | /** |
| 52 | * Test functions to test get ISO3 countries and Languages Fallback |
| 53 | **/ |
| 54 | static void TestISO3Fallback(void); |
| 55 | /** |
| 56 | * Test functions to test get ISO3 countries and Languages for Uninstalled locales |
| 57 | **/ |
| 58 | static void TestUninstalledISO3Names(void); |
| 59 | static void TestObsoleteNames(void); |
| 60 | /** |
| 61 | * Test functions uloc_getDisplaynames() |
| 62 | **/ |
| 63 | static void TestSimpleDisplayNames(void); |
| 64 | /** |
| 65 | * Test functions uloc_getDisplaynames() |
| 66 | **/ |
| 67 | static void TestVariantParsing(void); |
| 68 | |
| 69 | /* Test getting keyword enumeratin */ |
| 70 | static void TestKeywordVariants(void); |
| 71 | |
| 72 | static void TestKeywordSet(void); |
| 73 | static void TestKeywordSetError(void); |
| 74 | |
| 75 | /* Test getting keyword values */ |
| 76 | static void TestKeywordVariantParsing(void); |
| 77 | |
| 78 | /* Test warning for no data in getDisplay* */ |
| 79 | static void TestDisplayNameWarning(void); |
| 80 | |
| 81 | /* Test uloc_getLocaleForLCID */ |
| 82 | static void TestGetLocaleForLCID(void); |
| 83 | |
| 84 | /** |
| 85 | * routine to perform subtests, used by TestDisplayNames |
| 86 | */ |
| 87 | static void doTestDisplayNames(const char* inLocale, int32_t compareIndex); |
| 88 | |
| 89 | static void TestCanonicalization(void); |
Victor Chang | 4578a1c | 2018-10-22 04:26:58 +0100 | [diff] [blame] | 90 | static void TestCanonicalizationBuffer(void); |
Jean-Baptiste Queru | b13da9d | 2009-07-17 17:53:22 -0700 | [diff] [blame] | 91 | |
| 92 | static void TestDisplayKeywords(void); |
| 93 | |
| 94 | static void TestDisplayKeywordValues(void); |
| 95 | |
| 96 | static void TestGetBaseName(void); |
| 97 | |
claireho | 50294ea | 2010-05-03 15:44:48 -0700 | [diff] [blame] | 98 | static void TestTrailingNull(void); |
| 99 | |
Jean-Baptiste Queru | b13da9d | 2009-07-17 17:53:22 -0700 | [diff] [blame] | 100 | static void TestGetLocale(void); |
| 101 | |
| 102 | /** |
| 103 | * additional intialization for datatables storing expected values |
| 104 | */ |
| 105 | static void setUpDataTable(void); |
| 106 | static void cleanUpDataTable(void); |
| 107 | /*static void displayDataTable(void);*/ |
| 108 | static void TestAcceptLanguage(void); |
| 109 | |
| 110 | /** |
| 111 | * test locale aliases |
| 112 | */ |
| 113 | static void TestCalendar(void); |
| 114 | static void TestDateFormat(void); |
| 115 | static void TestCollation(void); |
| 116 | static void TestULocale(void); |
| 117 | static void TestUResourceBundle(void); |
| 118 | static void TestDisplayName(void); |
| 119 | |
| 120 | static void TestAcceptLanguage(void); |
| 121 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 122 | static void TestOrientation(void); |
| 123 | |
| 124 | static void TestLikelySubtags(void); |
| 125 | |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 126 | /** |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 127 | * test terminate correctly. |
| 128 | */ |
| 129 | static void Test21157CorrectTerminating(void); |
| 130 | |
| 131 | /** |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 132 | * language tag |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 133 | */ |
| 134 | static void TestForLanguageTag(void); |
| 135 | static void TestToLanguageTag(void); |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 136 | static void TestBug20132(void); |
Victor Chang | 4578a1c | 2018-10-22 04:26:58 +0100 | [diff] [blame] | 137 | static void TestLangAndRegionCanonicalize(void); |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 138 | |
ccornelius | f9878a2 | 2014-11-20 18:09:39 -0800 | [diff] [blame] | 139 | static void TestToUnicodeLocaleKey(void); |
| 140 | static void TestToLegacyKey(void); |
| 141 | static void TestToUnicodeLocaleType(void); |
| 142 | static void TestToLegacyType(void); |
Nikita Iashchenko | 4c0e286 | 2019-11-05 16:38:00 +0000 | [diff] [blame] | 143 | static void TestBug20149(void); |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 144 | static void TestCDefaultLocale(void); |
| 145 | |
| 146 | |
| 147 | /** |
| 148 | * U_USING_DEFAULT_WARNING |
| 149 | */ |
| 150 | static void TestUsingDefaultWarning(void); |
ccornelius | f9878a2 | 2014-11-20 18:09:39 -0800 | [diff] [blame] | 151 | |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 152 | /** |
| 153 | * locale data |
| 154 | */ |
| 155 | static void TestEnglishExemplarCharacters(void); |
| 156 | |
Jean-Baptiste Queru | b13da9d | 2009-07-17 17:53:22 -0700 | [diff] [blame] | 157 | #endif |