• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /********************************************************************
2  * COPYRIGHT:
3  * Copyright (c) 1997-2004, International Business Machines Corporation and
4  * others. All Rights Reserved.
5  ********************************************************************/
6 
7 #include "unicode/ucnv.h"
8 #include "unicode/ucnv_err.h"
9 
10 #include "cintltst.h"
11 #include "ustr_cnv.h"
12 void TestDefaultConverterError(void); /* keep gcc happy */
13 
14 
15 /* This makes sure that a converter isn't leaked when an error is passed to
16     u_getDefaultConverter */
TestDefaultConverterError(void)17 void TestDefaultConverterError(void) {
18     UErrorCode          err                 =   U_ZERO_ERROR;
19 
20     /* Remove the default converter */
21     ucnv_close(u_getDefaultConverter(&err));
22 
23     if (U_FAILURE(err)) {
24         log_err("Didn't expect a failure yet %s\n", myErrorName(err));
25         return;
26     }
27 
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");
32     }
33 }
34 
35 
36 
37