]>
Commit | Line | Data |
---|---|---|
f3c0d7a5 A |
1 | // © 2016 and later: Unicode, Inc. and others. |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
b75a7d8f A |
3 | /* |
4 | ********************************************************************** | |
729e4ab9 | 5 | * Copyright (C) 2001-2009, International Business Machines |
b75a7d8f A |
6 | * Corporation and others. All Rights Reserved. |
7 | ********************************************************************** | |
8 | * Date Name Description | |
9 | * 05/23/00 aliu Creation. | |
10 | ********************************************************************** | |
11 | */ | |
12 | #ifndef TESTUTIL_H | |
13 | #define TESTUTIL_H | |
14 | ||
0f5d89e8 A |
15 | #include "unicode/utypes.h" |
16 | #include "unicode/edits.h" | |
17 | #include "unicode/unistr.h" | |
46f4442e | 18 | #include "intltest.h" |
b75a7d8f | 19 | |
0f5d89e8 A |
20 | struct EditChange { |
21 | UBool change; | |
22 | int32_t oldLength, newLength; | |
23 | }; | |
24 | ||
b75a7d8f | 25 | /** |
0f5d89e8 | 26 | * Utility methods. Everything in this class is static. |
b75a7d8f A |
27 | */ |
28 | class TestUtility { | |
b75a7d8f | 29 | public: |
729e4ab9 | 30 | static UnicodeString &appendHex(UnicodeString &buf, UChar32 ch); |
b75a7d8f | 31 | |
729e4ab9 | 32 | static UnicodeString hex(UChar32 ch); |
b75a7d8f A |
33 | |
34 | static UnicodeString hex(const UnicodeString& s); | |
35 | ||
36 | static UnicodeString hex(const UnicodeString& s, UChar sep); | |
37 | ||
0f5d89e8 | 38 | static UnicodeString hex(const uint8_t* bytes, int32_t len); |
729e4ab9 | 39 | |
0f5d89e8 A |
40 | static UBool checkEqualEdits(IntlTest &test, const UnicodeString &name, |
41 | const Edits &e1, const Edits &e2, UErrorCode &errorCode); | |
42 | ||
43 | static void checkEditsIter( | |
44 | IntlTest &test, const UnicodeString &name, | |
45 | Edits::Iterator ei1, Edits::Iterator ei2, // two equal iterators | |
46 | const EditChange expected[], int32_t expLength, UBool withUnchanged, | |
47 | UErrorCode &errorCode); | |
b75a7d8f | 48 | |
0f5d89e8 A |
49 | private: |
50 | TestUtility() = delete; // Prevent instantiation | |
b75a7d8f A |
51 | }; |
52 | ||
53 | #endif |