2012-08-27 20:14:25 +00:00
|
|
|
/*
|
|
|
|
*******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
|
|
|
*******************************************************************************
|
|
|
|
* file name: listformattertest.cpp
|
|
|
|
* encoding: US-ASCII
|
|
|
|
* tab size: 8 (not used)
|
|
|
|
* indentation:4
|
|
|
|
*
|
|
|
|
* created on: 2012aug27
|
|
|
|
* created by: Umesh P. Nair
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LISTFORMATTERTEST_H__
|
|
|
|
#define __LISTFORMATTERTEST_H__
|
|
|
|
|
|
|
|
#include "unicode/listformatter.h"
|
|
|
|
#include "intltest.h"
|
|
|
|
|
|
|
|
class ListFormatterTest : public IntlTest {
|
|
|
|
public:
|
|
|
|
ListFormatterTest();
|
|
|
|
virtual ~ListFormatterTest() {}
|
|
|
|
|
|
|
|
void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=0);
|
|
|
|
|
|
|
|
void TestRoot();
|
|
|
|
void TestBogus();
|
|
|
|
void TestEnglish();
|
|
|
|
void TestEnglishUS();
|
|
|
|
void TestRussian();
|
|
|
|
void TestMalayalam();
|
|
|
|
void TestZulu();
|
2012-09-12 00:14:25 +00:00
|
|
|
void TestOutOfOrderPatterns();
|
2012-08-27 20:14:25 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void CheckFormatting(const ListFormatter* formatter, UnicodeString data[], int32_t data_size, const UnicodeString& expected_result);
|
|
|
|
void CheckFourCases(
|
|
|
|
const char* locale_string,
|
|
|
|
UnicodeString one,
|
|
|
|
UnicodeString two,
|
|
|
|
UnicodeString three,
|
|
|
|
UnicodeString four,
|
|
|
|
UnicodeString results[4]);
|
2012-11-15 18:15:37 +00:00
|
|
|
UBool RecordFourCases(
|
|
|
|
const Locale& locale,
|
|
|
|
UnicodeString one,
|
|
|
|
UnicodeString two,
|
|
|
|
UnicodeString three,
|
|
|
|
UnicodeString four,
|
|
|
|
UnicodeString results[4]);
|
2012-08-27 20:14:25 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Reused test data.
|
|
|
|
const UnicodeString prefix;
|
|
|
|
const UnicodeString one;
|
|
|
|
const UnicodeString two;
|
|
|
|
const UnicodeString three;
|
|
|
|
const UnicodeString four;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|