]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/rbbitst.h
1 /********************************************************************
3 * Copyright (c) 1999-2003, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
6 /************************************************************************
7 * Date Name Description
8 * 12/15/99 Madhu Creation.
9 * 01/12/2000 Madhu Updated for changed API and added new tests
10 ************************************************************************/
16 #include "unicode/utypes.h"
18 #if !UCONFIG_NO_BREAK_ITERATION
21 #include "unicode/brkiter.h"
30 * Test the RuleBasedBreakIterator class giving different rules
32 class RBBITest
: public IntlTest
{
38 void runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
= NULL
);
41 * Tests rule status return values
43 void TestStatusReturn();
46 * Run the Unicode Line Break test data.
48 void TestLineBreakData();
51 * Run tests from external test data file.
54 void TestSentenceInvariants();
55 void TestCharacterInvariants();
56 void TestWordInvariants();
57 void TestEmptyString();
58 void TestGetAvailableLocales();
59 void TestGetDisplayName();
60 void TestEndBehaviour();
61 void TestBug4153072();
62 void TestJapaneseLineBreak();
63 void TestThaiLineBreak();
64 void TestMixedThaiLineBreak();
66 void TestThaiWordBreak();
67 void TestMonkey(char *params
);
70 UChar
*ReadAndConvertFile(const char *fileName
, int &ulen
, UErrorCode
&status
);
71 void executeTest(TestParams
*);
77 /***********************/
80 * internal methods to prepare test data
84 * Perform tests of BreakIterator forward and backward functionality
85 * on different kinds of iterators (word, sentence, line and character).
86 * It tests the methods first(), next(), current(), preceding(), following()
87 * previous() and isBoundary().
88 * It makes use of internal functions to achieve this.
90 void generalIteratorTest(RuleBasedBreakIterator
& bi
, BITestData
&td
);
92 * Internal method to perform iteration and test the first() and next() functions
94 void testFirstAndNext(RuleBasedBreakIterator
& bi
, BITestData
&td
);
96 * Internal method to perform iteration and test the last() and previous() functions
98 void testLastAndPrevious(RuleBasedBreakIterator
& bi
, BITestData
&td
);
100 * Internal method to perform iteration and test the following() function
102 void testFollowing(RuleBasedBreakIterator
& bi
, BITestData
&td
);
104 * Internal method to perform iteration and test the preceding() function
106 void testPreceding(RuleBasedBreakIterator
& bi
, BITestData
&td
);
108 * Internal method to perform iteration and test the isBoundary() function
110 void testIsBoundary(RuleBasedBreakIterator
& bi
, BITestData
&td
);
112 * Internal method to perform tests of BreakIterator multiple selection functionality
113 * on different kinds of iterators (word, sentence, line and character)
115 void doMultipleSelectionTest(RuleBasedBreakIterator
& iterator
, BITestData
&td
);
117 void doBreakInvariantTest(BreakIterator
& tb
, UnicodeString
& testChars
);
118 void doOtherInvariantTest(BreakIterator
& tb
, UnicodeString
& testChars
);
120 void RunMonkey(BreakIterator
*bi
, RBBIMonkeyKind
&mk
, uint32_t seed
, int32_t loopCount
);
124 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */