]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/intltest/rbbitst.h
ICU-8.11.tar.gz
[apple/icu.git] / icuSources / test / intltest / rbbitst.h
CommitLineData
b75a7d8f 1/********************************************************************
73c04bcf
A
2 * COPYRIGHT:
3 * Copyright (c) 1999-2006, International Business Machines Corporation and
b75a7d8f
A
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************************************************************************/
11
12
13#ifndef RBBITEST_H
14#define RBBITEST_H
15
16#include "unicode/utypes.h"
17
18#if !UCONFIG_NO_BREAK_ITERATION
19
20#include "intltest.h"
21#include "unicode/brkiter.h"
22
23class Vector;
24class Enumeration;
25class BITestData;
26struct TestParams;
27class RBBIMonkeyKind;
28
29/**
30 * Test the RuleBasedBreakIterator class giving different rules
31 */
32class RBBITest: public IntlTest {
33public:
73c04bcf 34
b75a7d8f
A
35 RBBITest();
36 virtual ~RBBITest();
37
38 void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
73c04bcf 39
b75a7d8f
A
40 /**
41 * Tests rule status return values
73c04bcf 42 **/
b75a7d8f
A
43 void TestStatusReturn();
44
45 /**
46 * Run the Unicode Line Break test data.
73c04bcf 47 **/
b75a7d8f
A
48 void TestLineBreakData();
49
50 /**
51 * Run tests from external test data file.
52 */
53
b75a7d8f
A
54 void TestEmptyString();
55 void TestGetAvailableLocales();
56 void TestGetDisplayName();
57 void TestEndBehaviour();
58 void TestBug4153072();
59 void TestJapaneseLineBreak();
60 void TestThaiLineBreak();
73c04bcf
A
61 void TestMixedThaiLineBreak();
62 void TestMaiyamok();
b75a7d8f
A
63 void TestMonkey(char *params);
64
65 void TestExtended();
66 UChar *ReadAndConvertFile(const char *fileName, int &ulen, UErrorCode &status);
67 void executeTest(TestParams *);
68
374ca955
A
69 void TestWordBreaks();
70 void TestWordBoundary();
71 void TestLineBreaks();
72 void TestSentBreaks();
73 void TestBug3818();
74 void TestJapaneseWordBreak();
73c04bcf
A
75 void TestTrieDict();
76 void TestDebug();
77
78
b75a7d8f
A
79/***********************/
80private:
81 /**
82 * internal methods to prepare test data
83 **/
73c04bcf 84
b75a7d8f 85 /**
73c04bcf 86 * Perform tests of BreakIterator forward and backward functionality
b75a7d8f
A
87 * on different kinds of iterators (word, sentence, line and character).
88 * It tests the methods first(), next(), current(), preceding(), following()
89 * previous() and isBoundary().
90 * It makes use of internal functions to achieve this.
91 **/
92 void generalIteratorTest(RuleBasedBreakIterator& bi, BITestData &td);
93 /**
94 * Internal method to perform iteration and test the first() and next() functions
95 **/
96 void testFirstAndNext(RuleBasedBreakIterator& bi, BITestData &td);
97 /**
98 * Internal method to perform iteration and test the last() and previous() functions
99 **/
100 void testLastAndPrevious(RuleBasedBreakIterator& bi, BITestData &td);
101 /**
102 * Internal method to perform iteration and test the following() function
103 **/
104 void testFollowing(RuleBasedBreakIterator& bi, BITestData &td);
105 /**
106 * Internal method to perform iteration and test the preceding() function
107 **/
108 void testPreceding(RuleBasedBreakIterator& bi, BITestData &td);
109 /**
110 * Internal method to perform iteration and test the isBoundary() function
111 **/
112 void testIsBoundary(RuleBasedBreakIterator& bi, BITestData &td);
113 /**
73c04bcf 114 * Internal method to perform tests of BreakIterator multiple selection functionality
b75a7d8f
A
115 * on different kinds of iterators (word, sentence, line and character)
116 **/
117 void doMultipleSelectionTest(RuleBasedBreakIterator& iterator, BITestData &td);
118
73c04bcf
A
119 void RunMonkey(BreakIterator *bi, RBBIMonkeyKind &mk, const char *name, uint32_t seed,
120 int32_t loopCount, UBool useUText);
b75a7d8f
A
121
122};
123
124#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
125
126#endif