Imported Upstream version 58.1
[platform/upstream/icu.git] / source / test / intltest / listformattertest.h
1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *******************************************************************************
5 *
6 *   Copyright (C) 2012-2013, International Business Machines
7 *   Corporation and others.  All Rights Reserved.
8 *
9 *******************************************************************************
10 *   file name:  listformattertest.cpp
11 *   encoding:   US-ASCII
12 *   tab size:   8 (not used)
13 *   indentation:4
14 *
15 *   created on: 2012aug27
16 *   created by: Umesh P. Nair
17 */
18
19 #ifndef __LISTFORMATTERTEST_H__
20 #define __LISTFORMATTERTEST_H__
21
22 #include "unicode/listformatter.h"
23 #include "intltest.h"
24
25 class ListFormatterTest : public IntlTest {
26   public:
27     ListFormatterTest();
28     virtual ~ListFormatterTest() {}
29
30     void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=0);
31
32     void TestRoot();
33     void TestBogus();
34     void TestEnglish();
35     void TestEnglishUS();
36     void TestRussian();
37     void TestMalayalam();
38     void TestZulu();
39     void TestOutOfOrderPatterns();
40     void Test9946();
41
42   private:
43     void CheckFormatting(const ListFormatter* formatter, UnicodeString data[], int32_t data_size, const UnicodeString& expected_result);
44     void CheckFourCases(
45         const char* locale_string,
46         UnicodeString one,
47         UnicodeString two,
48         UnicodeString three,
49         UnicodeString four,
50         UnicodeString results[4]);
51     UBool RecordFourCases(
52         const Locale& locale,
53         UnicodeString one,
54         UnicodeString two,
55         UnicodeString three,
56         UnicodeString four,
57         UnicodeString results[4]);
58
59   private:
60     // Reused test data.
61     const UnicodeString prefix;
62     const UnicodeString one;
63     const UnicodeString two;
64     const UnicodeString three;
65     const UnicodeString four;
66 };
67
68 #endif