• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /********************************************************************
2  * COPYRIGHT:
3  * Copyright (c) 1999-2004, International Business Machines Corporation and
4  * others. All Rights Reserved.
5  ********************************************************************/
6 /************************************************************************
7 *   Date        Name        Description
8 *   12/14/99    Madhu        Creation.
9 ************************************************************************/
10 
11 
12 
13 #ifndef RBBIAPITEST_H
14 #define RBBIAPITEST_H
15 
16 #include "unicode/utypes.h"
17 
18 #if !UCONFIG_NO_BREAK_ITERATION
19 
20 #include "intltest.h"
21 #include "unicode/rbbi.h"
22 
23 /**
24  * API Test the RuleBasedBreakIterator class
25  */
26 class RBBIAPITest: public IntlTest {
27 public:
28 
29 
30     void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
31     /**
32      * Tests Constructor behaviour of RuleBasedBreakIterator
33      **/
34    // void TestConstruction(void);
35     /**
36      * Tests clone() and equals() methods of RuleBasedBreakIterator
37      **/
38     void TestCloneEquals();
39     /**
40      * Tests toString() method of RuleBasedBreakIterator
41      **/
42     void TestgetRules();
43     /**
44      * Tests the method hashCode() of RuleBasedBreakIterator
45      **/
46     void TestHashCode();
47      /**
48       * Tests the methods getText() and setText() of RuleBasedBreakIterator
49       **/
50     void TestGetSetAdoptText();
51      /**
52       * Testing the iteration methods of RuleBasedBreakIterator
53       **/
54     void TestIteration(void);
55 
56 
57     /**
58      * Tests creating RuleBasedBreakIterator from rules strings.
59      **/
60     void TestBuilder(void);
61 
62     void TestRoundtripRules(void);
63 
64     void RoundtripRule(const char *dataFile);
65 
66     /**
67      * Tests grouping effect of 'single quotes' in rules.
68      **/
69     void TestQuoteGrouping();
70 
71     /**
72      *  Tests word break status returns.
73      */
74     void TestRuleStatus();
75     void TestRuleStatusVec();
76 
77     void TestBug2190();
78 
79     void TestBoilerPlate();
80 
81     void TestRegistration();
82 
83     /**
84      *Internal subroutines
85      **/
86     /* Internal subroutine used by TestIsBoundary() */
87     void doBoundaryTest(RuleBasedBreakIterator& bi, UnicodeString& text, int32_t *boundaries);
88 
89     /*Internal subroutine used for comparision of expected and acquired results */
90     void doTest(UnicodeString& testString, int32_t start, int32_t gotoffset, int32_t expectedOffset, const char* expected);
91 
92 
93 };
94 
95 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */
96 
97 #endif
98