diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-10-26 07:13:09 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-10-26 07:13:09 +0000 |
commit | 74cc05c672add53f566ac385f117008e8c4b3eda (patch) | |
tree | ce973a7d2e4814a20d52a55b1a2131d1515e9911 /Build/source/libs/icu/icu-50.1/test/testmap/testmap.c | |
parent | 6439fb8917718c4d620170e1459a1d9e7ab3c441 (diff) |
icu 50.1 (50_rc)
git-svn-id: svn://tug.org/texlive/trunk@28087 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/icu/icu-50.1/test/testmap/testmap.c')
-rw-r--r-- | Build/source/libs/icu/icu-50.1/test/testmap/testmap.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/Build/source/libs/icu/icu-50.1/test/testmap/testmap.c b/Build/source/libs/icu/icu-50.1/test/testmap/testmap.c new file mode 100644 index 00000000000..395685bf3c6 --- /dev/null +++ b/Build/source/libs/icu/icu-50.1/test/testmap/testmap.c @@ -0,0 +1,73 @@ +/* +********************************************************************** +* Copyright (C) 1998-2010, International Business Machines Corporation +* and others. All Rights Reserved. +********************************************************************** +* +* File date.c +* +* Modification History: +* +* Date Name Description +* 4/26/2000 srl created +******************************************************************************* +*/ + +#include "unicode/utypes.h" +#include <stdio.h> +#include <string.h> +#include "unicode/udata.h" +#include "unicode/ucnv.h" + +extern const char U_IMPORT U_ICUDATA_ENTRY_POINT []; + +int +main(int argc, + char **argv) +{ + UConverter *c; + UErrorCode status = U_ZERO_ERROR; + + udata_setCommonData(NULL, &status); + printf("setCommonData(NULL) -> %s [should fail]\n", u_errorName(status)); + if(status != U_ILLEGAL_ARGUMENT_ERROR) + { + printf("*** FAIL: should have returned U_ILLEGAL_ARGUMENT_ERROR\n"); + return 1; + } + + status = U_ZERO_ERROR; + udata_setCommonData(U_ICUDATA_ENTRY_POINT, &status); + printf("setCommonData(%p) -> %s\n", U_ICUDATA_ENTRY_POINT, u_errorName(status)); + if(U_FAILURE(status)) + { + printf("*** FAIL: should have returned U_ZERO_ERROR\n"); + return 1; + } + + status = U_ZERO_ERROR; + c = ucnv_open("iso-8859-7", &status); + printf("ucnv_open(iso-8859-7)-> %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"); + return 1; + } + else + { + ucnv_close(c); + } + + status = U_ZERO_ERROR; + udata_setCommonData(U_ICUDATA_ENTRY_POINT, &status); + printf("setCommonData(%p) -> %s [should pass]\n", U_ICUDATA_ENTRY_POINT, u_errorName(status)); + if (U_FAILURE(status) || status == U_USING_DEFAULT_WARNING ) + { + printf("\n*** FAIL: should pass and not set U_USING_DEFAULT_ERROR\n"); + return 1; + } + + printf("\n*** PASS PASS PASS, test PASSED!!!!!!!!\n"); + return 0; +} |