]>
Commit | Line | Data |
---|---|---|
f3c0d7a5 A |
1 | // © 2016 and later: Unicode, Inc. and others. |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
46f4442e | 3 | /************************************************************************* |
2ca993e8 | 4 | * Copyright (c) 1999-2016, International Business Machines |
46f4442e A |
5 | * Corporation and others. All Rights Reserved. |
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 | ************************************************************************/ | |
b75a7d8f A |
11 | |
12 | ||
13 | #ifndef RBBITEST_H | |
14 | #define RBBITEST_H | |
15 | ||
16 | #include "unicode/utypes.h" | |
17 | ||
18 | #if !UCONFIG_NO_BREAK_ITERATION | |
19 | ||
0f5d89e8 A |
20 | #include <memory> |
21 | ||
b75a7d8f A |
22 | #include "intltest.h" |
23 | #include "unicode/brkiter.h" | |
2ca993e8 | 24 | #include "unicode/rbbi.h" |
46f4442e | 25 | |
b75a7d8f A |
26 | class Enumeration; |
27 | class BITestData; | |
28 | struct TestParams; | |
29 | class RBBIMonkeyKind; | |
30 | ||
46f4442e A |
31 | U_NAMESPACE_BEGIN |
32 | class UVector32; | |
33 | U_NAMESPACE_END | |
34 | ||
b75a7d8f A |
35 | /** |
36 | * Test the RuleBasedBreakIterator class giving different rules | |
37 | */ | |
38 | class RBBITest: public IntlTest { | |
39 | public: | |
73c04bcf | 40 | |
b75a7d8f A |
41 | RBBITest(); |
42 | virtual ~RBBITest(); | |
43 | ||
44 | void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL ); | |
73c04bcf | 45 | |
b75a7d8f A |
46 | void TestGetAvailableLocales(); |
47 | void TestGetDisplayName(); | |
48 | void TestEndBehaviour(); | |
49 | void TestBug4153072(); | |
50 | void TestJapaneseLineBreak(); | |
51 | void TestThaiLineBreak(); | |
73c04bcf A |
52 | void TestMixedThaiLineBreak(); |
53 | void TestMaiyamok(); | |
f3c0d7a5 | 54 | void TestMonkey(); |
b75a7d8f A |
55 | |
56 | void TestExtended(); | |
46f4442e | 57 | UChar *ReadAndConvertFile(const char *fileName, int &ulen, const char *encoding, UErrorCode &status); |
b331163b | 58 | void executeTest(TestParams *, UErrorCode &status); |
b75a7d8f | 59 | |
374ca955 A |
60 | void TestWordBreaks(); |
61 | void TestWordBoundary(); | |
62 | void TestLineBreaks(); | |
63 | void TestSentBreaks(); | |
64 | void TestBug3818(); | |
65 | void TestJapaneseWordBreak(); | |
73c04bcf | 66 | void TestTrieDict(); |
46f4442e A |
67 | void TestUnicodeFiles(); |
68 | void TestBug5775(); | |
729e4ab9 A |
69 | void TestTailoredBreaks(); |
70 | void TestDictRules(); | |
71 | void TestBug5532(); | |
51004dcb | 72 | void TestBug9983(); |
f3c0d7a5 A |
73 | void TestBug7547(); |
74 | void TestBug12797(); | |
75 | void TestBug12918(); | |
76 | void TestBug12932(); | |
77 | void TestEmoji(); | |
0f5d89e8 A |
78 | void TestBug12519(); |
79 | void TestBug12677(); | |
80 | void TestTableRedundancies(); | |
81 | void TestBug13447(); | |
82 | void TestReverse(); | |
83 | void TestReverse(std::unique_ptr<RuleBasedBreakIterator>bi); | |
84 | void TestBug13692(); | |
46f4442e | 85 | |
73c04bcf | 86 | void TestDebug(); |
4388f060 | 87 | void TestProperties(); |
73c04bcf | 88 | |
b75a7d8f A |
89 | /***********************/ |
90 | private: | |
91 | /** | |
92 | * internal methods to prepare test data | |
93 | **/ | |
73c04bcf | 94 | |
73c04bcf A |
95 | void RunMonkey(BreakIterator *bi, RBBIMonkeyKind &mk, const char *name, uint32_t seed, |
96 | int32_t loopCount, UBool useUText); | |
b75a7d8f | 97 | |
46f4442e A |
98 | // Run one of the Unicode Consortium boundary test data files. |
99 | void runUnicodeTestData(const char *fileName, RuleBasedBreakIterator *bi); | |
100 | ||
101 | // Run a single test case from one of the Unicode Consortium test files. | |
102 | void checkUnicodeTestCase(const char *testFileName, int lineNumber, | |
103 | const UnicodeString &testString, | |
104 | UVector32 *breakPositions, | |
105 | RuleBasedBreakIterator *bi); | |
729e4ab9 A |
106 | |
107 | // Run the actual tests for TestTailoredBreaks() | |
108 | void TBTest(BreakIterator* brkitr, int type, const char *locale, const char* escapedText, | |
109 | const int32_t *expectOffsets, int32_t expectOffsetsCount); | |
b331163b A |
110 | |
111 | /** Filter for test cases from the Unicode test data files. | |
112 | * Some need to be skipped because ICU is unable to fully implement the | |
113 | * Unicode boundary specifications. | |
114 | * @param testCase the test data string. | |
115 | * @param fileName the Unicode test data file name. | |
116 | * @return FALSE if the test case should be run, TRUE if it should be skipped. | |
117 | */ | |
118 | UBool testCaseIsKnownIssue(const UnicodeString &testCase, const char *fileName); | |
f3c0d7a5 A |
119 | |
120 | // Test parameters, from the test framework and test invocation. | |
121 | const char* fTestParams; | |
b75a7d8f A |
122 | }; |
123 | ||
124 | #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ | |
125 | ||
126 | #endif |