Home | History | Annotate | Download | only in intltest
      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();
     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 
     39   private:
     40     void CheckFormatting(const ListFormatter* formatter, UnicodeString data[], int32_t data_size, const UnicodeString& expected_result);
     41     void CheckFourCases(
     42         const char* locale_string,
     43         UnicodeString one,
     44         UnicodeString two,
     45         UnicodeString three,
     46         UnicodeString four,
     47         UnicodeString results[4]);
     48     UBool RecordFourCases(
     49         const Locale& locale,
     50         UnicodeString one,
     51         UnicodeString two,
     52         UnicodeString three,
     53         UnicodeString four,
     54         UnicodeString results[4]);
     55 
     56   private:
     57     // Reused test data.
     58     const UnicodeString prefix;
     59     const UnicodeString one;
     60     const UnicodeString two;
     61     const UnicodeString three;
     62     const UnicodeString four;
     63 };
     64 
     65 #endif
     66