1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (C) 1998-2012, International Business Machines Corporation
6 * and others. All Rights Reserved.
7 **********************************************************************
11 * Modification History:
13 * Date Name Description
14 * 4/26/2000 srl created
15 *******************************************************************************
18 #include "unicode/utypes.h"
21 #include "unicode/udata.h"
22 #include "unicode/ucnv.h"
25 extern const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT
;
32 UErrorCode status
= U_ZERO_ERROR
;
34 udata_setCommonData(NULL
, &status
);
35 printf("setCommonData(NULL) -> %s [should fail]\n", u_errorName(status
));
36 if(status
!= U_ILLEGAL_ARGUMENT_ERROR
)
38 printf("*** FAIL: should have returned U_ILLEGAL_ARGUMENT_ERROR\n");
42 status
= U_ZERO_ERROR
;
43 udata_setCommonData(&U_ICUDATA_ENTRY_POINT
, &status
);
44 printf("setCommonData(%p) -> %s\n", (void*)&U_ICUDATA_ENTRY_POINT
, u_errorName(status
));
47 printf("*** FAIL: should have returned U_ZERO_ERROR\n");
51 status
= U_ZERO_ERROR
;
52 c
= ucnv_open("iso-8859-3", &status
);
53 printf("ucnv_open(iso-8859-3)-> %p, err = %s, name=%s\n",
54 (void *)c
, u_errorName(status
), (!c
)?"?":ucnv_getName(c
,&status
) );
55 if(status
!= U_ZERO_ERROR
)
57 printf("\n*** FAIL: should have returned U_ZERO_ERROR;\n");
65 status
= U_ZERO_ERROR
;
66 udata_setCommonData(&U_ICUDATA_ENTRY_POINT
, &status
);
67 printf("setCommonData(%p) -> %s [should pass]\n", (void*) &U_ICUDATA_ENTRY_POINT
, u_errorName(status
));
68 if (U_FAILURE(status
) || status
== U_USING_DEFAULT_WARNING
)
70 printf("\n*** FAIL: should pass and not set U_USING_DEFAULT_ERROR\n");
74 printf("\n*** PASS PASS PASS, test PASSED!!!!!!!!\n");