X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..e4f10fab0c078f399c9deef476d9c9b73b47dff8:/icuSources/test/intltest/rbbitst.h?ds=inline diff --git a/icuSources/test/intltest/rbbitst.h b/icuSources/test/intltest/rbbitst.h index 51ded0fd..0426d707 100644 --- a/icuSources/test/intltest/rbbitst.h +++ b/icuSources/test/intltest/rbbitst.h @@ -1,13 +1,11 @@ -/******************************************************************** - * COPYRIGHT: - * Copyright (c) 1999-2004, International Business Machines Corporation and - * others. All Rights Reserved. - ********************************************************************/ -/************************************************************************ -* Date Name Description -* 12/15/99 Madhu Creation. -* 01/12/2000 Madhu Updated for changed API and added new tests -************************************************************************/ +/************************************************************************* + * Copyright (c) 1999-2013, International Business Machines + * Corporation and others. All Rights Reserved. + ************************************************************************* + * Date Name Description + * 12/15/99 Madhu Creation. + * 01/12/2000 Madhu Updated for changed API and added new tests + ************************************************************************/ #ifndef RBBITEST_H @@ -20,40 +18,32 @@ #include "intltest.h" #include "unicode/brkiter.h" -class Vector; + class Enumeration; class BITestData; struct TestParams; class RBBIMonkeyKind; +U_NAMESPACE_BEGIN +class UVector32; +U_NAMESPACE_END + /** * Test the RuleBasedBreakIterator class giving different rules */ class RBBITest: public IntlTest { public: - + RBBITest(); virtual ~RBBITest(); void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL ); - + /** * Tests rule status return values - **/ + **/ void TestStatusReturn(); - /** - * Run the Unicode Line Break test data. - **/ - void TestLineBreakData(); - - /** - * Run tests from external test data file. - */ - - void TestSentenceInvariants(); - void TestCharacterInvariants(); - void TestWordInvariants(); void TestEmptyString(); void TestGetAvailableLocales(); void TestGetDisplayName(); @@ -61,13 +51,12 @@ public: void TestBug4153072(); void TestJapaneseLineBreak(); void TestThaiLineBreak(); - void TestMixedThaiLineBreak(); - void TestMaiyamok(); - void TestThaiWordBreak(); + void TestMixedThaiLineBreak(); + void TestMaiyamok(); void TestMonkey(char *params); void TestExtended(); - UChar *ReadAndConvertFile(const char *fileName, int &ulen, UErrorCode &status); + UChar *ReadAndConvertFile(const char *fileName, int &ulen, const char *encoding, UErrorCode &status); void executeTest(TestParams *); void TestWordBreaks(); @@ -76,16 +65,25 @@ public: void TestSentBreaks(); void TestBug3818(); void TestJapaneseWordBreak(); - - + void TestTrieDict(); + void TestUnicodeFiles(); + void TestBug5775(); + void TestTailoredBreaks(); + void TestDictRules(); + void TestBug5532(); + void TestBug9983(); + + void TestDebug(); + void TestProperties(); + /***********************/ private: /** * internal methods to prepare test data **/ - + /** - * Perform tests of BreakIterator forward and backward functionality + * Perform tests of BreakIterator forward and backward functionality * on different kinds of iterators (word, sentence, line and character). * It tests the methods first(), next(), current(), preceding(), following() * previous() and isBoundary(). @@ -113,16 +111,26 @@ private: **/ void testIsBoundary(RuleBasedBreakIterator& bi, BITestData &td); /** - * Internal method to perform tests of BreakIterator multiple selection functionality + * Internal method to perform tests of BreakIterator multiple selection functionality * on different kinds of iterators (word, sentence, line and character) **/ void doMultipleSelectionTest(RuleBasedBreakIterator& iterator, BITestData &td); - void doBreakInvariantTest(BreakIterator& tb, UnicodeString& testChars); - void doOtherInvariantTest(BreakIterator& tb, UnicodeString& testChars); + void RunMonkey(BreakIterator *bi, RBBIMonkeyKind &mk, const char *name, uint32_t seed, + int32_t loopCount, UBool useUText); + + // Run one of the Unicode Consortium boundary test data files. + void runUnicodeTestData(const char *fileName, RuleBasedBreakIterator *bi); - void RunMonkey(BreakIterator *bi, RBBIMonkeyKind &mk, const char *name, uint32_t seed, int32_t loopCount); + // Run a single test case from one of the Unicode Consortium test files. + void checkUnicodeTestCase(const char *testFileName, int lineNumber, + const UnicodeString &testString, + UVector32 *breakPositions, + RuleBasedBreakIterator *bi); + // Run the actual tests for TestTailoredBreaks() + void TBTest(BreakIterator* brkitr, int type, const char *locale, const char* escapedText, + const int32_t *expectOffsets, int32_t expectOffsetsCount); }; #endif /* #if !UCONFIG_NO_BREAK_ITERATION */