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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/tools/gencolusb/verify_uset.cpp
diff --git a/source/tools/gencolusb/verify_uset.cpp b/source/tools/gencolusb/verify_uset.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7a44040f4b68f316a0fa884894e511e8d7b556d7
--- /dev/null
+++ b/source/tools/gencolusb/verify_uset.cpp
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 1999-2012, International Business Machines Corporation and
+ * others. All Rights Reserved.
+ *
+ * Test for source/i18n/collunsafe.h
+ */
+
+#include <stdio.h>
+#include "unicode/ucol.h"
+#include "unicode/uniset.h"
+#include "unicode/coll.h"
+#include "collation.h"
+
+#include "collunsafe.h"
+
+
+int main(int argc, const char *argv[]) {
+ puts("verify");
+ UErrorCode errorCode = U_ZERO_ERROR;
+#if defined (COLLUNSAFE_PATTERN)
+ puts("verify pattern");
+ const UnicodeString unsafeBackwardPattern(FALSE, collunsafe_pattern, collunsafe_len);
+ fprintf(stderr, "\n -- pat '%c%c%c%c%c'\n",
+ collunsafe_pattern[0],
+ collunsafe_pattern[1],
+ collunsafe_pattern[2],
+ collunsafe_pattern[3],
+ collunsafe_pattern[4]);
+ if(U_SUCCESS(errorCode)) {
+ UnicodeSet us(unsafeBackwardPattern, errorCode);
+ fprintf(stderr, "\n%s:%d: err creating set %s\n", __FILE__, __LINE__, u_errorName(errorCode));
+ }
+#endif
+
+#if defined (COLLUNSAFE_RANGE)
+ {
+ puts("verify range");
+ UnicodeSet u;
+ for(int32_t i=0;i<unsafe_rangeCount*2;i+=2) {
+ u.add(unsafe_ranges[i+0],unsafe_ranges[i+1]);
+ }
+ printf("Finished with %d ranges\n", u.getRangeCount());
+ }
+#endif
+
+#if defined (COLLUNSAFE_SERIALIZE)
+ {
+ puts("verify serialize");
+ UnicodeSet u(unsafe_serializedData, unsafe_serializedCount, UnicodeSet::kSerialized, errorCode);
+ fprintf(stderr, "\n%s:%d: err creating set %s\n", __FILE__, __LINE__, u_errorName(errorCode));
+ printf("Finished deserialize with %d ranges\n", u.getRangeCount());
+ }
+#endif
+// if(tailoring.unsafeBackwardSet == NULL) {
+ // errorCode = U_MEMORY_ALLOCATION_ERROR;
+ // fprintf(stderr, "\n%s:%d: err %s\n", __FILE__, __LINE__, u_errorName(errorCode));
+ // }
+ puts("verify col UCA");
+ if(U_SUCCESS(errorCode)) {
+ Collator *col = Collator::createInstance(Locale::getEnglish(), errorCode);
+ fprintf(stderr, "\n%s:%d: err %s creating collator\n", __FILE__, __LINE__, u_errorName(errorCode));
+ }
+
+ if(U_FAILURE(errorCode)) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
« 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