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