From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- intl/icu/source/tools/gencolusb/verify_uset.cpp | 71 +++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 intl/icu/source/tools/gencolusb/verify_uset.cpp (limited to 'intl/icu/source/tools/gencolusb/verify_uset.cpp') diff --git a/intl/icu/source/tools/gencolusb/verify_uset.cpp b/intl/icu/source/tools/gencolusb/verify_uset.cpp new file mode 100644 index 0000000000..03a4930489 --- /dev/null +++ b/intl/icu/source/tools/gencolusb/verify_uset.cpp @@ -0,0 +1,71 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/** + * Copyright (c) 1999-2012, International Business Machines Corporation and + * others. All Rights Reserved. + * + * Test for source/i18n/collunsafe.h + */ + +#include +#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