X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..3bb97ae2c034620e98ae804f2ed484db37b2e461:/icuSources/test/testmap/testmap.c diff --git a/icuSources/test/testmap/testmap.c b/icuSources/test/testmap/testmap.c index 793faa18..87ad62a7 100644 --- a/icuSources/test/testmap/testmap.c +++ b/icuSources/test/testmap/testmap.c @@ -1,6 +1,8 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** -* Copyright (C) 1998-2003, International Business Machines Corporation +* Copyright (C) 1998-2012, International Business Machines Corporation * and others. All Rights Reserved. ********************************************************************** * @@ -18,19 +20,16 @@ #include #include "unicode/udata.h" #include "unicode/ucnv.h" +#include "ucmndata.h" -extern const char U_IMPORT U_ICUDATA_ENTRY_POINT []; +extern const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT; int main(int argc, char **argv) { UConverter *c; - - int32_t month = -1, year = -1; UErrorCode status = U_ZERO_ERROR; - status = U_ZERO_ERROR; - udata_setCommonData(NULL, &status); printf("setCommonData(NULL) -> %s [should fail]\n", u_errorName(status)); @@ -41,8 +40,8 @@ main(int argc, } status = U_ZERO_ERROR; - udata_setCommonData(U_ICUDATA_ENTRY_POINT, &status); - printf("setCommonData(%p) -> %s\n", U_ICUDATA_ENTRY_POINT, u_errorName(status)); + udata_setCommonData(&U_ICUDATA_ENTRY_POINT, &status); + printf("setCommonData(%p) -> %s\n", (void*)&U_ICUDATA_ENTRY_POINT, u_errorName(status)); if(U_FAILURE(status)) { printf("*** FAIL: should have returned U_ZERO_ERROR\n"); @@ -50,8 +49,9 @@ main(int argc, } status = U_ZERO_ERROR; - c = ucnv_open("iso-8859-7", &status); - printf("ucnv_open(iso-8859-7)-> %p, err = %s, name=%s\n", c, u_errorName(status), (!c)?"?":ucnv_getName(c,&status) ); + c = ucnv_open("iso-8859-3", &status); + printf("ucnv_open(iso-8859-3)-> %p, err = %s, name=%s\n", + (void *)c, u_errorName(status), (!c)?"?":ucnv_getName(c,&status) ); if(status != U_ZERO_ERROR) { printf("\n*** FAIL: should have returned U_ZERO_ERROR;\n"); @@ -63,11 +63,11 @@ main(int argc, } status = U_ZERO_ERROR; - udata_setCommonData(U_ICUDATA_ENTRY_POINT, &status); - printf("setCommonData(%p) -> %s [should fail]\n", U_ICUDATA_ENTRY_POINT, u_errorName(status)); - if ( status != U_USING_DEFAULT_WARNING ) + udata_setCommonData(&U_ICUDATA_ENTRY_POINT, &status); + printf("setCommonData(%p) -> %s [should pass]\n", (void*) &U_ICUDATA_ENTRY_POINT, u_errorName(status)); + if (U_FAILURE(status) || status == U_USING_DEFAULT_WARNING ) { - printf("\n*** FAIL: should have returned U_USING_DEFAULT_ERROR\n"); + printf("\n*** FAIL: should pass and not set U_USING_DEFAULT_ERROR\n"); return 1; }