2017-01-20 00:20:31 +00:00
|
|
|
// © 2016 and later: Unicode, Inc. and others.
|
2016-06-15 18:58:17 +00:00
|
|
|
// License & terms of use: http://www.unicode.org/copyright.html
|
2000-03-10 00:42:27 +00:00
|
|
|
/********************************************************************
|
2016-04-19 00:26:46 +00:00
|
|
|
* COPYRIGHT:
|
2016-05-31 21:45:07 +00:00
|
|
|
* Copyright (c) 1999-2016 International Business Machines Corporation and
|
|
|
|
* others. All Rights Reserved.
|
2000-03-10 00:42:27 +00:00
|
|
|
********************************************************************/
|
|
|
|
/************************************************************************
|
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:
|
2016-04-19 00:26:46 +00:00
|
|
|
|
|
|
|
|
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
|
|
|
|
**/
|
2016-04-19 00:26:46 +00:00
|
|
|
// void TestConstruction(void);
|
2000-08-14 21:42:36 +00:00
|
|
|
/**
|
2016-04-19 00:26:46 +00:00
|
|
|
* Tests clone() and equals() methods of RuleBasedBreakIterator
|
2000-08-14 21:42:36 +00:00
|
|
|
**/
|
|
|
|
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);
|
|
|
|
|
2014-03-06 11:21:15 +00:00
|
|
|
void TestFilteredBreakIteratorBuilder(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
|
|
|
/**
|
2016-04-29 00:02:10 +00:00
|
|
|
* Test getting and using binary (compiled) rules.
|
2008-09-25 05:48:27 +00:00
|
|
|
**/
|
2016-04-29 00:02:10 +00:00
|
|
|
void TestGetBinaryRules(void);
|
2008-09-25 05:48:27 +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.
|
|
|
|
*/
|
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
|
|
|
|
**/
|
2016-04-19 00:26:46 +00:00
|
|
|
/* 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
|
|
|
};
|
|
|
|
|
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
|