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