1 // Copyright (C) 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);
43 struct m { // Map between native indices & code points.
48 void TestString(const UnicodeString &s);
49 void TestAccess(const UnicodeString &us, UText *ut, int cpCount, m *cpMap);
50 void TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCount, m *cpMap);
51 void TestCMR (const UnicodeString &us, UText *ut, int cpCount, m *nativeMap, m *utf16Map);
52 void TestCopyMove(const UnicodeString &us, UText *ut, UBool move,
53 int32_t nativeStart, int32_t nativeLimit, int32_t nativeDest,
54 int32_t u16Start, int32_t u16Limit, int32_t u16Dest);
55 void TestReplace(const UnicodeString &us, // reference UnicodeString in which to do the replace
56 UText *ut, // UnicodeText object under test.
57 int32_t nativeStart, // Range to be replaced, in UText native units.
59 int32_t u16Start, // Range to be replaced, in UTF-16 units
60 int32_t u16Limit, // for use in the reference UnicodeString.
61 const UnicodeString &repStr); // The replacement string