ICU-401 Make 1.6 tree compiled and linked on S/400.

X-SVN-Rev: 2233
This commit is contained in:
Helena Chapman 2000-08-14 23:35:57 +00:00
parent 123caf9bbd
commit 3f2fb26333
44 changed files with 147 additions and 191 deletions

View File

@ -35,9 +35,7 @@
#include "unicode/umachine.h"
#include "unicode/utf.h"
#ifndef __OS400__
#include <memory.h>
#endif
#include <stdlib.h>
/*===========================================================================*/

View File

@ -63,7 +63,7 @@ void TestGetDefaultRules(){
const UChar * defaultRulesArray=ucol_getDefaultRulesArray(&size);
log_verbose("Test the function ucol_getDefaultRulesArray()\n");
coll = ucol_openRules(defaultRulesArray, size, UCOL_DECOMP_CAN, 0, &status);
coll = ucol_openRules(defaultRulesArray, size, UCOL_DECOMP_CAN, UCOL_PRIMARY, &status);
ucol_setNormalization(coll, UCOL_DEFAULT_NORMALIZATION);
if(U_SUCCESS(status) && coll !=NULL) {
binColData = (uint8_t*)ucol_cloneRuleData(coll, &len1, &status);

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Creation
*********************************************************************************
*********************************************************************************/
/*C API TEST FOR BREAKITERATOR */
/**
* This is an API test. It doesn't test very many cases, and doesn't
@ -80,7 +80,7 @@ void TestBreakIteratorCAPI()
log_verbose("PASS: Successfully opened character breakiterator\n");
}
/*trying to open an illegal iterator*/
bogus = ubrk_open(4, "en_US", text, u_strlen(text), &status);
bogus = ubrk_open((UBreakIteratorType)4, "en_US", text, u_strlen(text), &status);
if(U_SUCCESS(status)){
log_err("FAIL: Error in ubrk_open() for BOGUS breakiterator. Expected U_MEMORY_ALLOCATION_ERROR");
}

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Creation
*********************************************************************************
*********************************************************************************/
/* C API TEST FOR BREAKITERATOR */
#ifndef _CBRKITRAPITST

View File

@ -46,7 +46,9 @@ testManyInverseBiDi(UBiDi *pBiDi, UBiDiLevel direction);
static void
testInverseBiDi(UBiDi *pBiDi, const UChar *src, int32_t srcLength, UBiDiLevel direction, UErrorCode *pErrorCode);
static char *levelString;
/* helpers ------------------------------------------------------------------ */
static char *levelString="...............................................................";
static UChar *
getStringFromDirProps(const uint8_t *dirProps, UTextOffset length);
@ -740,10 +742,6 @@ doArabicShapingTest() {
}
}
/* helpers ------------------------------------------------------------------ */
static char *levelString="...............................................................";
/* return a string with characters according to the desired directional properties */
static UChar *
getStringFromDirProps(const uint8_t *dirProps, UTextOffset length) {

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Creation
*********************************************************************************
*********************************************************************************/
/* C API AND FUNCTIONALITY TEST FOR CALENDAR (ucol.h)*/
@ -215,7 +215,7 @@ void TestCalendar()
log_err("FAIL: set/getFirstDayOfWeek failed\n");
}
/*get bogus Attribute*/
count=ucal_getAttribute(calit, 99); /* BOGUS_ATTRIBUTE */
count=ucal_getAttribute(calit, (UCalendarAttribute)99); /* BOGUS_ATTRIBUTE */
if(count != -1){
log_err("FAIL: get/bogus attribute should return -1\n");
}
@ -623,7 +623,7 @@ void TestAddRollExtensive()
if (U_FAILURE(status)) { log_err("ucal_add failed: %s\n", myErrorName(status) ); return; }
++m;
checkDate(cal, y, m, d);
ucal_add(cal, -1, 10, &status);
ucal_add(cal, (UCalendarDateFields)-1, 10, &status);
if(status==U_ILLEGAL_ARGUMENT_ERROR)
log_verbose("Pass: Illegal argument error as expected\n");
else{
@ -657,7 +657,7 @@ void TestAddRollExtensive()
if (U_FAILURE(status)) { log_err("ucal_roll failed: %s\n", myErrorName(status) ); return; }
d = 2;
checkDate(cal, y, m, d);
ucal_roll(cal, -1, 10, &status);
ucal_roll(cal, (UCalendarDateFields)-1, 10, &status);
if(status==U_ILLEGAL_ARGUMENT_ERROR)
log_verbose("Pass: illegal arguement error as expected\n");
else{
@ -814,7 +814,7 @@ void TestGetLimits()
/*get BOGUS_LIMIT type*/
val=ucal_getLimit(cal, UCAL_SECOND, 99, &status);
val=ucal_getLimit(cal, UCAL_SECOND, (UCalendarLimitType)99, &status);
if(val != -1){
log_err("FAIL: ucal_getLimit() with BOGUS type should return -1\n");
}

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Creation
*********************************************************************************
*********************************************************************************/
/* C API TEST FOR CALENDAR */
#ifndef _CCALTST
#define _CCALTST

View File

@ -172,33 +172,6 @@ void TestConvert()
"ko_KR"
};
/* UChar CodePagesFlakySequence[NUM_CODEPAGE][20] =
{
{(UChar)0xAC10,
(UChar)0xAC11,
(UChar)0xAC12,
(UChar)0xAC13,
(UChar)0xAC14,
(UChar)0xAC15,
(UChar)0xAC16,
(UChar)0xAC17,
(UChar)0xd7a4, /*Offensive Codepoint*/
/* (UChar)0xAC14,
(UChar)0xAC15}
};
char CodePagesFlakyCharSequence[NUM_CODEPAGE][20] =
{
{ (char)0xB0, (char)0xA8,
(char)0xB0, (char)0xA9,
(char)0xB0, (char)0xAA,
(char)0xB0, (char)0xAB,
(char)0xb0, (char)0xff,/*Offensive Codepoint*/
/* (char)0xB0, (char)0xAC,
(char)0xB0, (char)0xAD
}
};*/
UConverterFromUCallback oldFromUAction = NULL;
UConverterToUCallback oldToUAction = NULL;
void* oldFromUContext = NULL;

View File

@ -107,9 +107,9 @@ void currTest()
ucol_getSortKey(c, target, u_strlen(target), sortKey2, sortklen+1);
res = memcmp(sortKey1, sortKey2, sortklen);
if (res < 0) keyResult = -1;
else if (res > 0) keyResult = 1;
else keyResult = 0;
if (res < 0) keyResult = (UCollationResult)-1;
else if (res > 0) keyResult = (UCollationResult)1;
else keyResult = (UCollationResult)0;
reportCResult(source, target, sortKey1, sortKey2,
compareResult, keyResult, expectedResult);

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/**
* CollationDanishTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Converted to C
*********************************************************************************
*********************************************************************************/
/**
* CollationDanishTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/**
* CollationGermanTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Converted to C
*********************************************************************************
*********************************************************************************/
/**
* CollationGERMANTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/**
* CollationSpanishTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Converted to C
*********************************************************************************
*********************************************************************************/
/**
* CollationSpanishTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/**
* CollationFinnishTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Converted to C
*********************************************************************************
*********************************************************************************/
/**
* CollationFinnishTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/**
* CollationFrenchTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Converted to C
*********************************************************************************
*********************************************************************************/
/**
* CollationFrenchTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/**
* G7CollationTest is a third level test class. This test performs the examples
* mentioned on the Taligent international demos web site.

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Converted to C
*********************************************************************************
*********************************************************************************/
/**
* G7CollationTest is a third level test class. This test performs the examples
* mentioned on the Taligent international demos web site.

View File

@ -229,7 +229,7 @@ int32_t hashChars(const void* key) {
UBool isEqualChars(const void* key1, const void* key2) {
return (UBool)((key1 != NULL) &&
(key2 != NULL) &&
(uprv_strcmp(key1, key2) == 0));
(uprv_strcmp((const char*)key1, (const char*)key2) == 0));
}
/**********************************************************************

View File

@ -76,7 +76,7 @@ int main ( int argc, const char **argv )
root = NULL;
addAllTests(&root);
nerrors = processArgs(root, argc, argv);
nerrors = processArgs(root, argc, (const char**)argv);
cleanUpTestTree(root);
cleanUpDataTable();
ctst_freeAll();

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/*
* Collation Iterator tests.
* (Let me reiterate my position...)

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Converted to C
*********************************************************************************
*********************************************************************************/
/**
* Collation Iterator tests.

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/**
* CollationKannaTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Converted to C
*********************************************************************************
*********************************************************************************/
/**
* CollationKannaTest(JAPAN) is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -24,7 +24,63 @@
void PrintDataTable();
static char* rawData2[23][5];
/*---------------------------------------------------
table of valid data
--------------------------------------------------- */
static char* rawData2[23][5] = {
/* language code */
{ "en", "fr", "hr", "el", "no" },
/* country code */
{ "US", "FR", "HR", "GR", "NO" },
/* variant code */
{ "", "", "", "", "NY" },
/* full name */
{ "en_US", "fr_FR", "hr_HR", "el_GR", "no_NO_NY" },
/* ISO-3 language */
{ "eng", "fra", "hrv", "ell", "nor" },
/* ISO-3 country */
{ "USA", "FRA", "HRV", "GRC", "NOR" },
/* LCID (not currently public) */
{ "409", "40c", "41a", "408", "814" },
/* display langage (English) */
{ "English", "French", "Croatian", "Greek", "Norwegian" },
/* display country (English) */
{ "United States", "France", "Croatia", "Greece", "Norway" },
/* display variant (English) */
{ "", "", "", "", "Nynorsk" },
/* display name (English) */
{ "English (United States)", "French (France)", "Croatian (Croatia)", "Greek (Greece)", "Norwegian (Norway, Nynorsk)" },
/* display langage (French) */
{ "anglais", "fran\\u00E7ais", "", "grec", "norv\\u00E9gien" },
/* display country (French) */
{ "\\u00C9tats-Unis", "France", "", "Gr\\u00E8ce", "Norv\\u00E8ge" },
/* display variant (French) */
{ "", "", "", "", "Nynorsk" },
/* display name (French) */
{ "anglais (\\u00C9tats-Unis)", "fran\\u00E7ais (France)", "", "grec (Gr\\u00E8ce)", "norv\\u00E9gien (Norv\\u00E8ge, Nynorsk)" },
/* display langage (Croatian) */
{ "", "", "hrvatski", "", "" },
/* display country (Croatian) */
{ "", "", "Hrvatska", "", "" },
/* display variant (Croatian) */
{ "", "", "", "", "" },
/* display name (Croatian) */
{ "", "", "hrvatski (Hrvatska)", "", "" },
/* display langage (Greek) [actual values listed below] */
{ "", "", "", "", "" },
/* display country (Greek) [actual values listed below] */
{ "", "", "", "", "" },
/* display variant (Greek) */
{ "", "", "", "", "" },
/* display name (Greek) [actual values listed below] */
{ "", "", "", "", "" }
};
static UChar*** dataTable=0;
enum {
@ -608,64 +664,6 @@ void TestISOFunctions()
/*---------------------------------------------------
table of valid data
--------------------------------------------------- */
static char* rawData2[23][5] = {
/* language code */
{ "en", "fr", "hr", "el", "no" },
/* country code */
{ "US", "FR", "HR", "GR", "NO" },
/* variant code */
{ "", "", "", "", "NY" },
/* full name */
{ "en_US", "fr_FR", "hr_HR", "el_GR", "no_NO_NY" },
/* ISO-3 language */
{ "eng", "fra", "hrv", "ell", "nor" },
/* ISO-3 country */
{ "USA", "FRA", "HRV", "GRC", "NOR" },
/* LCID (not currently public) */
{ "409", "40c", "41a", "408", "814" },
/* display langage (English) */
{ "English", "French", "Croatian", "Greek", "Norwegian" },
/* display country (English) */
{ "United States", "France", "Croatia", "Greece", "Norway" },
/* display variant (English) */
{ "", "", "", "", "Nynorsk" },
/* display name (English) */
{ "English (United States)", "French (France)", "Croatian (Croatia)", "Greek (Greece)", "Norwegian (Norway, Nynorsk)" },
/* display langage (French) */
{ "anglais", "fran\\u00E7ais", "", "grec", "norv\\u00E9gien" },
/* display country (French) */
{ "\\u00C9tats-Unis", "France", "", "Gr\\u00E8ce", "Norv\\u00E8ge" },
/* display variant (French) */
{ "", "", "", "", "Nynorsk" },
/* display name (French) */
{ "anglais (\\u00C9tats-Unis)", "fran\\u00E7ais (France)", "", "grec (Gr\\u00E8ce)", "norv\\u00E9gien (Norv\\u00E8ge, Nynorsk)" },
/* display langage (Croatian) */
{ "", "", "hrvatski", "", "" },
/* display country (Croatian) */
{ "", "", "Hrvatska", "", "" },
/* display variant (Croatian) */
{ "", "", "", "", "" },
/* display name (Croatian) */
{ "", "", "hrvatski (Hrvatska)", "", "" },
/* display langage (Greek) [actual values listed below] */
{ "", "", "", "", "" },
/* display country (Greek) [actual values listed below] */
{ "", "", "", "", "" },
/* display variant (Greek) */
{ "", "", "", "", "" },
/* display name (Greek) [actual values listed below] */
{ "", "", "", "", "" }
};
static UChar greekDisplayLanguage[] = { 0x03b5, 0x03bb, 0x03bb, 0x03b7, 0x03bd, 0x03b9, 0x03ba, 0x03ac, 0 };
static UChar greekDisplayCountry[] = { 0x0395, 0x03bb, 0x03bb, 0x03ac, 0x03b4, 0x03b1, 0 };
static UChar greekDisplayName[] = { 0x03b5, 0x03bb, 0x03bb, 0x03b7, 0x03bd, 0x03b9, 0x03ba,
@ -675,10 +673,10 @@ static UChar greekDisplayName[] = { 0x03b5, 0x03bb, 0x03bb, 0x03b7, 0x03bd, 0x03
void setUpDataTable()
{
int32_t i,j;
dataTable = calloc(sizeof(UChar**),23);
dataTable = (UChar***)(calloc(sizeof(UChar**),23));
for (i = 0; i < 23; i++) {
dataTable[i] = calloc(sizeof(UChar*),5);
dataTable[i] = (UChar**)(calloc(sizeof(UChar*),5));
for (j = 0; j < 5; j++){
dataTable[i][j] = CharsToUChars(rawData2[i][j]);
}

View File

@ -22,7 +22,7 @@ static void addLocaleTests(TestNode**);
/**
Test functions to set and get data fields
/**/
**/
static void TestBasicGetters(void);
/**
* Use Locale to access Resource file data and compare against expected values

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/*tests for u_normalization*/
#include "unicode/utypes.h"
#include "unicode/ucol.h"

View File

@ -395,14 +395,14 @@ free(temp1);
for(i = 0; i < UNUM_FORMAT_SYMBOL_COUNT; ++i) {
symbol[0] = (UChar)(0x41 + i);
symbol[1] = (UChar)(0x61 + i);
unum_setSymbol(cur_frpattern, i, symbol, 2, &status);
unum_setSymbol(cur_frpattern, (UNumberFormatSymbol)i, symbol, 2, &status);
if(U_FAILURE(status)) {
log_err("Error from unum_setSymbol(%d): %s\n", i, myErrorName(status));
return;
}
}
for(i = 0; i < UNUM_FORMAT_SYMBOL_COUNT; ++i) {
resultlength = unum_getSymbol(cur_frpattern, i, symbol, sizeof(symbol)/U_SIZEOF_UCHAR, &status);
resultlength = unum_getSymbol(cur_frpattern, (UNumberFormatSymbol)i, symbol, sizeof(symbol)/U_SIZEOF_UCHAR, &status);
if(U_FAILURE(status)) {
log_err("Error from unum_getSymbol(%d): %s\n", i, myErrorName(status));
return;
@ -412,7 +412,7 @@ free(temp1);
}
}
/*try getting from a bogus symbol*/
unum_getSymbol(cur_frpattern, i, symbol, sizeof(symbol)/U_SIZEOF_UCHAR, &status);
unum_getSymbol(cur_frpattern, (UNumberFormatSymbol)i, symbol, sizeof(symbol)/U_SIZEOF_UCHAR, &status);
if(U_SUCCESS(status)){
log_err("Error : Expected U_ILLEGAL_ARGUMENT_ERROR for bogus symbol");
}

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/**
* CollationTurkishTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Converted to C
*********************************************************************************
*********************************************************************************/
/**
* CollationTurkishTest(JAPAN) is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -590,10 +590,10 @@ void setUpDataTable()
{
int32_t i,j;
if(dataTable == NULL) {
dataTable = calloc(sizeof(UChar**),3);
dataTable = (UChar***)calloc(sizeof(UChar**),3);
for (i = 0; i < 3; i++) {
dataTable[i] = calloc(sizeof(UChar*),4);
dataTable[i] = (UChar**)calloc(sizeof(UChar*),4);
for (j = 0; j < 4; j++){
dataTable[i][j] = (UChar*) malloc(sizeof(UChar)*(strlen(raw[i][j])+1));
u_uastrcpy(dataTable[i][j],raw[i][j]);

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Ported for C API
*********************************************************************************
*********************************************************************************/
/**
* CollationEnglishTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -10,7 +10,7 @@
* Modification History:
* Name Description
* Madhu Katragadda Converted to C
*********************************************************************************
*********************************************************************************/
/**
* CollationEnglishTest is a third level test class. This tests the locale
* specific primary, secondary and tertiary rules. For example, the ignorable

View File

@ -220,7 +220,7 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t
}
log_verbose(junk);
printSeq(expect, expectLen);
printSeq((const unsigned char*)expect, expectLen);
if ( checkOffsets )
{
log_verbose("\nOffsets:");
@ -235,8 +235,8 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t
{
log_err("Expected %d chars out, got %d %s\n", expectLen, targ-junkout, gNuConvTestName);
log_verbose("Expected %d chars out, got %d %s\n", expectLen, targ-junkout, gNuConvTestName);
printSeqErr(junkout, targ-junkout);
printSeqErr(expect, expectLen);
printSeqErr((const unsigned char*)junkout, targ-junkout);
printSeqErr((const unsigned char*)expect, expectLen);
return FALSE;
}
@ -246,7 +246,7 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t
if(memcmp(junokout,expectOffsets,(targ-junkout) * sizeof(int32_t) )){
log_err("\ndid not get the expected offsets while %s \n", gNuConvTestName);
log_err("Got : ");
printSeqErr(junkout, targ-junkout);
printSeqErr((const unsigned char*)junkout, targ-junkout);
for(p=junkout;p<targ;p++)
log_err("%d, ", junokout[p-junkout]);
log_err("\nExpected: ");
@ -265,8 +265,8 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t
{
log_err("String does not match. %s\n", gNuConvTestName);
log_verbose("String does not match. %s\n", gNuConvTestName);
printSeqErr(junkout, expectLen);
printSeqErr(expect, expectLen);
printSeqErr((const unsigned char*)junkout, expectLen);
printSeqErr((const unsigned char*)expect, expectLen);
return FALSE;
}
}

View File

@ -664,7 +664,7 @@ UBool convertFromU( const UChar *source, int sourceLen, const uint8_t *expect,
log_err("Expected %d chars out, got %d FROM Unicode to %s\n", expectLen, targ-buffer, codepage);
log_verbose("Expected %d chars out, got %d FROM Unicode to %s\n", expectLen, targ-buffer, codepage);
printSeqErr((const unsigned char *)buffer, targ-buffer);
printSeqErr(expect, expectLen);
printSeqErr((const unsigned char*)expect, expectLen);
return FALSE;
}
@ -686,7 +686,7 @@ UBool convertFromU( const UChar *source, int sourceLen, const uint8_t *expect,
if(memcmp(offsetBuffer,expectOffsets,(targ-buffer) * sizeof(int32_t) )){
log_err("did not get the expected offsets. for FROM Unicode to %s\n", codepage);
printf("\nGot : ");
printSeqErr(buffer, targ-buffer);
printSeqErr((const unsigned char*)buffer, targ-buffer);
for(p=buffer;p<targ;p++)
printf("%d, ", offsetBuffer[p-buffer]);
printf("\nExpected: ");
@ -922,9 +922,9 @@ UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expe
log_err("Expected %d chars out, got %d %s\n", expectLen, targ-junkout, gNuConvTestName);
log_verbose("Expected %d chars out, got %d %s\n", expectLen, targ-junkout, gNuConvTestName);
printf("\nGot:");
printSeqErr(junkout, targ-junkout);
printSeqErr((const unsigned char*)junkout, targ-junkout);
printf("\nExpected:");
printSeqErr(expect, expectLen);
printSeqErr((const unsigned char*)expect, expectLen);
return FALSE;
}
@ -934,7 +934,7 @@ UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expe
if(memcmp(junokout,expectOffsets,(targ-junkout) * sizeof(int32_t) )){
log_err("did not get the expected offsets. %s", gNuConvTestName);
log_err("Got : ");
printSeqErr(junkout, targ-junkout);
printSeqErr((const unsigned char*)junkout, targ-junkout);
for(p=junkout;p<targ;p++)
log_err("%d, ", junokout[p-junkout]);
log_err("\nExpected: ");

View File

@ -302,9 +302,9 @@ UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expe
log_err("Expected %d chars out, got %d %s\n", expectLen, targ-junkout, gNuConvTestName);
log_verbose("Expected %d chars out, got %d %s\n", expectLen, targ-junkout, gNuConvTestName);
printf("\nGot:");
printSeqErr(junkout, targ-junkout);
printSeqErr((const unsigned char*)junkout, targ-junkout);
printf("\nExpected:");
printSeqErr(expect, expectLen);
printSeqErr((const unsigned char*)expect, expectLen);
return FALSE;
}
@ -314,7 +314,7 @@ UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expe
if(memcmp(junokout,expectOffsets,(targ-junkout) * sizeof(int32_t) )){
log_err("did not get the expected offsets. %s", gNuConvTestName);
log_err("Got : ");
printSeqErr(junkout, targ-junkout);
printSeqErr((const unsigned char*)junkout, targ-junkout);
for(p=junkout;p<targ;p++)
log_err("%d, ", junokout[p-junkout]);
log_err("\nExpected: ");
@ -1708,7 +1708,7 @@ TestLMBCS() {
{
log_err("Unexpected value on 0-byte source request to ucnv_getnextUChar \n");
}
errorCode = 0;
errorCode = U_ZERO_ERROR;
/* running out of target room : U_BUFFER_OVERFLOW_ERROR */
@ -1719,7 +1719,7 @@ TestLMBCS() {
log_err("Unexpected results on out of target room to ucnv_fromUnicode\n");
}
errorCode = 0;
errorCode = U_ZERO_ERROR;
pLIn = pszLMBCS;
ucnv_toUnicode(cnv, &pUOut,pUOut+4,(const char **)&pLIn,(const char *)(pLIn+sizeof(pszLMBCS)),off,FALSE, &errorCode);
@ -1737,7 +1737,7 @@ TestLMBCS() {
LIn [3] = 0x14;
LIn [4] = 0xDC;
pLIn = LIn;
errorCode = 0;
errorCode = U_ZERO_ERROR;
pUOut = UOut;
ucnv_toUnicode(cnv, &pUOut,pUOut+sizeof(UOut),(const char **)&pLIn,(const char *)(pLIn+5),off,TRUE, &errorCode);
@ -1751,7 +1751,7 @@ TestLMBCS() {
LIn [1] = 0xD8;
LIn [2] = 0x01;
pLIn = LIn;
errorCode = 0;
errorCode = U_ZERO_ERROR;
pUOut = UOut;
ucnv_toUnicode(cnv, &pUOut,pUOut+sizeof(UOut),(const char **)&pLIn,(const char *)(pLIn+3),off,TRUE, &errorCode);
@ -1768,7 +1768,7 @@ TestLMBCS() {
LIn [4] = 0xC9;
LIn [5] = 0xD0;
pLIn = LIn;
errorCode = 0;
errorCode = U_ZERO_ERROR;
pUOut = UOut;
ucnv_toUnicode(cnv, &pUOut,pUOut+sizeof(UOut),(const char **)&pLIn,(const char *)(pLIn+6),off,TRUE, &errorCode);
@ -1785,7 +1785,7 @@ TestLMBCS() {
LIn [4] = 0xC9;
pLIn = LIn;
errorCode = 0;
errorCode = U_ZERO_ERROR;
pUOut = UOut;
ucnv_toUnicode(cnv, &pUOut,pUOut+sizeof(UOut),(const char **)&pLIn,(const char *)(pLIn+5),off,TRUE, &errorCode);
@ -1802,7 +1802,7 @@ TestLMBCS() {
LIn [4] = 0x3B;
pLIn = LIn;
errorCode = 0;
errorCode = U_ZERO_ERROR;
pUOut = UOut;
ucnv_toUnicode(cnv, &pUOut,pUOut+sizeof(UOut),(const char **)&pLIn,(const char *)(pLIn+5),off,TRUE, &errorCode);
@ -1818,7 +1818,7 @@ TestLMBCS() {
LIn [3] = 0x0F;
pLIn = LIn;
errorCode = 0;
errorCode = U_ZERO_ERROR;
pUOut = UOut;
ucnv_toUnicode(cnv, &pUOut,pUOut+sizeof(UOut),(const char **)&pLIn,(const char *)(pLIn+4),off,TRUE, &errorCode);

View File

@ -56,8 +56,8 @@ void TestUDataOpen(){
const char* name = "test";
const char* type="dat";
char* path=malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("icudata") +1 ) );
char* testPath=malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("base") +1 ) );
char* path=(char*)malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("icudata") +1 ) );
char* testPath=(char*)malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("base") +1 ) );
strcat(strcpy(path, u_getDataDirectory()), "icudata");
strcat(strcpy(testPath, u_getDataDirectory()), "base");
@ -196,7 +196,7 @@ void TestUDataOpenChoiceDemo1() {
};
char* type="dat";
char* testPath=malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("base") +1 ) );
char* testPath=(char*)malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("base") +1 ) );
strcat(strcpy(testPath, u_getDataDirectory()), "base");
@ -274,7 +274,7 @@ void TestUDataOpenChoiceDemo2() {
"base_test" /* libbase_test.so, libbase_test.a, etc... */
};
char* path=malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen(base[0]) + 1) );
char* path=(char*)malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen(base[0]) + 1) );
strcpy(path, u_getDataDirectory());
strcat(path, base[0]);
@ -289,7 +289,7 @@ void TestUDataOpenChoiceDemo2() {
p=0;
for(i=0;i<sizeof(base)/sizeof(base[0]); i++){
path=realloc(path, sizeof(char) * (strlen(u_getDataDirectory()) + strlen(base[i]) +1 ) );
path=(char*)realloc(path, sizeof(char) * (strlen(u_getDataDirectory()) + strlen(base[i]) +1 ) );
strcat(strcpy(path, u_getDataDirectory()), base[i]);
result=udata_openChoice(path, type, name, isAcceptable, &p, &status);
if(p<2) {
@ -343,8 +343,8 @@ void TestUDataGetInfo() {
const char* name2="test";
const char* type="dat";
char* path=malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("icudata") +1 ) );
char* testPath=malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("base") +1 ) );
char* path=(char*)malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("icudata") +1 ) );
char* testPath=(char*)malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("base") +1 ) );
strcat(strcpy(path, u_getDataDirectory()), "icudata");
strcat(strcpy(testPath, u_getDataDirectory()), "base");
@ -411,7 +411,7 @@ void TestUDataGetMemory() {
const char* name2="test";
char* testPath=malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("base") +1 ) );
char* testPath=(char*)malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("base") +1 ) );
strcat(strcpy(testPath, u_getDataDirectory()), "base");
@ -465,8 +465,8 @@ void TestErrorConditions(){
const char* name = "test";
const char* type="dat";
char* path=malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("icudata") +1 ) );
char* testPath=malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("base") +1 ) );
char* path=(char*)malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("icudata") +1 ) );
char* testPath=(char*)malloc(sizeof(char) * (strlen(u_getDataDirectory()) + strlen("base") +1 ) );
strcat(strcpy(path, u_getDataDirectory()), "icudata");
strcat(strcpy(testPath, u_getDataDirectory()), "base");

View File

@ -22,7 +22,7 @@
#include <stdio.h>
void printUChars(UChar *uchars);
void printUChars(const UChar *uchars);
void TestCodeUnitValues();
void TestCharLength();
@ -409,7 +409,7 @@ void TestAppendChar(){
4
};
static uint16_t result[][5]={
static UChar result[][5]={
/*unsafe*/
{0xd841, 0xdc41, 0x0063, 0x0064, 0x0000},
{0x0061, 0x0062, 0x0028, 0x0064, 0x0000},
@ -429,7 +429,7 @@ void TestAppendChar(){
};
uint16_t i, count=0;
UChar *str=malloc(sizeof(UChar) * (u_strlen(s)+1));
UChar *str=(UChar*)malloc(sizeof(UChar) * (u_strlen(s)+1));
uint16_t offset;
for(i=0; i<sizeof(test)/sizeof(test[0]); i=(uint16_t)(i+2)){
if(count<5){
@ -470,7 +470,7 @@ void TestAppendChar(){
free(str);
}
void printUChars(UChar *uchars){
void printUChars(const UChar *uchars){
int16_t i=0;
for(i=0; i<u_strlen(uchars); i++){
printf("%x ", *(uchars+i));

View File

@ -192,7 +192,7 @@ void TestNextPrevChar(){
0x0000, 0x0000, 0x0000, 0x0061, 0x0061, 0x0061,
};
static uint32_t movedOffset[]={
static UTextOffset movedOffset[]={
/*next_unsafe next_safe_ns next_safe_s prev_unsafe prev_safe_ns prev_safe_s*/
1, 1, 1, 15, 15, 15,
5, 5, 5, 14, 14 , 14,
@ -217,7 +217,8 @@ void TestNextPrevChar(){
UChar32 c=0x0000;
uint32_t i=0;
uint32_t offset=0, setOffset=0;
uint32_t offset=0;
UTextOffset setOffset=0;
for(offset=0; offset<sizeof(input); offset++){
if (offset < sizeof(input) - 2) { /* Can't have it go off the end of the array based on input */
setOffset=offset;

View File

@ -29,7 +29,11 @@
* This helps maintain a single copy of the data.
*/
#define INCLUDE_CALLCOLL_C
#ifndef __OS400__
#include "../cintltst/callcoll.c"
#else
#include "cintltst/callcoll.c"
#endif
CollationDummyTest::CollationDummyTest()
: myCollation(0)

View File

@ -425,22 +425,6 @@ TimeZoneTest::TestGetAvailableIDs913()
delete buf;
delete [] s;
/*
#if defined(WIN32) && defined(_DEBUG) && CHECK_HEAP
}
_CrtMemDumpAllObjectsSince(&memstate);
/*
* Set the debug-heap flag to keep freed blocks in the
* heap's linked list - This will allow us to catch any
* inadvertent use of freed memory
*/ /*
tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
tmpDbgFlag |= _CRTDBG_DELAY_FREE_MEM_DF;
tmpDbgFlag &= ~_CRTDBG_LEAK_CHECK_DF;
tmpDbgFlag &= ~_CRTDBG_CHECK_ALWAYS_DF;
_CrtSetDbgFlag(tmpDbgFlag);
#endif*/
}