1 /* 2 ******************************************************************************* 3 * 4 * Copyright (C) 2012, 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(); ~ListFormatterTest()26 virtual ~ListFormatterTest() {} 27 28 void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=0); 29 30 void TestLocaleFallback(); 31 void TestRoot(); 32 void TestBogus(); 33 void TestEnglish(); 34 void TestEnglishUS(); 35 void TestRussian(); 36 void TestMalayalam(); 37 void TestZulu(); 38 void TestOutOfOrderPatterns(); 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 50 private: 51 // Reused test data. 52 const UnicodeString prefix; 53 const UnicodeString one; 54 const UnicodeString two; 55 const UnicodeString three; 56 const UnicodeString four; 57 }; 58 59 #endif 60