blob: af7fa5d06a313dd7ac820933226995b61e180fd6 [file] [log] [blame]
Fredrik Roubert0596fae2017-04-18 21:34:02 +02001// © 2016 and later: Unicode, Inc. and others.
Fredrik Roubert64339d32016-10-21 19:43:16 +02002// License & terms of use: http://www.unicode.org/copyright.html
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -07003/********************************************************************
claireho50294ea2010-05-03 15:44:48 -07004 * COPYRIGHT:
ccorneliusf9878a22014-11-20 18:09:39 -08005 * Copyright (c) 1997-2014, International Business Machines Corporation and
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -07006 * 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 **/
26static void TestBasicGetters(void);
27static void TestPrefixes(void);
28/**
29 * Use Locale to access Resource file data and compare against expected values
30 **/
31static void TestSimpleResourceInfo(void);
32/**
33 * Use Locale to access Resource file display names and compare against expected values
34 **/
35static void TestDisplayNames(void);
Victor Chang978167a2021-01-18 17:56:33 +000036static void TestGetDisplayScriptPreFlighting21160(void);
37
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -070038/**
39 * Test getAvailableLocales
40 **/
Nikita Iashchenko4c0e2862019-11-05 16:38:00 +000041static void TestGetAvailableLocales(void);
42static void TestGetAvailableLocalesByType(void);
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -070043/**
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 Chang4578a1c2018-10-22 04:26:58 +010090 static void TestCanonicalizationBuffer(void);
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -070091
92 static void TestDisplayKeywords(void);
93
94 static void TestDisplayKeywordValues(void);
95
96 static void TestGetBaseName(void);
97
claireho50294ea2010-05-03 15:44:48 -070098static void TestTrailingNull(void);
99
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700100static void TestGetLocale(void);
101
102/**
103 * additional intialization for datatables storing expected values
104 */
105static void setUpDataTable(void);
106static void cleanUpDataTable(void);
107/*static void displayDataTable(void);*/
108static void TestAcceptLanguage(void);
109
110/**
111 * test locale aliases
112*/
113static void TestCalendar(void);
114static void TestDateFormat(void);
115static void TestCollation(void);
116static void TestULocale(void);
117static void TestUResourceBundle(void);
118static void TestDisplayName(void);
119
120static void TestAcceptLanguage(void);
121
Jean-Baptiste Queruc69afce2009-07-20 15:02:39 -0700122static void TestOrientation(void);
123
124static void TestLikelySubtags(void);
125
Jean-Baptiste Querub0ac9372009-07-20 15:09:32 -0700126/**
Victor Chang978167a2021-01-18 17:56:33 +0000127 * test terminate correctly.
128 */
129static void Test21157CorrectTerminating(void);
130
131/**
Nikita Iashchenkoda0990f2019-06-13 19:36:45 +0100132 * language tag
Jean-Baptiste Querub0ac9372009-07-20 15:09:32 -0700133 */
134static void TestForLanguageTag(void);
135static void TestToLanguageTag(void);
Nikita Iashchenkoda0990f2019-06-13 19:36:45 +0100136static void TestBug20132(void);
Victor Chang4578a1c2018-10-22 04:26:58 +0100137static void TestLangAndRegionCanonicalize(void);
Craig Cornelius83933352013-06-14 14:20:29 -0700138
ccorneliusf9878a22014-11-20 18:09:39 -0800139static void TestToUnicodeLocaleKey(void);
140static void TestToLegacyKey(void);
141static void TestToUnicodeLocaleType(void);
142static void TestToLegacyType(void);
Nikita Iashchenko4c0e2862019-11-05 16:38:00 +0000143static void TestBug20149(void);
Victor Chang978167a2021-01-18 17:56:33 +0000144static void TestCDefaultLocale(void);
145
146
147/**
148 * U_USING_DEFAULT_WARNING
149 */
150static void TestUsingDefaultWarning(void);
ccorneliusf9878a22014-11-20 18:09:39 -0800151
Craig Cornelius83933352013-06-14 14:20:29 -0700152/**
153 * locale data
154 */
155static void TestEnglishExemplarCharacters(void);
156
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700157#endif