]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/utxttest.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 2005-2016, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
8 /************************************************************************
9 * Tests for the UText and UTextIterator text abstraction classses
11 ************************************************************************/
17 #include "unicode/utypes.h"
18 #include "unicode/unistr.h"
19 #include "unicode/utext.h"
25 * @summary Testing the Replaceable class
27 class UTextTest
: public IntlTest
{
32 void runIndexedTest(int32_t index
, UBool exec
, const char* &name
, char* par
=NULL
);
44 struct m
{ // Map between native indices & code points.
49 void TestString(const UnicodeString
&s
);
50 void TestAccess(const UnicodeString
&us
, UText
*ut
, int cpCount
, m
*cpMap
);
51 void TestAccessNoClone(const UnicodeString
&us
, UText
*ut
, int cpCount
, m
*cpMap
);
52 void TestCMR (const UnicodeString
&us
, UText
*ut
, int cpCount
, m
*nativeMap
, m
*utf16Map
);
53 void TestCopyMove(const UnicodeString
&us
, UText
*ut
, UBool move
,
54 int32_t nativeStart
, int32_t nativeLimit
, int32_t nativeDest
,
55 int32_t u16Start
, int32_t u16Limit
, int32_t u16Dest
);
56 void TestReplace(const UnicodeString
&us
, // reference UnicodeString in which to do the replace
57 UText
*ut
, // UnicodeText object under test.
58 int32_t nativeStart
, // Range to be replaced, in UText native units.
60 int32_t u16Start
, // Range to be replaced, in UTF-16 units
61 int32_t u16Limit
, // for use in the reference UnicodeString.
62 const UnicodeString
&repStr
); // The replacement string