2 **********************************************************************
3 * Copyright (C) 1998-2012, International Business Machines Corporation
4 * and others. All Rights Reserved.
5 **********************************************************************
9 * Modification History:
11 * Date Name Description
12 * 4/26/2000 srl created
13 *******************************************************************************
16 #include "unicode/utypes.h"
19 #include "unicode/udata.h"
20 #include "unicode/ucnv.h"
23 extern const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT
;
30 UErrorCode status
= U_ZERO_ERROR
;
32 udata_setCommonData(NULL
, &status
);
33 printf("setCommonData(NULL) -> %s [should fail]\n", u_errorName(status
));
34 if(status
!= U_ILLEGAL_ARGUMENT_ERROR
)
36 printf("*** FAIL: should have returned U_ILLEGAL_ARGUMENT_ERROR\n");
40 status
= U_ZERO_ERROR
;
41 udata_setCommonData(&U_ICUDATA_ENTRY_POINT
, &status
);
42 printf("setCommonData(%p) -> %s\n", (void*)&U_ICUDATA_ENTRY_POINT
, u_errorName(status
));
45 printf("*** FAIL: should have returned U_ZERO_ERROR\n");
49 status
= U_ZERO_ERROR
;
50 c
= ucnv_open("iso-8859-3", &status
);
51 printf("ucnv_open(iso-8859-3)-> %p, err = %s, name=%s\n",
52 (void *)c
, u_errorName(status
), (!c
)?"?":ucnv_getName(c
,&status
) );
53 if(status
!= U_ZERO_ERROR
)
55 printf("\n*** FAIL: should have returned U_ZERO_ERROR;\n");
63 status
= U_ZERO_ERROR
;
64 udata_setCommonData(&U_ICUDATA_ENTRY_POINT
, &status
);
65 printf("setCommonData(%p) -> %s [should pass]\n", (void*) &U_ICUDATA_ENTRY_POINT
, u_errorName(status
));
66 if (U_FAILURE(status
) || status
== U_USING_DEFAULT_WARNING
)
68 printf("\n*** FAIL: should pass and not set U_USING_DEFAULT_ERROR\n");
72 printf("\n*** PASS PASS PASS, test PASSED!!!!!!!!\n");