Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: source/tools/gencolusb/verify_uset.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/tools/gencolusb/extract_unsafe_backwards.cpp ('k') | source/tools/gendict/gendict.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /**
2 * Copyright (c) 1999-2012, International Business Machines Corporation and
3 * others. All Rights Reserved.
4 *
5 * Test for source/i18n/collunsafe.h
6 */
7
8 #include <stdio.h>
9 #include "unicode/ucol.h"
10 #include "unicode/uniset.h"
11 #include "unicode/coll.h"
12 #include "collation.h"
13
14 #include "collunsafe.h"
15
16
17 int main(int argc, const char *argv[]) {
18 puts("verify");
19 UErrorCode errorCode = U_ZERO_ERROR;
20 #if defined (COLLUNSAFE_PATTERN)
21 puts("verify pattern");
22 const UnicodeString unsafeBackwardPattern(FALSE, collunsafe_pattern, collunsaf e_len);
23 fprintf(stderr, "\n -- pat '%c%c%c%c%c'\n",
24 collunsafe_pattern[0],
25 collunsafe_pattern[1],
26 collunsafe_pattern[2],
27 collunsafe_pattern[3],
28 collunsafe_pattern[4]);
29 if(U_SUCCESS(errorCode)) {
30 UnicodeSet us(unsafeBackwardPattern, errorCode);
31 fprintf(stderr, "\n%s:%d: err creating set %s\n", __FILE__, __LINE__, u_erro rName(errorCode));
32 }
33 #endif
34
35 #if defined (COLLUNSAFE_RANGE)
36 {
37 puts("verify range");
38 UnicodeSet u;
39 for(int32_t i=0;i<unsafe_rangeCount*2;i+=2) {
40 u.add(unsafe_ranges[i+0],unsafe_ranges[i+1]);
41 }
42 printf("Finished with %d ranges\n", u.getRangeCount());
43 }
44 #endif
45
46 #if defined (COLLUNSAFE_SERIALIZE)
47 {
48 puts("verify serialize");
49 UnicodeSet u(unsafe_serializedData, unsafe_serializedCount, UnicodeSet::kSer ialized, errorCode);
50 fprintf(stderr, "\n%s:%d: err creating set %s\n", __FILE__, __LINE__, u_erro rName(errorCode));
51 printf("Finished deserialize with %d ranges\n", u.getRangeCount());
52 }
53 #endif
54 // if(tailoring.unsafeBackwardSet == NULL) {
55 // errorCode = U_MEMORY_ALLOCATION_ERROR;
56 // fprintf(stderr, "\n%s:%d: err %s\n", __FILE__, __LINE__, u_errorName(erro rCode));
57 // }
58 puts("verify col UCA");
59 if(U_SUCCESS(errorCode)) {
60 Collator *col = Collator::createInstance(Locale::getEnglish(), errorCode);
61 fprintf(stderr, "\n%s:%d: err %s creating collator\n", __FILE__, __LINE__, u _errorName(errorCode));
62 }
63
64 if(U_FAILURE(errorCode)) {
65 return 1;
66 } else {
67 return 0;
68 }
69 }
OLDNEW
« no previous file with comments | « source/tools/gencolusb/extract_unsafe_backwards.cpp ('k') | source/tools/gendict/gendict.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698