]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/cintltst/cctest.c
ICU-400.42.tar.gz
[apple/icu.git] / icuSources / test / cintltst / cctest.c
CommitLineData
b75a7d8f
A
1/********************************************************************
2 * COPYRIGHT:
374ca955 3 * Copyright (c) 1997-2004, International Business Machines Corporation and
b75a7d8f
A
4 * others. All Rights Reserved.
5 ********************************************************************/
6
7#include "unicode/ucnv.h"
8#include "unicode/ucnv_err.h"
9
10#include "cintltst.h"
374ca955
A
11#include "ustr_cnv.h"
12void TestDefaultConverterError(void); /* keep gcc happy */
b75a7d8f
A
13
14
374ca955
A
15/* This makes sure that a converter isn't leaked when an error is passed to
16 u_getDefaultConverter */
17void TestDefaultConverterError(void) {
b75a7d8f 18 UErrorCode err = U_ZERO_ERROR;
b75a7d8f 19
374ca955
A
20 /* Remove the default converter */
21 ucnv_close(u_getDefaultConverter(&err));
b75a7d8f 22
b75a7d8f 23 if (U_FAILURE(err)) {
374ca955
A
24 log_err("Didn't expect a failure yet %s\n", myErrorName(err));
25 return;
b75a7d8f
A
26 }
27
374ca955
A
28 /* Set to any radom error state */
29 err = U_FILE_ACCESS_ERROR;
30 if (u_getDefaultConverter(&err) != NULL) {
31 log_err("Didn't expect to get a converter on a failure\n");
b75a7d8f 32 }
b75a7d8f
A
33}
34
35
36