1 /********************************************************************
3 * Copyright (c) 1999-2011 International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
6 /************************************************************************
7 * Date Name Description
8 * 12/14/99 Madhu Creation.
9 ************************************************************************/
16 #include "unicode/utypes.h"
18 #if !UCONFIG_NO_BREAK_ITERATION
21 #include "unicode/rbbi.h"
24 * API Test the RuleBasedBreakIterator class
26 class RBBIAPITest
: public IntlTest
{
30 void runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
= NULL
);
32 * Tests Constructor behaviour of RuleBasedBreakIterator
34 // void TestConstruction(void);
36 * Tests clone() and equals() methods of RuleBasedBreakIterator
38 void TestCloneEquals();
40 * Tests toString() method of RuleBasedBreakIterator
44 * Tests the method hashCode() of RuleBasedBreakIterator
48 * Tests the methods getText() and setText() of RuleBasedBreakIterator
50 void TestGetSetAdoptText();
52 * Testing the iteration methods of RuleBasedBreakIterator
54 void TestIteration(void);
58 * Tests creating RuleBasedBreakIterator from rules strings.
60 void TestBuilder(void);
62 void TestRoundtripRules(void);
64 void RoundtripRule(const char *dataFile
);
67 * Test creating RuleBasedBreakIterator from RBBIData.
70 void TestCreateFromRBBIData(void);
73 * Tests grouping effect of 'single quotes' in rules.
75 void TestQuoteGrouping();
78 * Tests word break status returns.
80 void TestRuleStatus();
81 void TestRuleStatusVec();
85 void TestBoilerPlate();
87 void TestRegistration();
89 void TestRefreshInputText();
94 /* Internal subroutine used by TestIsBoundary() */
95 void doBoundaryTest(RuleBasedBreakIterator
& bi
, UnicodeString
& text
, int32_t *boundaries
);
97 /*Internal subroutine used for comparision of expected and acquired results */
98 void doTest(UnicodeString
& testString
, int32_t start
, int32_t gotoffset
, int32_t expectedOffset
, const char* expected
);
104 * Special class to enable testing of protected functions in RuleBasedBreakIterator
106 class RBBIWithProtectedFunctions
: public RuleBasedBreakIterator
{
111 RBBIWithProtectedFunctions(RBBIDataHeader
* data
, UErrorCode
&status
);
112 RBBIWithProtectedFunctions(const RBBIDataHeader
* data
, enum EDontAdopt dontAdopt
, UErrorCode
&status
);
115 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */