2000-03-10 00:42:27 +00:00
|
|
|
/********************************************************************
|
|
|
|
* COPYRIGHT:
|
2013-06-14 00:47:11 +00:00
|
|
|
* Copyright (c) 1999-2013 International Business Machines Corporation and
|
2000-03-10 00:42:27 +00:00
|
|
|
* others. All Rights Reserved.
|
|
|
|
********************************************************************/
|
|
|
|
/************************************************************************
|
2000-01-17 20:59:08 +00:00
|
|
|
* Date Name Description
|
|
|
|
* 12/14/99 Madhu Creation.
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef RBBIAPITEST_H
|
|
|
|
#define RBBIAPITEST_H
|
|
|
|
|
2002-09-21 00:43:14 +00:00
|
|
|
#include "unicode/utypes.h"
|
|
|
|
|
|
|
|
#if !UCONFIG_NO_BREAK_ITERATION
|
2000-01-17 20:59:08 +00:00
|
|
|
|
|
|
|
#include "intltest.h"
|
|
|
|
#include "unicode/rbbi.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* API Test the RuleBasedBreakIterator class
|
|
|
|
*/
|
|
|
|
class RBBIAPITest: public IntlTest {
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
2000-08-14 21:42:36 +00:00
|
|
|
void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
|
|
|
|
/**
|
2000-01-17 20:59:08 +00:00
|
|
|
* Tests Constructor behaviour of RuleBasedBreakIterator
|
|
|
|
**/
|
|
|
|
// void TestConstruction(void);
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
|
|
|
* Tests clone() and equals() methods of RuleBasedBreakIterator
|
|
|
|
**/
|
|
|
|
void TestCloneEquals();
|
|
|
|
/**
|
|
|
|
* Tests toString() method of RuleBasedBreakIterator
|
|
|
|
**/
|
2000-01-17 20:59:08 +00:00
|
|
|
void TestgetRules();
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
|
|
|
* Tests the method hashCode() of RuleBasedBreakIterator
|
|
|
|
**/
|
2000-01-17 20:59:08 +00:00
|
|
|
void TestHashCode();
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
|
|
|
* Tests the methods getText() and setText() of RuleBasedBreakIterator
|
|
|
|
**/
|
2000-01-17 20:59:08 +00:00
|
|
|
void TestGetSetAdoptText();
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
2003-05-16 22:05:35 +00:00
|
|
|
* Testing the iteration methods of RuleBasedBreakIterator
|
2000-08-14 21:42:36 +00:00
|
|
|
**/
|
2003-05-16 22:05:35 +00:00
|
|
|
void TestIteration(void);
|
|
|
|
|
2000-01-17 20:59:08 +00:00
|
|
|
|
2002-06-25 17:23:07 +00:00
|
|
|
/**
|
|
|
|
* Tests creating RuleBasedBreakIterator from rules strings.
|
|
|
|
**/
|
2003-02-17 18:06:42 +00:00
|
|
|
void TestBuilder(void);
|
|
|
|
|
|
|
|
void TestRoundtripRules(void);
|
|
|
|
|
|
|
|
void RoundtripRule(const char *dataFile);
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2008-09-25 05:48:27 +00:00
|
|
|
/**
|
|
|
|
* Test creating RuleBasedBreakIterator from RBBIData.
|
|
|
|
**/
|
|
|
|
|
|
|
|
void TestCreateFromRBBIData(void);
|
|
|
|
|
2002-07-12 01:30:23 +00:00
|
|
|
/**
|
|
|
|
* Tests grouping effect of 'single quotes' in rules.
|
|
|
|
**/
|
2003-02-17 18:06:42 +00:00
|
|
|
void TestQuoteGrouping();
|
2002-07-12 01:30:23 +00:00
|
|
|
|
2002-07-30 19:09:14 +00:00
|
|
|
/**
|
|
|
|
* Tests word break status returns.
|
|
|
|
*/
|
2003-10-03 22:25:26 +00:00
|
|
|
void TestRuleStatus();
|
2004-03-05 22:37:54 +00:00
|
|
|
void TestRuleStatusVec();
|
2002-07-12 01:30:23 +00:00
|
|
|
|
2002-08-29 00:28:11 +00:00
|
|
|
void TestBug2190();
|
|
|
|
|
2002-11-27 02:40:34 +00:00
|
|
|
void TestBoilerPlate();
|
|
|
|
|
2002-11-08 00:22:18 +00:00
|
|
|
void TestRegistration();
|
|
|
|
|
2011-06-09 22:49:40 +00:00
|
|
|
void TestRefreshInputText();
|
|
|
|
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
|
|
|
*Internal subroutines
|
|
|
|
**/
|
|
|
|
/* Internal subroutine used by TestIsBoundary() */
|
2013-06-14 00:47:11 +00:00
|
|
|
void doBoundaryTest(BreakIterator& bi, UnicodeString& text, int32_t *boundaries);
|
2000-01-17 20:59:08 +00:00
|
|
|
|
|
|
|
/*Internal subroutine used for comparision of expected and acquired results */
|
2000-08-14 21:42:36 +00:00
|
|
|
void doTest(UnicodeString& testString, int32_t start, int32_t gotoffset, int32_t expectedOffset, const char* expected);
|
|
|
|
|
|
|
|
|
2000-01-17 20:59:08 +00:00
|
|
|
};
|
|
|
|
|
2008-09-25 05:48:27 +00:00
|
|
|
/**
|
|
|
|
* Special class to enable testing of protected functions in RuleBasedBreakIterator
|
|
|
|
*/
|
|
|
|
class RBBIWithProtectedFunctions: public RuleBasedBreakIterator {
|
|
|
|
public:
|
|
|
|
enum EDontAdopt {
|
|
|
|
kDontAdopt
|
|
|
|
};
|
|
|
|
RBBIWithProtectedFunctions(RBBIDataHeader* data, UErrorCode &status);
|
|
|
|
RBBIWithProtectedFunctions(const RBBIDataHeader* data, enum EDontAdopt dontAdopt, UErrorCode &status);
|
|
|
|
};
|
|
|
|
|
2002-09-21 00:43:14 +00:00
|
|
|
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
|
2000-01-17 20:59:08 +00:00
|
|
|
|
2002-09-21 00:43:14 +00:00
|
|
|
#endif
|