X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/fd0068a84e9996f225edba706498f6ed413d0673..46f4442e9a5a4f3b98b7c1083586332f6a8a99a4:/icuSources/test/intltest/ucdtest.cpp diff --git a/icuSources/test/intltest/ucdtest.cpp b/icuSources/test/intltest/ucdtest.cpp index e7195c25..49a82e35 100644 --- a/icuSources/test/intltest/ucdtest.cpp +++ b/icuSources/test/intltest/ucdtest.cpp @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2006, International Business Machines Corporation and + * Copyright (c) 1997-2008, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ @@ -12,7 +12,7 @@ #include "uparse.h" #include "ucdtest.h" -#define LENGTHOF(array) (sizeof(array)/sizeof(array[0])) +#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof(array[0])) UnicodeTest::UnicodeTest() { @@ -26,7 +26,8 @@ void UnicodeTest::runIndexedTest( int32_t index, UBool exec, const char* &name, { if (exec) logln("TestSuite UnicodeTest: "); switch (index) { - case 0: name = "TestAdditionalProperties"; if(exec) TestAdditionalProperties(); break; + case 0: name = "TestAdditionalProperties"; if(exec) TestAdditionalProperties(); break; + case 1: name = "TestBinaryValues"; if(exec) TestBinaryValues(); break; default: name = ""; break; //needed to end loop } } @@ -215,3 +216,47 @@ void UnicodeTest::TestAdditionalProperties() { } } } + +void UnicodeTest::TestBinaryValues() { + /* + * Unicode 5.1 explicitly defines binary property value aliases. + * Verify that they are all recognized. + */ + UErrorCode errorCode=U_ZERO_ERROR; + UnicodeSet alpha(UNICODE_STRING_SIMPLE("[:Alphabetic:]"), errorCode); + if(U_FAILURE(errorCode)) { + errln("UnicodeSet([:Alphabetic:]) failed - %s\n", u_errorName(errorCode)); + return; + } + + static const char *const falseValues[]={ "N", "No", "F", "False" }; + static const char *const trueValues[]={ "Y", "Yes", "T", "True" }; + int32_t i; + for(i=0; i