]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/tmsgfmt.h
1 /********************************************************************
3 * Copyright (c) 1997-2010, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
6 #ifndef _TESTMESSAGEFORMAT
7 #define _TESTMESSAGEFORMAT
9 #include "unicode/utypes.h"
11 #if !UCONFIG_NO_FORMATTING
13 #include "unicode/unistr.h"
14 #include "unicode/fmtable.h"
15 #include "unicode/msgfmt.h"
19 * TestMessageFormat tests MessageFormat, and also a few unctions in ChoiceFormat
21 class TestMessageFormat
: public IntlTest
{
23 void runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
= NULL
);
26 * regression test for a specific bug regarding ChoiceFormat boundaries
30 * regression test for a specific bug regarding MessageFormat using ChoiceFormat
34 * regression test for a specific bug involving NumberFormat and Locales
38 * test MessageFormat with various given patterns
40 void PatternTest(void);
42 * test MesageFormat formatting functionality in a simple example
47 * tests the static MessageFormat::format method
49 void testStaticFormat(/* char* par */);
51 * tests MesageFormat functionality with a simple format
53 void testSimpleFormat(/* char* par */);
55 * tests MesageFormat functionality with a format including a ChoiceFormat
57 void testMsgFormatChoice(/* char* par */);
59 * tests MesageFormat functionality with a PluralFormat.
61 void testMsgFormatPlural(/* char* par */);
64 * tests MessageFormat functionality with a SelectFormat.
66 void testMsgFormatSelect(/* char* par */);
69 * Internal method to format a MessageFormat object with passed args
71 void internalFormat(MessageFormat
* msgFmt
,
72 Formattable
* args
, int32_t numOfArgs
,
73 UnicodeString expected
,char* errMsg
);
76 * Internal method to create a MessageFormat object with passed args
78 MessageFormat
* internalCreate(
79 UnicodeString pattern
,Locale locale
, UErrorCode
& err
, char* errMsg
);
82 * Verify that MessageFormat accomodates more than 10 arguments
83 * and more than 10 subformats.
85 void TestUnlimitedArgsAndSubformats();
88 * Test RBNF extensions to MessageFormat.
94 * ------------ API tests ----------
95 * These routines test various API functionality.
96 * In addition to the methods their name suggests,
97 * they often test other methods as well.
99 void testCopyConstructor(void);
100 void testCopyConstructor2(void);
101 void testAssignment(void);
102 void testClone(void);
103 void testEquals(void);
104 void testNotEquals(void);
105 void testSetLocale(void);
106 void testFormat(void);
107 void testParse(void);
108 void testAdopt(void);
109 void TestTurkishCasing(void);
110 void testAutoQuoteApostrophe(void);
112 /* Provide better code coverage */
113 void testCoverage(void);
118 #endif /* #if !UCONFIG_NO_FORMATTING */