2000-03-10 00:42:27 +00:00
|
|
|
/********************************************************************
|
|
|
|
* COPYRIGHT:
|
2001-03-21 20:09:56 +00:00
|
|
|
* Copyright (c) 1999-2001, 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
|
|
|
/**
|
|
|
|
* Testing the methods first(), next(), next(int) and following() of RuleBasedBreakIterator
|
|
|
|
**/
|
2000-01-17 20:59:08 +00:00
|
|
|
void TestFirstNextFollowing(void);
|
|
|
|
/**
|
2000-08-14 21:42:36 +00:00
|
|
|
* Testing the methods lastt(), previous(), and preceding() of RuleBasedBreakIterator
|
|
|
|
**/
|
2000-01-17 20:59:08 +00:00
|
|
|
void TestLastPreviousPreceding(void);
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
|
|
|
* Tests the method IsBoundary() of RuleBasedBreakIterator
|
|
|
|
**/
|
2003-02-17 18:06:42 +00:00
|
|
|
void TestIsBoundary(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
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
void TestWordStatus();
|
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();
|
|
|
|
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
|
|
|
*Internal subroutines
|
|
|
|
**/
|
|
|
|
/* Internal subroutine used by TestIsBoundary() */
|
2000-01-17 20:59:08 +00:00
|
|
|
void doBoundaryTest(RuleBasedBreakIterator& bi, UnicodeString& text, int32_t *boundaries);
|
|
|
|
|
|
|
|
/*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
|
|
|
};
|
|
|
|
|
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
|