]> git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/utxttest.h
ICU-57166.0.1.tar.gz
[apple/icu.git] / icuSources / test / intltest / utxttest.h
1 /********************************************************************
2 * COPYRIGHT:
3 * Copyright (c) 2005-2016, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
6 /************************************************************************
7 * Tests for the UText and UTextIterator text abstraction classses
8 *
9 ************************************************************************/
10
11
12 #ifndef UTXTTEST_H
13 #define UTXTTEST_H
14
15 #include "unicode/utypes.h"
16 #include "unicode/unistr.h"
17 #include "unicode/utext.h"
18
19 #include "intltest.h"
20
21 /**
22 * @test
23 * @summary Testing the Replaceable class
24 */
25 class UTextTest : public IntlTest {
26 public:
27 UTextTest();
28 virtual ~UTextTest();
29
30 void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par=NULL);
31 void TextTest();
32 void ErrorTest();
33 void FreezeTest();
34 void Ticket5560();
35 void Ticket6847();
36 void Ticket10562();
37 void Ticket10983();
38 void Ticket12130();
39 void Ticket12888();
40
41 private:
42 struct m { // Map between native indices & code points.
43 int nativeIdx;
44 UChar32 cp;
45 };
46
47 void TestString(const UnicodeString &s);
48 void TestAccess(const UnicodeString &us, UText *ut, int cpCount, m *cpMap);
49 void TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCount, m *cpMap);
50 void TestCMR (const UnicodeString &us, UText *ut, int cpCount, m *nativeMap, m *utf16Map);
51 void TestCopyMove(const UnicodeString &us, UText *ut, UBool move,
52 int32_t nativeStart, int32_t nativeLimit, int32_t nativeDest,
53 int32_t u16Start, int32_t u16Limit, int32_t u16Dest);
54 void TestReplace(const UnicodeString &us, // reference UnicodeString in which to do the replace
55 UText *ut, // UnicodeText object under test.
56 int32_t nativeStart, // Range to be replaced, in UText native units.
57 int32_t nativeLimit,
58 int32_t u16Start, // Range to be replaced, in UTF-16 units
59 int32_t u16Limit, // for use in the reference UnicodeString.
60 const UnicodeString &repStr); // The replacement string
61
62
63 };
64
65
66 #endif