/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2006, International Business Machines Corporation and
+ * Copyright (c) 1997-2010, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
-/*******************************************************************************
+/*****************************************************************************
*
* File CCONVTST.C
*
* Modification History:
* Name Description
* Madhu Katragadda 7/7/2000 Converter Tests for extended code coverage
-********************************************************************************
+******************************************************************************
*/
#include <stdio.h>
#include <stdlib.h>
static const uint8_t expected3MBCS[] = { 0x01, 0xa2, 0xb4, 0xa1, 0xe0};
static const int32_t offsets3MBCS[] = { 0x00, 0x01, 0x01, 0x02, 0x02};
- static const UChar sampleText4MBCS[] = { 0x0061, 0x00a6, 0xdc01};
+ static const UChar sampleText4MBCS[] = { 0x0061, 0xFFE4, 0xdc01};
static const uint8_t expected4MBCS[] = { 0x61, 0x8f, 0xa2, 0xc3, 0xf4, 0xfe};
static const int32_t offsets4MBCS[] = { 0x00, 0x01, 0x01, 0x01, 0x02, 0x02 };
log_verbose("\nConversion done [%d uchars in -> %d chars out]. \nResult :",
sourceLen, targ-junkout);
- if(VERBOSITY)
+ if(getTestOption(VERBOSITY_OPTION))
{
char junk[999];
char offset_str[999];
log_verbose("\nConversion done. %d bytes -> %d chars.\nResult :",
sourcelen, targ-junkout);
- if(VERBOSITY)
+ if(getTestOption(VERBOSITY_OPTION))
{
char junk[999];
char offset_str[999];
#endif
"IMAP-mailbox-name"
};
-
- static const char *const lmbcsNames[]={
#if !UCONFIG_NO_LEGACY_CONVERSION
+ static const char *const lmbcsNames[]={
"LMBCS-1",
"LMBCS-2",
"LMBCS-3",
"LMBCS-17",
"LMBCS-18",
"LMBCS-19"
-#endif
};
+#endif
static const NameRange nameRanges[]={
{ "US-ASCII", 0, 0x7f, -1, -1, 0x80, 0x10ffff },
#if !UCONFIG_NO_LEGACY_CONVERSION
{ "UTF-8", 0, 0xd7ff, 0xe000, 0x10ffff, 0xd800, 0xdfff },
{ "windows-1251", 0, 0x7f, 0x410, 0x44f, 0x3000, 0xd7ff },
- { "HZ", 0x410, 0x44f, 0x4e00, 0x4eff, 0xac00, 0xd7ff },
+ /* HZ test case fixed and moved to intltest's conversion.txt, ticket #6002 */
{ "shift-jis", 0x3041, 0x3093, 0x30a1, 0x30f3, 0x900, 0x1cff }
#else
{ "UTF-8", 0, 0xd7ff, 0xe000, 0x10ffff, 0xd800, 0xdfff }
name=ucnv_getAvailableName(i);
cnv=ucnv_open(name, &errorCode);
if(U_FAILURE(errorCode)) {
- log_err("error: unable to open converter %s - %s\n",
+ log_data_err("error: unable to open converter %s - %s\n",
name, u_errorName(errorCode));
continue;
}
name=completeSetNames[i];
cnv=ucnv_open(name, &errorCode);
if(U_FAILURE(errorCode)) {
- log_err("error: unable to open converter %s - %s\n",
+ log_data_err("error: unable to open converter %s - %s\n",
name, u_errorName(errorCode));
continue;
}
ucnv_close(cnv);
}
+#if !UCONFIG_NO_LEGACY_CONVERSION
/* test LMBCS variants which convert all of Unicode except for U+F6xx */
for(i=0; i<LENGTHOF(lmbcsNames); ++i) {
errorCode=U_ZERO_ERROR;
name=lmbcsNames[i];
cnv=ucnv_open(name, &errorCode);
if(U_FAILURE(errorCode)) {
- log_err("error: unable to open converter %s - %s\n",
+ log_data_err("error: unable to open converter %s - %s\n",
name, u_errorName(errorCode));
continue;
}
ucnv_close(cnv);
}
+#endif
/* test specific sets */
for(i=0; i<LENGTHOF(nameRanges); ++i) {