]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/tmsgfmt.h
1 /********************************************************************
3 * Copyright (c) 1997-2012, 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 */);
68 void testApostropheInPluralAndSelect();
71 * Internal method to format a MessageFormat object with passed args
73 void internalFormat(MessageFormat
* msgFmt
,
74 Formattable
* args
, int32_t numOfArgs
,
75 UnicodeString expected
, const char* errMsg
);
78 * Internal method to create a MessageFormat object with passed args
80 MessageFormat
* internalCreate(
81 UnicodeString pattern
,Locale locale
, UErrorCode
& err
, char* errMsg
);
84 * Verify that MessageFormat accomodates more than 10 arguments
85 * and more than 10 subformats.
87 void TestUnlimitedArgsAndSubformats();
90 * Test RBNF extensions to MessageFormat.
94 void TestApostropheMode();
96 void TestCompatibleApostrophe();
99 * ------------ API tests ----------
100 * These routines test various API functionality.
101 * In addition to the methods their name suggests,
102 * they often test other methods as well.
104 void testCopyConstructor(void);
105 void testCopyConstructor2(void);
106 void testAssignment(void);
107 void testClone(void);
108 void testEquals(void);
109 void testNotEquals(void);
110 void testSetLocale(void);
111 void testFormat(void);
112 void testParse(void);
113 void testAdopt(void);
114 void TestTurkishCasing(void);
115 void testAutoQuoteApostrophe(void);
117 void testGetFormatNames();
118 void TestTrimArgumentName();
119 void TestSelectOrdinal();
122 UnicodeString
GetPatternAndSkipSyntax(const MessagePattern
& pattern
);
125 #endif /* #if !UCONFIG_NO_FORMATTING */