1// © 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: UTF-8 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 25class 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 TestEnglishGB(); 37 void TestNynorsk(); 38 void TestChineseTradHK(); 39 void TestRussian(); 40 void TestMalayalam(); 41 void TestZulu(); 42 void TestOutOfOrderPatterns(); 43 void Test9946(); 44 45 private: 46 void CheckFormatting(const ListFormatter* formatter, UnicodeString data[], int32_t data_size, const UnicodeString& expected_result); 47 void CheckFourCases( 48 const char* locale_string, 49 UnicodeString one, 50 UnicodeString two, 51 UnicodeString three, 52 UnicodeString four, 53 UnicodeString results[4]); 54 UBool RecordFourCases( 55 const Locale& locale, 56 UnicodeString one, 57 UnicodeString two, 58 UnicodeString three, 59 UnicodeString four, 60 UnicodeString results[4]); 61 62 private: 63 // Reused test data. 64 const UnicodeString prefix; 65 const UnicodeString one; 66 const UnicodeString two; 67 const UnicodeString three; 68 const UnicodeString four; 69}; 70 71#endif 72