File: utxttest.h

package info (click to toggle)
icu 57.1-6%2Bdeb9u4
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 98,548 kB
  • sloc: cpp: 385,068; ansic: 161,995; makefile: 5,496; sh: 4,101; xml: 3,796; perl: 3,193; python: 471; sed: 35; lisp: 12
file content (66 lines) | stat: -rw-r--r-- 2,359 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/********************************************************************
 * COPYRIGHT: 
 * Copyright (c) 2005-2016, International Business Machines Corporation and
 * others. All Rights Reserved.
 ********************************************************************/
/************************************************************************
*   Tests for the UText and UTextIterator text abstraction classses
*
************************************************************************/


#ifndef UTXTTEST_H
#define UTXTTEST_H

#include "unicode/utypes.h"
#include "unicode/unistr.h"
#include "unicode/utext.h"

#include "intltest.h"

/**
 * @test
 * @summary Testing the Replaceable class
 */
class UTextTest : public IntlTest {
public:
    UTextTest();
    virtual ~UTextTest();

    void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par=NULL);
    void TextTest();
    void ErrorTest();
    void FreezeTest();
    void Ticket5560();
    void Ticket6847();
    void Ticket10562();
    void Ticket10983();
    void Ticket12130();
    void Ticket12888();

private:
    struct m {                              // Map between native indices & code points.
        int         nativeIdx;
        UChar32     cp;
    };

    void TestString(const UnicodeString &s);
    void TestAccess(const UnicodeString &us, UText *ut, int cpCount, m *cpMap);
    void TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCount, m *cpMap);
    void TestCMR   (const UnicodeString &us, UText *ut, int cpCount, m *nativeMap, m *utf16Map);
    void TestCopyMove(const UnicodeString &us, UText *ut, UBool move,
                      int32_t nativeStart, int32_t nativeLimit, int32_t nativeDest,
                      int32_t u16Start, int32_t u16Limit, int32_t u16Dest);
    void TestReplace(const UnicodeString &us,  // reference UnicodeString in which to do the replace 
            UText         *ut,                 // UnicodeText object under test.
            int32_t       nativeStart,         // Range to be replaced, in UText native units. 
            int32_t       nativeLimit,
            int32_t       u16Start,            // Range to be replaced, in UTF-16 units
            int32_t       u16Limit,            //    for use in the reference UnicodeString.
            const UnicodeString &repStr);      // The replacement string


};


#endif