ICU-535 Fixed some compiler warnings.

X-SVN-Rev: 2967
This commit is contained in:
George Rhoten 2000-11-21 04:05:39 +00:00
parent c8e6542a54
commit c9793c6267
41 changed files with 941 additions and 837 deletions

View file

@ -413,7 +413,7 @@ void addAllCollTest(TestNode** root)
addTest(root, &TestJB581, "tscoll/callcoll/TestJB581");
}
void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
{
int32_t sortklen1, sortklen2, sortklenmax, sortklenmin;
int32_t temp;
@ -444,7 +444,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[],
free(sortKey2);
}
void TestTertiary()
static void TestTertiary()
{
int32_t len,i;
UChar *rules, *newRules;
@ -473,7 +473,7 @@ void TestTertiary()
myCollation = 0;
}
void TestPrimary( )
static void TestPrimary( )
{
int32_t len,i;
UChar *rules, *newRules;
@ -505,7 +505,7 @@ void TestPrimary( )
myCollation = 0;
}
void TestSecondary()
static void TestSecondary()
{
int32_t i;
int32_t len;
@ -535,7 +535,8 @@ void TestSecondary()
ucol_close(myCollation);
myCollation = 0;
}
void TestIdentical()
static void TestIdentical()
{
int32_t i;
int32_t len;
@ -564,7 +565,8 @@ void TestIdentical()
ucol_close(myCollation);
myCollation = 0;
}
void TestExtra()
static void TestExtra()
{
int32_t i, j;
int32_t len;
@ -600,18 +602,18 @@ void TestExtra()
myCollation = 0;
}
void TestJB581(void)
static void TestJB581(void)
{
UChar dispName [100];
int32_t bufferLen = 0;
UChar source [100];
UChar target [100];
UCollationResult result = UCOL_EQUAL;
uint8_t sourceKeyArray [100];
uint8_t targetKeyArray [100];
int32_t sourceKeyOut = 0,
targetKeyOut = 0;
UCollator *myCollator = 0;
UChar dispName [100];
int32_t bufferLen = 0;
UChar source [100];
UChar target [100];
UCollationResult result = UCOL_EQUAL;
uint8_t sourceKeyArray [100];
uint8_t targetKeyArray [100];
int32_t sourceKeyOut = 0,
targetKeyOut = 0;
UCollator *myCollator = 0;
UErrorCode status = U_ZERO_ERROR;
u_uastrcpy(source, "This is a test.");

View file

@ -384,13 +384,13 @@ void TestSortKey()
if(ucol_getNormalization(col) != UCOL_DEFAULT_NORMALIZATION)
{
log_err("ERROR: default collation did not have UCOL_DEFAULT_NORMALIZATION !\n");
log_err("ERROR: default collation did not have UCOL_DEFAULT_NORMALIZATION !\n");
}
if(ucol_getStrength(col) != UCOL_DEFAULT_STRENGTH)
{
log_err("ERROR: default collation did not have UCOL_DEFAULT_STRENGTH !\n");
log_err("ERROR: default collation did not have UCOL_DEFAULT_STRENGTH !\n");
}
test1=(UChar*)malloc(sizeof(UChar) * 6);
@ -442,10 +442,10 @@ void TestSortKey()
strcpy(junk3, " abcda[3] ");
for(i=0;i<sortklen;i++)
{
sprintf(junk2+strlen(junk2), "%02X ",(int)( 0xFF & sortk2[i]));
sprintf(junk3+strlen(junk3), "%02X ",(int)( 0xFF & sortk3[i]));
}
{
sprintf(junk2+strlen(junk2), "%02X ",(int)( 0xFF & sortk2[i]));
sprintf(junk3+strlen(junk3), "%02X ",(int)( 0xFF & sortk3[i]));
}
log_verbose("%s\n", junk2);
log_verbose("%s\n", junk3);

View file

@ -33,7 +33,7 @@ void addBrkIterAPITest(TestNode** root)
}
void TestBreakIteratorCAPI()
static void TestBreakIteratorCAPI()
{
UErrorCode status = U_ZERO_ERROR;
UBreakIterator *word, *sentence, *line, *character, *b, *bogus;
@ -104,17 +104,17 @@ void TestBreakIteratorCAPI()
log_verbose("PASS: ubrk_countAvialable() successful returned %d\n", count);
}
for(i=0;i<count;i++)
{
{
log_verbose("%s\n", ubrk_getAvailable(i));
if (ubrk_getAvailable(i) == 0)
log_err("No locale for which breakiterator is applicable\n");
else
log_verbose("A locale %s for which breakiterator is applicable\n",ubrk_getAvailable(i));
}
if (ubrk_getAvailable(i) == 0)
log_err("No locale for which breakiterator is applicable\n");
else
log_verbose("A locale %s for which breakiterator is applicable\n",ubrk_getAvailable(i));
}
/*========Test ubrk_first(), ubrk_last()...... and other functions*/
log_verbose("\nTesting the functions for word\n");
log_verbose("\nTesting the functions for word\n");
start = ubrk_first(word);
if(start!=0)
log_err("error ubrk_start(word) did not return 0\n");

View file

@ -40,7 +40,7 @@ void addCalTest(TestNode** root)
}
void TestCalendar()
static void TestCalendar()
{
UCalendar *caldef = 0, *caldef2 = 0, *calfr = 0, *calit = 0;
int32_t count, count2, offset,i;
@ -267,7 +267,7 @@ void TestCalendar()
/* "GMT" */
static const UChar fgGMTID [] = { 0x0047, 0x004d, 0x0054, 0x0000 };
void TestGetSetDateAPI()
static void TestGetSetDateAPI()
{
UCalendar *caldef = 0, *caldef2 = 0;
UChar *tzID =0;
@ -431,7 +431,7 @@ void TestGetSetDateAPI()
/**
* Confirm the functioning of the calendar field related functions.
*/
void TestFieldGetSet()
static void TestFieldGetSet()
{
UCalendar *cal = 0;
UChar *tzID = 0;
@ -575,8 +575,8 @@ void TestFieldGetSet()
/**
* Execute adding and rolling in Calendar extensively,
*/
void TestAddRollExtensive()
{
static void TestAddRollExtensive()
{
UCalendar *cal = 0;
int32_t i,limit;
UChar* tzID = 0;
@ -736,7 +736,7 @@ void TestAddRollExtensive()
/*------------------------------------------------------ */
/*Testing the Limits for various Fields of Calendar*/
void TestGetLimits()
static void TestGetLimits()
{
UCalendar *cal = 0;
int32_t min, max, gr_min, le_max, ac_min, ac_max, val;
@ -834,7 +834,7 @@ void TestGetLimits()
* Test that the days of the week progress properly when add is called repeatedly
* for increments of 24 days.
*/
void TestDOWProgression()
static void TestDOWProgression()
{
int32_t initialDOW, DOW, newDOW, expectedDOW;
UCalendar *cal = 0;
@ -899,7 +899,7 @@ void TestDOWProgression()
/**
* Confirm that the offset between local time and GMT behaves as expected.
*/
void TestGMTvsLocal()
static void TestGMTvsLocal()
{
log_verbose("\nTesting the offset between the GMT and local time\n");
testZones(1999, 1, 1, 12, 0, 0);
@ -909,7 +909,7 @@ void TestGMTvsLocal()
/* ------------------------------------- */
void testZones(int32_t yr, int32_t mo, int32_t dt, int32_t hr, int32_t mn, int32_t sc)
static void testZones(int32_t yr, int32_t mo, int32_t dt, int32_t hr, int32_t mn, int32_t sc)
{
int32_t offset,utc, expected;
UCalendar *gmtcal = 0, *cal = 0;
@ -986,7 +986,7 @@ void testZones(int32_t yr, int32_t mo, int32_t dt, int32_t hr, int32_t mn, int32
/*------------------------------------------------------------------------------------------- */
/* ------------------------------------- */
void checkDateTime(UCalendar* c,
static void checkDateTime(UCalendar* c,
int32_t y, int32_t m, int32_t d,
int32_t hr, int32_t min, int32_t sec,
int32_t ms, UCalendarDateFields field)
@ -1022,8 +1022,7 @@ void checkDateTime(UCalendar* c,
}
/* ------------------------------------- */
void checkDate(UCalendar* c, int32_t y, int32_t m, int32_t d)
static void checkDate(UCalendar* c, int32_t y, int32_t m, int32_t d)
{
UErrorCode status = U_ZERO_ERROR;
if (ucal_get(c,UCAL_YEAR, &status) != y ||
@ -1050,7 +1049,7 @@ void checkDate(UCalendar* c, int32_t y, int32_t m, int32_t d)
/* ------------------------------------- */
void verify1(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day)
static void verify1(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day)
{
UDate d1;
UErrorCode status = U_ZERO_ERROR;
@ -1084,8 +1083,8 @@ void verify1(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int3
}
/* ------------------------------------ */
void verify2(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day,
int32_t hour, int32_t min, int32_t sec, int32_t am_pm)
static void verify2(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day,
int32_t hour, int32_t min, int32_t sec, int32_t am_pm)
{
UDate d1;
char str[3];

View file

@ -51,24 +51,24 @@
/**
* test subroutine used by TestGMTvsLocal()
*/
void testZones(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
static void testZones(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
/*Internal functions used*/
/**
* test subroutines used by TestAddRollExtensive()
**/
void checkDate(UCalendar* c, int32_t y, int32_t m, int32_t d);
static void checkDate(UCalendar* c, int32_t y, int32_t m, int32_t d);
void checkDateTime(UCalendar* c, int32_t y, int32_t m, int32_t d,
static void checkDateTime(UCalendar* c, int32_t y, int32_t m, int32_t d,
int32_t hr, int32_t min, int32_t sec, int32_t ms,
UCalendarDateFields field);
/**
* test subroutines used by TestGetSetDateAPI and TestFieldGetSet
**/
void verify1(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day);
static void verify1(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day);
void verify2(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day,
static void verify2(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day,
int32_t hour, int32_t min, int32_t sec, int32_t am_pm);

File diff suppressed because it is too large Load diff

View file

@ -24,8 +24,8 @@ void addExtraTests(TestNode** root);
void addConvert(TestNode** root)
{
addTestConvert(root);
addTestNewConvert(root);
addTestConvertErrorCallBack(root);
addTestNewConvert(root);
addTestConvertErrorCallBack(root);
addTestEuroRegression(root);
addTestConverterFallBack(root);
addExtraTests(root);

View file

@ -189,7 +189,7 @@ void addDanishCollTest(TestNode** root)
void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
{
int32_t sortklen1, sortklen2, sortklenmax, sortklenmin;
int32_t temp;
@ -220,7 +220,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[],
free(sortKey2);
}
void TestTertiary( )
static void TestTertiary( )
{
int32_t i,j;
@ -247,12 +247,11 @@ void TestTertiary( )
doTest(myCollation, testNTList[i], testNTList[j], UCOL_LESS);
}
}
ucol_close(myCollation);
ucol_close(myCollation);
}
void TestPrimary()
static void TestPrimary()
{
int32_t i;
UErrorCode status = U_ZERO_ERROR;
myCollation = ucol_open("da_DK", &status);
@ -264,6 +263,6 @@ void TestPrimary()
{
doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
}
ucol_close(myCollation);
ucol_close(myCollation);
}

View file

@ -35,7 +35,7 @@ void addDateForTest(TestNode** root)
addTest(root, &TestSymbols, "tsformat/cdattst/TestSymbols");
}
/* Testing the DateFormat API */
void TestDateFormat()
static void TestDateFormat()
{
UDateFormat *def, *fr, *it, *de, *def1, *fr_pat;
UDateFormat *copy;
@ -308,7 +308,7 @@ void TestDateFormat()
}
/*Testing udat_getSymbols() and udat_setSymbols() and udat_countSymbols()*/
void TestSymbols()
static void TestSymbols()
{
UDateFormat *def, *fr;
UErrorCode status = U_ZERO_ERROR;
@ -523,7 +523,7 @@ free(pattern);
}
/*INTERNAL FUNCTIONS USED*/
void VerifygetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected)
static void VerifygetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected)
{
UChar *pattern=NULL;
UErrorCode status = U_ZERO_ERROR;
@ -558,7 +558,7 @@ void VerifygetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t i
free(pattern);
}
void VerifysetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected)
static void VerifysetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected)
{
UChar *result=NULL;
UChar *value=NULL;
@ -600,7 +600,7 @@ void VerifysetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t i
}
void VerifygetsetSymbols(UDateFormat* from, UDateFormat* to, UDateFormatSymbolType type, int32_t index)
static void VerifygetsetSymbols(UDateFormat* from, UDateFormat* to, UDateFormatSymbolType type, int32_t index)
{
UChar *result=NULL;
UChar *value=NULL;
@ -654,8 +654,7 @@ void VerifygetsetSymbols(UDateFormat* from, UDateFormat* to, UDateFormatSymbolTy
}
UChar* myNumformat(const UNumberFormat* numfor, double d)
static UChar* myNumformat(const UNumberFormat* numfor, double d)
{
UChar *result2=NULL;
int32_t resultlength, resultlengthneeded;

View file

@ -31,13 +31,13 @@
/**
* test subroutines used by TestSymbols
**/
void VerifygetSymbols(UDateFormat*, UDateFormatSymbolType, int32_t, const char*);
void VerifysetSymbols(UDateFormat*, UDateFormatSymbolType, int32_t, const char*);
void VerifygetsetSymbols(UDateFormat*, UDateFormat*, UDateFormatSymbolType, int32_t);
static void VerifygetSymbols(UDateFormat*, UDateFormatSymbolType, int32_t, const char*);
static void VerifysetSymbols(UDateFormat*, UDateFormatSymbolType, int32_t, const char*);
static void VerifygetsetSymbols(UDateFormat*, UDateFormat*, UDateFormatSymbolType, int32_t);
/**
* test subroutine used by the testing functions
**/
UChar* myNumformat(const UNumberFormat* numfor, double d);
static UChar* myNumformat(const UNumberFormat* numfor, double d);
#endif

View file

@ -91,7 +91,8 @@ void addGermanCollTest(TestNode** root)
}
void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
{
int32_t sortklen1, sortklen2, sortklenmax, sortklenmin;
int32_t temp;
@ -122,7 +123,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[],
free(sortKey2);
}
void TestTertiary( )
static void TestTertiary( )
{
int32_t i;
@ -141,7 +142,7 @@ void TestTertiary( )
ucol_close(myCollation);
}
void TestPrimary()
static void TestPrimary()
{
int32_t i;

View file

@ -75,7 +75,8 @@ void addSpanishCollTest(TestNode** root)
addTest(root, &TestTertiary, "tscoll/cestst/TestTertiary");
}
void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
{
int32_t sortklen1, sortklen2, sortklenmax, sortklenmin;
int32_t temp;
@ -106,7 +107,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[],
free(sortKey2);
}
void TestTertiary( )
static void TestTertiary( )
{
int32_t i;
@ -124,7 +125,7 @@ void TestTertiary( )
ucol_close(myCollation);
}
void TestPrimary()
static void TestPrimary()
{
int32_t i;

View file

@ -66,7 +66,8 @@ void addFinnishCollTest(TestNode** root)
}
void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
{
int32_t sortklen1, sortklen2, sortklenmax, sortklenmin;
int32_t temp;
@ -97,7 +98,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[],
free(sortKey2);
}
void TestTertiary( )
static void TestTertiary( )
{
int32_t i;
@ -115,7 +116,7 @@ void TestTertiary( )
ucol_close(myCollation);
}
void TestPrimary()
static void TestPrimary()
{
int32_t i;

View file

@ -136,7 +136,7 @@ void addFrenchCollTest(TestNode** root)
}
void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
{
int32_t sortklen1, sortklen2, sortklenmax, sortklenmin;
int32_t temp;
@ -159,15 +159,18 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[],
temp= memcmp(sortKey1, sortKey2, sortklenmin);
if(temp < 0) keyResult=UCOL_LESS;
else if(temp > 0) keyResult= UCOL_GREATER;
else keyResult = UCOL_EQUAL;
if(temp < 0)
keyResult=UCOL_LESS;
else if(temp > 0)
keyResult= UCOL_GREATER;
else
keyResult = UCOL_EQUAL;
reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, result );
free(sortKey1);
free(sortKey2);
}
void TestTertiary( )
static void TestTertiary( )
{
int32_t i;
@ -182,10 +185,10 @@ void TestTertiary( )
{
doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
}
ucol_close(myCollation);
ucol_close(myCollation);
}
void TestSecondary()
static void TestSecondary()
{
int32_t i,j, testAcuteSize;
UCollationResult expected=UCOL_EQUAL;
@ -207,10 +210,10 @@ void TestSecondary()
doTest(myCollation, testAcute[i], testAcute[j], expected );
}
}
ucol_close(myCollation);
ucol_close(myCollation);
}
void TestExtra()
static void TestExtra()
{
int32_t i, j;
UErrorCode status = U_ZERO_ERROR;
@ -227,5 +230,5 @@ void TestExtra()
doTest(myCollation, testBugs[i], testBugs[j], UCOL_LESS);
}
}
ucol_close(myCollation);
ucol_close(myCollation);
}

View file

@ -49,7 +49,7 @@ void addCollIterTest(TestNode** root)
* @bug 4108758 - Make sure it works with contracting characters
*
*/
void TestPrevious()
static void TestPrevious()
{
UChar rule[50];
UChar *source;
@ -144,7 +144,7 @@ void TestPrevious()
/**
* Test for getOffset() and setOffset()
*/
void TestOffset()
static void TestOffset()
{
UErrorCode status= U_ZERO_ERROR;
UCollationElements *iter, *pristine;
@ -205,7 +205,7 @@ void TestOffset()
/**
* Test for setText()
*/
void TestSetText()
static void TestSetText()
{
int32_t c,i;
UErrorCode status = U_ZERO_ERROR;
@ -259,14 +259,14 @@ void TestSetText()
ucol_closeElements(iter2);
ucol_closeElements(iter1);
ucol_close(en_us);
ucol_close(en_us);
free(test1);
free(test2);
}
void backAndForth(UCollationElements *iter)
static void backAndForth(UCollationElements *iter)
{
/* Run through the iterator forwards and stick it into an array */
int32_t index, o;
@ -315,7 +315,7 @@ void backAndForth(UCollationElements *iter)
/** @bug 4108762
* Test for getMaxExpansion()
*/
void TestMaxExpansion()
static void TestMaxExpansion()
{
/* Try a simple one first: */
/* The only expansion ends with 'e' and has length 2 */
@ -352,6 +352,7 @@ void TestMaxExpansion()
u_uastrcpy(rule1, "< a & ae = a1 & aeef = z < b < e < f");
verifyExpansion(rule1, test2, ARRAY_LENGTH(test2));
}
/**
* Verify that getMaxExpansion works on a given set of collation rules
*
@ -363,7 +364,7 @@ void TestMaxExpansion()
* and getMaxExpansion is called for that character. If its value is
* not equal to the specified number, an error results.
*/
void verifyExpansion(UChar* rules, const UChar expansionTests[], int32_t testCount)
static void verifyExpansion(UChar* rules, const UChar expansionTests[], int32_t testCount)
{
int32_t i;
UErrorCode status = U_ZERO_ERROR;
@ -422,7 +423,7 @@ void verifyExpansion(UChar* rules, const UChar expansionTests[], int32_t testCou
* Return an integer array containing all of the collation orders
* returned by calls to next on the specified iterator
*/
int32_t* getOrders(UCollationElements *iter, int32_t *orderLength)
static int32_t* getOrders(UCollationElements *iter, int32_t *orderLength)
{
UErrorCode status;
int32_t order;
@ -469,7 +470,7 @@ int32_t* getOrders(UCollationElements *iter, int32_t *orderLength)
}
void assertEqual(UCollationElements *i1, UCollationElements *i2)
static void assertEqual(UCollationElements *i1, UCollationElements *i2)
{
int32_t c1, c2;
int32_t count = 0;

View file

@ -32,20 +32,20 @@
* @bug 4108758 - Make sure it works with contracting characters
*
*/
void TestPrevious(void);
static void TestPrevious(void);
/**
* Test for getOffset() and setOffset()
*/
void TestOffset(void);
static void TestOffset(void);
/**
* Test for setText()
*/
void TestSetText(void);
static void TestSetText(void);
/** @bug 4108762
* Test for getMaxExpansion()
*/
void TestMaxExpansion(void);
static void TestMaxExpansion(void);
/*------------------------------------------------------------------------
@ -57,7 +57,7 @@
/**
* Verify that getMaxExpansion works on a given set of collation rules
*/
void verifyExpansion(UChar* rules, const UChar tests[], int32_t testCount);
static void verifyExpansion(UChar* rules, const UChar tests[], int32_t testCount);
/**

View file

@ -78,7 +78,8 @@ void addKannaCollTest(TestNode** root)
addTest(root, &TestTertiary, "tscoll/cjacoll/TestTertiary");
}
void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
{
int32_t sortklen1, sortklen2, sortklenmax, sortklenmin;
int32_t temp;
@ -101,15 +102,18 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[],
temp= memcmp(sortKey1, sortKey2, sortklenmin);
if(temp < 0) keyResult=UCOL_LESS;
else if(temp > 0) keyResult= UCOL_GREATER;
else keyResult = UCOL_EQUAL;
if(temp < 0)
keyResult=UCOL_LESS;
else if(temp > 0)
keyResult= UCOL_GREATER;
else
keyResult = UCOL_EQUAL;
reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, result );
free(sortKey1);
free(sortKey2);
}
void TestTertiary( )
static void TestTertiary( )
{
int32_t i;
@ -129,4 +133,3 @@ void TestTertiary( )
}

View file

@ -139,7 +139,7 @@ void addLocaleTest(TestNode** root)
/* testing uloc(), uloc_getName(), uloc_getLanguage(), uloc_getVariant(), uloc_getCountry() */
void TestBasicGetters() {
static void TestBasicGetters() {
int32_t i;
int32_t cap;
UErrorCode status = U_ZERO_ERROR;
@ -216,8 +216,9 @@ void TestBasicGetters() {
}
}
/* testing uloc_getISO3Language(), uloc_getISO3Country(), */
void TestSimpleResourceInfo() {
static void TestSimpleResourceInfo() {
int32_t i;
char* testLocale = 0;
@ -261,7 +262,8 @@ void TestSimpleResourceInfo() {
free(expected);
free(testLocale);
}
void TestDisplayNames()
static void TestDisplayNames()
{
/* sfb 990721
Can't just save a pointer to the default locale.
@ -303,7 +305,7 @@ void TestDisplayNames()
log_verbose(" In locale = gr_EL..\n");
doTestDisplayNames("el_GR", DLANG_EL, FALSE);
uloc_setDefault("fr_FR", &err);
uloc_setDefault("fr_FR", &err);
if (U_FAILURE(err)) {
log_err("Locale::setDefault returned error code %s\n", myErrorName(err));
return;
@ -334,7 +336,7 @@ void TestDisplayNames()
/* test for uloc_getAvialable() and uloc_countAvilable()*/
void TestGetAvailableLocales()
static void TestGetAvailableLocales()
{
const char *locList;
@ -361,7 +363,7 @@ void TestGetAvailableLocales()
}
/* test for u_getDataDirectory, u_setDataDirectory, uloc_getISO3Language */
void TestDataDirectory()
static void TestDataDirectory()
{
char oldDirectory[80];
@ -405,7 +407,7 @@ void TestDataDirectory()
/*=========================================================== */
void doTestDisplayNames(const char* inLocale,
static void doTestDisplayNames(const char* inLocale,
int32_t compareIndex,
int32_t defaultIsFrench)
{
@ -614,8 +616,9 @@ void doTestDisplayNames(const char* inLocale,
}
free(testLocale);
}
/* test for uloc_getISOLanguages, uloc_getISOCountries */
void TestISOFunctions()
static void TestISOFunctions()
{
@ -669,7 +672,7 @@ static UChar greekDisplayName[] = { 0x03b5, 0x03bb, 0x03bb, 0x03b7, 0x03bd, 0x03
0x03ac, 0x20, 0x28, 0x0395, 0x03bb, 0x03bb, 0x03ac, 0x03b4, 0x03b1, 0x29, 0 };
void setUpDataTable()
static void setUpDataTable()
{
int32_t i,j;
dataTable = (UChar***)(calloc(sizeof(UChar**),23));
@ -688,10 +691,11 @@ void setUpDataTable()
u_strncpy(dataTable[DNAME_EL][GREEKS],greekDisplayName,17);
}
/**
* @bug 4011756 4011380
*/
void TestISO3Fallback()
static void TestISO3Fallback()
{
const char* test="xx_YY";
@ -713,7 +717,7 @@ void TestISO3Fallback()
/**
* @bug 4118587
*/
void TestSimpleDisplayNames()
static void TestSimpleDisplayNames()
{
/*
This test is different from TestDisplayNames because TestDisplayNames checks
@ -751,7 +755,7 @@ void TestSimpleDisplayNames()
/**
* @bug 4118595
*/
void TestUninstalledISO3Names()
static void TestUninstalledISO3Names()
{
/* This test checks to make sure getISO3Language and getISO3Country work right
even for locales that are not installed. */
@ -784,7 +788,7 @@ void TestUninstalledISO3Names()
}
void TestVariantParsing()
static void TestVariantParsing()
{
const char* en_US_custom="en_US_De Anza_Cupertino_California_United States_Earth";
const char* dispName="English (United States, DE ANZA_CUPERTINO_CALIFORNIA_UNITED STATES_EARTH)";

View file

@ -65,8 +65,9 @@ static void InitStrings( void )
u_uastrcpy(testResultStrings[i], txt_testResultStrings[i] );
}
}
/* Test u_formatMessage() with various test patterns() */
void MessageFormatTest( void )
static void MessageFormatTest( void )
{
UChar *str;
@ -110,7 +111,7 @@ void MessageFormatTest( void )
/*test u_formatMessage() with sample patterns */
void TestSampleMessageFormat()
static void TestSampleMessageFormat()
{
UChar *str;
UChar *result;
@ -204,10 +205,10 @@ void TestSampleMessageFormat()
free(str);
}
/* Test u_formatMessage() and u_parseMessage() , format and parse sequence and round trip */
void TestSampleFormatAndParse()
static void TestSampleFormatAndParse()
{
UChar *result, *tzID, *str;
@ -294,8 +295,9 @@ void TestSampleFormatAndParse()
free(tzID);
}
/* test message format with a choice option */
void TestMsgFormatChoice()
static void TestMsgFormatChoice()
{
UChar* str;
UErrorCode status = U_ZERO_ERROR;
@ -380,8 +382,9 @@ void TestMsgFormatChoice()
free(str);
}
/*test u_parseMessage() with various test patterns */
void TestParseMessage()
static void TestParseMessage()
{
UChar pattern[100];
UChar source[100];
@ -426,7 +429,7 @@ void TestParseMessage()
}
int32_t CallFormatMessage(const char* locale, UChar* testCasePattern, int32_t patternLength,
static int32_t CallFormatMessage(const char* locale, UChar* testCasePattern, int32_t patternLength,
UChar* result, int32_t resultLength, UErrorCode *status, ...)
{
int32_t len = 0;
@ -438,7 +441,7 @@ int32_t CallFormatMessage(const char* locale, UChar* testCasePattern, int32_t pa
}
/* Test u_vformatMessage() with various test patterns. */
void TestMessageFormatWithValist( void )
static void TestMessageFormatWithValist( void )
{
UChar *str;
@ -480,7 +483,7 @@ void TestMessageFormatWithValist( void )
free(str);
}
void CallParseMessage(const char* locale, UChar* pattern, int32_t patternLength,
static void CallParseMessage(const char* locale, UChar* pattern, int32_t patternLength,
UChar* source, int32_t sourceLength, UErrorCode *status, ...)
{
va_list ap;
@ -488,8 +491,9 @@ void CallParseMessage(const char* locale, UChar* pattern, int32_t patternLength,
u_vparseMessage(locale, pattern, patternLength, source, sourceLength, ap, status);
va_end(ap);
}
/*test u_vparseMessage() with various test patterns */
void TestParseMessageWithValist()
static void TestParseMessageWithValist()
{
UChar pattern[100];
UChar source[100];
@ -530,6 +534,7 @@ void TestParseMessageWithValist()
else
log_err("FAIL: Error in parseMessage on test#10 \n");
}
void addMsgForTest(TestNode** root)
{
addTest(root, &MessageFormatTest, "tsformat/cmsgtst/MessageFormatTest");

View file

@ -41,8 +41,9 @@ void addNumFrDepTest(TestNode** root)
addTest(root, &TestSecondaryGrouping, "tsformat/cnmdptst/TestSecondaryGrouping");
}
/*Test Various format patterns*/
void TestPatterns(void)
static void TestPatterns(void)
{
int32_t pat_length, i, lneed;
UNumberFormat *fmt;
@ -103,8 +104,9 @@ void TestPatterns(void)
unum_close(fmt);
}
}
/* Test the handling of quotes*/
void TestQuotes(void)
static void TestQuotes(void)
{
int32_t lneed;
UErrorCode status;
@ -170,7 +172,7 @@ void TestQuotes(void)
}
/* Test exponential pattern*/
void TestExponential(void)
static void TestExponential(void)
{
int32_t pat_length, val_length, lval_length;
int32_t ival, ilval, p, v, lneed;
@ -319,7 +321,7 @@ void TestExponential(void)
/**
* Test the handling of the currency symbol in patterns.
*/
void TestCurrencySign(void)
static void TestCurrencySign(void)
{
int32_t lneed;
UNumberFormat *fmt;
@ -382,10 +384,11 @@ void TestCurrencySign(void)
unum_close(fmt);
free(pattern);
}
/**
* Test localized currency patterns.
*/
void TestCurrency(void)
static void TestCurrency(void)
{
UNumberFormat *currencyFmt;
UChar *str=NULL, *res=NULL;
@ -423,7 +426,7 @@ void TestCurrency(void)
/**
* Test proper rounding by the format method.
*/
void TestRounding487(void)
static void TestRounding487(void)
{
UNumberFormat *nnf;
UErrorCode status = U_ZERO_ERROR;
@ -446,7 +449,7 @@ void TestRounding487(void)
/*-------------------------------------*/
void roundingTest(UNumberFormat* nf, double x, int32_t maxFractionDigits, const char* expected)
static void roundingTest(UNumberFormat* nf, double x, int32_t maxFractionDigits, const char* expected)
{
UChar *out = NULL;
UChar *res;
@ -475,10 +478,11 @@ void roundingTest(UNumberFormat* nf, double x, int32_t maxFractionDigits, const
free(out);
}
}
/*
* Testing unum_getDoubleAttribute and unum_setDoubleAttribute()
*/
void TestDoubleAttribute(void)
static void TestDoubleAttribute(void)
{
double mydata[] = { 1.11, 22.22, 333.33, 4444.44, 55555.55, 666666.66, 7777777.77, 88888888.88, 999999999.99};
double dvalue;
@ -506,7 +510,7 @@ void TestDoubleAttribute(void)
/**
* Test the functioning of the secondary grouping value.
*/
void TestSecondaryGrouping(void) {
static void TestSecondaryGrouping(void) {
UErrorCode status = U_ZERO_ERROR;
UNumberFormat *f = NULL, *g= NULL;
UNumberFormat *us = unum_open(UNUM_DECIMAL, "en_US", &status);

View file

@ -223,7 +223,7 @@ void TestCompatDecompCompose()
void assertEqual(const UChar* result, const UChar* expected, int32_t index)
static void assertEqual(const UChar* result, const UChar* expected, int32_t index)
{
if(u_strcmp(result, expected)!=0){
log_err("ERROR in decomposition at index = %d. EXPECTED: %s , GOT: %s\n", index, austrdup(expected),
@ -231,7 +231,7 @@ void assertEqual(const UChar* result, const UChar* expected, int32_t index)
}
}
void TestNull_check(UChar *src, int32_t srcLen,
static void TestNull_check(UChar *src, int32_t srcLen,
UChar *exp, int32_t expLen,
UNormalizationMode mode,
const char *name)

View file

@ -1119,7 +1119,7 @@ AllocateTextBoundary();
c == 0xfeff)
continue;
work[2] = c;
ubrk_setText(e, work, u_strlen(work), &status);
ubrk_setText(e, work, u_strlen(work), &status);
if(U_FAILURE(status)){
log_err("FAIL: Error in setting text on the word break Iterator in testLineInvaiants:\n %s \n", myErrorName(status));
return;

View file

@ -174,7 +174,7 @@ void addNEWResourceBundleTest(TestNode** root)
/***************************************************************************************/
void TestAliasConflict(void) {
static void TestAliasConflict(void) {
UErrorCode status = U_ZERO_ERROR;
UResourceBundle *he = NULL;
UResourceBundle *iw = NULL;
@ -193,7 +193,7 @@ void TestAliasConflict(void) {
ures_close(he);
}
void TestNewTypes() {
static void TestNewTypes() {
UResourceBundle* theBundle = NULL;
char action[256];
char testdatapath[256];
@ -265,7 +265,7 @@ void TestNewTypes() {
}
void TestBinaryCollationData(){
static void TestBinaryCollationData(){
UErrorCode status=U_ZERO_ERROR;
const char* directory=NULL;
const char* locale="te";
@ -316,7 +316,8 @@ void TestBinaryCollationData(){
ures_close(teRes);
}
void TestAPI(){
static void TestAPI() {
UErrorCode status=U_ZERO_ERROR;
const char* directory=NULL;
int32_t len=0;
@ -409,7 +410,8 @@ void TestAPI(){
}
void TestErrorConditions(){
static void TestErrorConditions(){
UErrorCode status;
const char* directory=NULL;
const char *key=NULL;
@ -618,7 +620,7 @@ void TestErrorConditions(){
}
void TestResourceBundles()
static void TestResourceBundles()
{
testTag("only_in_Root", TRUE, FALSE, FALSE);
@ -635,7 +637,7 @@ void TestResourceBundles()
}
void TestConstruction1()
static void TestConstruction1()
{
UResourceBundle *test1 = 0, *test2 = 0;
const UChar *result1, *result2;
@ -701,7 +703,7 @@ void TestConstruction1()
ures_close(test2);
}
void TestConstruction2()
static void TestConstruction2()
{
UChar temp[7];
@ -757,7 +759,7 @@ void TestConstruction2()
/*****************************************************************************/
/*****************************************************************************/
UBool testTag(const char* frag,
static UBool testTag(const char* frag,
UBool in_Root,
UBool in_te,
UBool in_te_IN)
@ -1176,12 +1178,12 @@ UBool testTag(const char* frag,
return pass;
}
void record_pass()
static void record_pass()
{
++pass;
}
void record_fail()
static void record_fail()
{
++fail;
}
@ -1191,7 +1193,7 @@ void record_fail()
* are set correctly
*/
void TestFallback()
static void TestFallback()
{
UErrorCode status = U_ZERO_ERROR;
UResourceBundle *fr_FR = NULL;
@ -1239,7 +1241,7 @@ void TestFallback()
ures_close(fr_FR);
}
void printUChars(UChar* uchars){
static void printUChars(UChar* uchars){
int16_t i=0;
for(i=0; i<u_strlen(uchars); i++){
printf("%04X ", *(uchars+i));

View file

@ -26,7 +26,7 @@ void addCStringTest(TestNode** root) {
}
void TestAPI(void)
static void TestAPI(void)
{
int32_t intValue=0;

View file

@ -82,7 +82,8 @@ void addTurkishCollTest(TestNode** root)
}
void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
{
int32_t sortklen1, sortklen2, sortklenmax, sortklenmin;
int32_t temp;
@ -113,7 +114,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[],
free(sortKey2);
}
void TestTertiary( )
static void TestTertiary( )
{
int32_t i;
@ -132,7 +133,7 @@ void TestTertiary( )
ucol_close(myCollation);
}
void TestPrimary()
static void TestPrimary()
{
int32_t i;

View file

@ -117,7 +117,7 @@ void addUnicodeTest(TestNode** root)
/*==================================================== */
/* test u_toupper() and u_tolower() */
/*==================================================== */
void TestUpperLower()
static void TestUpperLower()
{
const UChar upper[] = {0x41, 0x42, 0x00b2, 0x01c4, 0x01c6, 0x01c9, 0x01c8, 0x01c9, 0x000c, 0x0000};
const UChar lower[] = {0x61, 0x62, 0x00b2, 0x01c6, 0x01c6, 0x01c9, 0x01c9, 0x01c9, 0x000c, 0x0000};
@ -171,7 +171,7 @@ void TestUpperLower()
/* test isLetter(u_isapha()) and isDigit(u_isdigit()) */
void TestLetterNumber()
static void TestLetterNumber()
{
UChar i = 0x0000;
@ -217,7 +217,7 @@ void TestLetterNumber()
}
/* Tests for isDefined(u_isdefined)(, isBaseForm(u_isbase()), isSpaceChar(u_isspace()), isWhiteSpace(), u_CharDigitValue(),u_CharCellWidth() */
void TestMisc()
static void TestMisc()
{
const UChar sampleSpaces[] = {0x0020, 0x00a0, 0x2000, 0x2001, 0x2005};
const UChar sampleNonSpaces[] = {0x61, 0x62, 0x63, 0x64, 0x74};
@ -327,7 +327,7 @@ void TestMisc()
/* Tests for isControl(u_iscntrl()) and isPrintable(u_isprint()) */
void TestControlPrint()
static void TestControlPrint()
{
const UChar sampleControl[] = {0x001b, 0x0097, 0x0082};
const UChar sampleNonControl[] = {0x61, 0x0031, 0x00e2};
@ -417,7 +417,7 @@ void TestIdentifier()
}
/* tests for u_charType(), u_isTitle(), and u_toTitle(),u_charDirection and u_charScript()*/
void TestUnicodeData()
static void TestUnicodeData()
{
FILE* input = 0;
char buffer[1000];
@ -551,8 +551,9 @@ void TestUnicodeData()
}
/*internal functions ----*/
int32_t MakeProp(char* str)
static int32_t MakeProp(char* str)
{
int32_t result = 0;
char* matchPosition =0;

View file

@ -18,6 +18,8 @@
#define _CUNDTST
U_CFUNC void setUpDataTable(void);
U_CFUNC void cleanUpDataTable(void);
static void TestUpperLower(void);
static void TestLetterNumber(void);
@ -28,9 +30,7 @@ static void TestUnicodeData(void);
static void TestStringFunctions(void);
/* internal methods used */
int32_t MakeProp(char* str);
int32_t MakeDir(char* str);
static int32_t MakeProp(char* str);
static int32_t MakeDir(char* str);
void setUpDataTable(void);
U_CFUNC void cleanUpDataTable(void);
#endif

View file

@ -8,7 +8,7 @@
* File CUTILTST.C
*
* Modification History:
* Name Description
* Name Description
* Madhu Katragadda Creation
*********************************************************************************
*/
@ -28,7 +28,7 @@ void addUtility(TestNode** root)
addLocaleTest(root);
addUnicodeTest(root);
addResourceBundleTest(root);
addNEWResourceBundleTest(root);
addNEWResourceBundleTest(root);
addSCSUTest(root);
addHashtableTest(root);
addCStringTest(root);

View file

@ -254,7 +254,7 @@ void addEnglishCollTest(TestNode** root)
}
void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result)
{
int32_t sortklen1, sortklen2, sortklenmax, sortklenmin;
int32_t temp;
@ -285,7 +285,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[],
free(sortKey2);
}
void TestTertiary( )
static void TestTertiary( )
{
int32_t testMoreSize;
UCollationResult expected=UCOL_EQUAL;
@ -324,10 +324,10 @@ void TestTertiary( )
doTest(myCollation, testMore[i], testMore[j], expected );
}
}
ucol_close(myCollation);
ucol_close(myCollation);
}
void TestPrimary()
static void TestPrimary()
{
int32_t i;
@ -346,7 +346,7 @@ void TestPrimary()
ucol_close(myCollation);
}
void TestSecondary()
static void TestSecondary()
{
UCollationResult expected=UCOL_EQUAL;
int32_t i,j, testAcuteSize;

View file

@ -84,62 +84,65 @@ UBool isEuroAware(const UConverter*);
void TestEuroRegression()
{
int32_t i=0;
do
int32_t i=0;
do
{
UErrorCode err = U_ZERO_ERROR;
UConverter* myConv = ucnv_open(convertersToCheck[i], &err);
if (U_FAILURE(err)&&convertersToCheck[i][0]) log_err("%s \tMISSING [%s]\n", convertersToCheck[i], u_errorName(err));
else
{
if (isEuroAware(myConv)) log_verbose("%s \tsupports euro\n", convertersToCheck[i]);
else log_err("%s \tDOES NOT support euro\n", convertersToCheck[i]);
ucnv_close(myConv);
}
UErrorCode err = U_ZERO_ERROR;
UConverter* myConv = ucnv_open(convertersToCheck[i], &err);
if (U_FAILURE(err)&&convertersToCheck[i][0])
log_err("%s \tMISSING [%s]\n", convertersToCheck[i], u_errorName(err));
else
{
if (isEuroAware(myConv))
log_verbose("%s \tsupports euro\n", convertersToCheck[i]);
else
log_err("%s \tDOES NOT support euro\n", convertersToCheck[i]);
ucnv_close(myConv);
}
} while (convertersToCheck[++i][0]);
}
UBool isEuroAware(const UConverter* myConv)
{
static const UChar euroString[2] = { 0x20AC, 0x0000 };
char target[2];
UChar euroBack[2];
int32_t targetSize, euroBackSize;
UErrorCode err = U_ZERO_ERROR;
/*const char* myName = ucnv_getName(myConv, &err);*/
static const UChar euroString[2] = { 0x20AC, 0x0000 };
char target[2];
UChar euroBack[2];
int32_t targetSize, euroBackSize;
UErrorCode err = U_ZERO_ERROR;
/*const char* myName = ucnv_getName(myConv, &err);*/
targetSize = ucnv_fromUChars(myConv,
target,
2,
euroString,
-1,
&err);
if (U_FAILURE(err))
targetSize = ucnv_fromUChars(myConv,
target,
2,
euroString,
-1,
&err);
if (U_FAILURE(err))
{
log_err("Failure Occured in ucnv_fromUChars euro roundtrip test\n");
return FALSE;
}
euroBackSize = ucnv_toUChars(myConv,
euroBack,
2,
target,
targetSize,
&err);
if (U_FAILURE(err))
euroBackSize = ucnv_toUChars(myConv,
euroBack,
2,
target,
targetSize,
&err);
if (U_FAILURE(err))
{
log_err("Failure Occured in ucnv_toUChars euro roundtrip test\n");
return FALSE;
log_err("Failure Occured in ucnv_toUChars euro roundtrip test\n");
return FALSE;
}
if (u_strcmp(euroString, euroBack))
if (u_strcmp(euroString, euroBack))
{
/* log_err("%s FAILED Euro rountrip\n", myName);*/
return FALSE;
/* log_err("%s FAILED Euro rountrip\n", myName);*/
return FALSE;
}
else
else
{
/* log_verbose("%s PASSED Euro rountrip\n", myName);*/
return TRUE;
/* log_verbose("%s PASSED Euro rountrip\n", myName);*/
return TRUE;
}
}

View file

@ -19,16 +19,18 @@
#include "cintltst.h"
#include "umemstrm.h"
void TestMemoryStreamAPI();
static void TestMemoryStreamAPI();
static void printUSeqErr(const uint8_t *a, int len);
void printUSeqErr(const uint8_t *a, int len)
static void printUSeqErr(const uint8_t *a, int len)
{
int i=0;
fprintf(stderr, "{U+ ");
while (i<len) fprintf(stderr, "0x%02x ", a[i++]);
while (i<len)
fprintf(stderr, "0x%02x ", a[i++]);
fprintf(stderr,"}\n");
}
void
addMemoryStreamTest(TestNode** root)
{
@ -36,7 +38,7 @@ addMemoryStreamTest(TestNode** root)
}
void TestMemoryStreamAPI(){
static void TestMemoryStreamAPI(){
UMemoryStream *memStream=NULL;
int32_t size=999, x=0;
const uint8_t *gotBuffer=0;

View file

@ -32,7 +32,7 @@ static int32_t gInBufferSize = 0;
static int32_t gOutBufferSize = 0;
static char gNuConvTestName[1024];
void printSeq(const uint8_t* a, int len)
static void printSeq(const uint8_t* a, int len)
{
int i=0;
log_verbose("\n{");
@ -40,7 +40,8 @@ void printSeq(const uint8_t* a, int len)
log_verbose("0x%02X, ", a[i++]);
log_verbose("}\n");
}
void printUSeq(const UChar* a, int len)
static void printUSeq(const UChar* a, int len)
{
int i=0;
log_verbose("{");
@ -49,7 +50,7 @@ void printUSeq(const UChar* a, int len)
log_verbose("}\n");
}
void printSeqErr(const uint8_t* a, int len)
static void printSeqErr(const uint8_t* a, int len)
{
int i=0;
fprintf(stderr, "{");
@ -57,7 +58,8 @@ void printSeqErr(const uint8_t* a, int len)
fprintf(stderr, " 0x%02x, ", a[i++]);
fprintf(stderr, "}\n");
}
void printUSeqErr(const UChar* a, int len)
static void printUSeqErr(const UChar* a, int len)
{
int i=0;
fprintf(stderr, "{");
@ -65,13 +67,14 @@ void printUSeqErr(const UChar* a, int len)
fprintf(stderr, "0x%04x, ", a[i++]);
fprintf(stderr,"}\n");
}
void setNuConvTestName(const char *codepage, const char *direction)
static void setNuConvTestName(const char *codepage, const char *direction)
{
sprintf(gNuConvTestName, "[testing %s %s Unicode, InputBufSiz=%d, OutputBufSiz=%d]",
codepage,
direction,
gInBufferSize,
gOutBufferSize);
sprintf(gNuConvTestName, "[testing %s %s Unicode, InputBufSiz=%d, OutputBufSiz=%d]",
codepage,
direction,
gInBufferSize,
gOutBufferSize);
}
@ -86,21 +89,23 @@ void addTestConvertErrorCallBack(TestNode** root)
addTest(root, &TestSingleByteCallBack, "tsconv/nccbtst/TestSingleByteCallBack");
}
void TestSkipCallBack()
static void TestSkipCallBack()
{
TestSkip(NEW_MAX_BUFFER, NEW_MAX_BUFFER);
TestSkip(1,NEW_MAX_BUFFER);
TestSkip(1,1);
TestSkip(NEW_MAX_BUFFER, 1);
}
void TestStopCallBack()
static void TestStopCallBack()
{
TestStop(NEW_MAX_BUFFER, NEW_MAX_BUFFER);
TestStop(1,NEW_MAX_BUFFER);
TestStop(1,1);
TestStop(NEW_MAX_BUFFER, 1);
}
void TestSubCallBack()
static void TestSubCallBack()
{
TestSub(NEW_MAX_BUFFER, NEW_MAX_BUFFER);
TestSub(1,NEW_MAX_BUFFER);
@ -113,28 +118,32 @@ void TestSubCallBack()
}
void TestSubWithValueCallBack()
static void TestSubWithValueCallBack()
{
TestSubWithValue(NEW_MAX_BUFFER, NEW_MAX_BUFFER);
TestSubWithValue(1,NEW_MAX_BUFFER);
TestSubWithValue(1,1);
TestSubWithValue(NEW_MAX_BUFFER, 1);
}
void TestLegalAndOtherCallBack()
static void TestLegalAndOtherCallBack()
{
TestLegalAndOthers(NEW_MAX_BUFFER, NEW_MAX_BUFFER);
TestLegalAndOthers(1,NEW_MAX_BUFFER);
TestLegalAndOthers(1,1);
TestLegalAndOthers(NEW_MAX_BUFFER, 1);
}
void TestSingleByteCallBack()
static void TestSingleByteCallBack()
{
TestSingleByte(NEW_MAX_BUFFER, NEW_MAX_BUFFER);
TestSingleByte(1,NEW_MAX_BUFFER);
TestSingleByte(1,1);
TestSingleByte(NEW_MAX_BUFFER, 1);
}
void TestSkip(int32_t inputsize, int32_t outputsize)
static void TestSkip(int32_t inputsize, int32_t outputsize)
{
UChar sampleText[] = { 0x0000, 0xAC00, 0xAC01, 0xEF67, 0xD700 };
UChar sampleText2[] = { 0x6D63, 0x6D64, 0x6D65, 0x6D66 };
@ -453,7 +462,8 @@ void TestSkip(int32_t inputsize, int32_t outputsize)
}
}
void TestStop(int32_t inputsize, int32_t outputsize)
static void TestStop(int32_t inputsize, int32_t outputsize)
{
UChar sampleText[] = { 0x0000, 0xAC00, 0xAC01, 0xEF67, 0xD700 };
UChar sampleText2[] = { 0x6D63, 0x6D64, 0x6D65, 0x6D66 };
@ -688,7 +698,8 @@ void TestStop(int32_t inputsize, int32_t outputsize)
}
}
void TestSub(int32_t inputsize, int32_t outputsize)
static void TestSub(int32_t inputsize, int32_t outputsize)
{
UChar sampleText[] = { 0x0000, 0xAC00, 0xAC01, 0xEF67, 0xD700 };
UChar sampleText2[]= { 0x6D63, 0x6D64, 0x6D65, 0x6D66 };
@ -879,7 +890,7 @@ void TestSub(int32_t inputsize, int32_t outputsize)
}
void TestSubWithValue(int32_t inputsize, int32_t outputsize)
static void TestSubWithValue(int32_t inputsize, int32_t outputsize)
{
UChar sampleText[] = { 0x0000, 0xAC00, 0xAC01, 0xEF67, 0xD700 };
UChar sampleText2[] = { 0x6D63, 0x6D64, 0x6D65, 0x6D66 };
@ -1206,7 +1217,8 @@ void TestSubWithValue(int32_t inputsize, int32_t outputsize)
log_err("LMBCS->u with substitute with value did not match.\n");
}
}
void TestLegalAndOthers(int32_t inputsize, int32_t outputsize)
static void TestLegalAndOthers(int32_t inputsize, int32_t outputsize)
{
UChar legalText[] = { 0x0000, 0xAC00, 0xAC01, 0xD700 };
const uint8_t templegal949[] ={ 0x00, 0xb0, 0xa1, 0xb0, 0xa2, 0xc8, 0xd3 };
@ -1249,7 +1261,8 @@ void TestLegalAndOthers(int32_t inputsize, int32_t outputsize)
log_err("ibm-943->u with stop did not match.\n");
}
void TestSingleByte(int32_t inputsize, int32_t outputsize)
static void TestSingleByte(int32_t inputsize, int32_t outputsize)
{
const uint8_t sampleText[] = {
0x82, 0xa9, 0x61, 0x62, 0x63 , 0x82,
@ -1265,7 +1278,8 @@ void TestSingleByte(int32_t inputsize, int32_t outputsize)
(UConverterToUCallback)UCNV_TO_U_CALLBACK_SUBSTITUTE, fromIBM943Offssub, NULL, 0 ))
log_err("ibm-943->u with subst did not match.\n");
}
void TestEBCDIC_STATEFUL_Sub(int32_t inputsize, int32_t outputsize)
static void TestEBCDIC_STATEFUL_Sub(int32_t inputsize, int32_t outputsize)
{
/*EBCDIC_STATEFUL*/
UChar ebcdic_inputTest[] = { 0x0061, 0x6d64, 0x0061, 0x00A2, 0x6d65 };

View file

@ -40,12 +40,12 @@ static void TestSingleByte(int32_t inputsize, int32_t outputsize);
static void TestEBCDIC_STATEFUL_Sub(int32_t inputsize, int32_t outputsize);
UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
const char *codepage, UConverterFromUCallback callback, const int32_t *expectOffsets,
const char *codepage, UConverterFromUCallback callback, const int32_t *expectOffsets,
const char *mySubChar, int8_t len);
UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
const char *codepage, UConverterToUCallback callback, const int32_t *expectOffsets,
const char *codepage, UConverterToUCallback callback, const int32_t *expectOffsets,
const char *mySubChar, int8_t len);

View file

@ -33,36 +33,43 @@ static int32_t gInBufferSize = 0;
static int32_t gOutBufferSize = 0;
static char gNuConvTestName[1024];
void printSeq(const unsigned char* a, int len)
static void printSeq(const unsigned char* a, int len)
{
int i=0;
log_verbose("{");
while (i<len) log_verbose("0x%02x ", a[i++]);
log_verbose("}\n");
}
void printUSeq(const UChar* a, int len)
{
int i=0;
log_verbose("{U+");
while (i<len) log_verbose("0x%04x ", a[i++]);
while (i<len)
log_verbose("0x%02x ", a[i++]);
log_verbose("}\n");
}
void printSeqErr(const unsigned char* a, int len)
static void printUSeq(const UChar* a, int len)
{
int i=0;
log_verbose("{U+");
while (i<len)
log_verbose("0x%04x ", a[i++]);
log_verbose("}\n");
}
static void printSeqErr(const unsigned char* a, int len)
{
int i=0;
fprintf(stderr, "{");
while (i<len) fprintf(stderr, "0x%02x ", a[i++]);
while (i<len)
fprintf(stderr, "0x%02x ", a[i++]);
fprintf(stderr, "}\n");
}
void printUSeqErr(const UChar* a, int len)
static void printUSeqErr(const UChar* a, int len)
{
int i=0;
fprintf(stderr, "{U+");
while (i<len) fprintf(stderr, "0x%04x ", a[i++]);
while (i<len)
fprintf(stderr, "0x%04x ", a[i++]);
fprintf(stderr,"}\n");
}
void TestConverterFallBack(void)
static void TestConverterFallBack(void)
{
TestConvertFallBackWithBufferSizes(10,10);
TestConvertFallBackWithBufferSizes(2,3);
@ -98,7 +105,7 @@ void addTestConverterFallBack(TestNode** root)
This convenience function lets us make the error messages actually useful.
*/
void setNuConvTestName(const char *codepage, const char *direction)
static void setNuConvTestName(const char *codepage, const char *direction)
{
sprintf(gNuConvTestName, "[Testing %s %s Unicode, InputBufSiz=%d, OutputBufSiz=%d]",
codepage,
@ -108,7 +115,7 @@ void setNuConvTestName(const char *codepage, const char *direction)
}
UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
static UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
const char *codepage, UBool fallback, int32_t *expectOffsets)
{
@ -271,7 +278,7 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t
}
}
UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
static UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
const char *codepage, UBool fallback, int32_t *expectOffsets)
{
UErrorCode status = U_ZERO_ERROR;

View file

@ -18,12 +18,12 @@
#include "cintltst.h"
#include "unicode/utypes.h"
void TestConverterFallBack(void);
void TestConvertFallBackWithBufferSizes(int32_t outsize, int32_t insize );
static void TestConverterFallBack(void);
static void TestConvertFallBackWithBufferSizes(int32_t outsize, int32_t insize );
static UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
const char *codepage, UBool fallback, int32_t *expectOffsets);
const char *codepage, UBool fallback, int32_t *expectOffsets);
static UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
const char *codepage, UBool fallback, int32_t *expectOffsets);
const char *codepage, UBool fallback, int32_t *expectOffsets);
static void printSeq(const unsigned char* a, int len);

View file

@ -71,33 +71,38 @@ static void TestFlushInternalBuffer(); /*for improved code coverage in ucnv_cnv
static void TestWithBufferSize(int32_t osize, int32_t isize);
void printSeq(const unsigned char* a, int len)
static void printSeq(const unsigned char* a, int len)
{
int i=0;
log_verbose("\n{");
while (i<len) log_verbose("0x%02X ", a[i++]);
while (i<len)
log_verbose("0x%02X ", a[i++]);
log_verbose("}\n");
}
static void printUSeq(const UChar* a, int len)
{
int i=0;
log_verbose("\n{");
while (i<len) log_verbose("%0x04X ", a[i++]);
while (i<len)
log_verbose("%0x04X ", a[i++]);
log_verbose("}\n");
}
void printSeqErr(const unsigned char* a, int len)
static void printSeqErr(const unsigned char* a, int len)
{
int i=0;
fprintf(stderr, "\n{");
while (i<len) fprintf(stderr, "0x%02X ", a[i++]);
fprintf(stderr, "}\n");
}
static void printUSeqErr(const UChar* a, int len)
{
int i=0;
fprintf(stderr, "\n{");
while (i<len) fprintf(stderr, "0x%04X ", a[i++]);
while (i<len)
fprintf(stderr, "0x%04X ", a[i++]);
fprintf(stderr,"}\n");
}
@ -112,8 +117,9 @@ void addExtraTests(TestNode** root)
addTest(root, &TestFlushInternalBuffer, "tsconv/ncnvtst/TestFlushInternalBuffer");
}
/*test surrogate behaviour*/
void TestSurrogateBehaviour(){
static void TestSurrogateBehaviour(){
log_verbose("Testing for SBCS and LATIN_1\n");
{
UChar sampleText[] = {0x0031, 0xd801, 0xdc01, 0x0032};
@ -153,11 +159,11 @@ void TestSurrogateBehaviour(){
}
log_verbose("Testing for ISO-2022-jp\n");
{
UChar sampleText[] = { 0x4e00, 0x04e01, 0x0031, 0xd801, 0xdc01, 0x0032};
UChar sampleText[] = { 0x4e00, 0x04e01, 0x0031, 0xd801, 0xdc01, 0x0032};
const uint8_t expected[] = {0x1b, 0x24, 0x42,0x30,0x6c,0x43,0x7a,0x1b,0x28,0x42,
0x31,0x1b,0x28,0x42,0x1A,0x1b,0x28,0x42, 0x32};
int32_t offsets[] = {0,0,0,0,0,1,1,2,2,2,2,3,3,3,3,5,5,5,5 };
@ -215,10 +221,10 @@ void TestSurrogateBehaviour(){
}
log_verbose("Testing for HZ\n");
{
UChar sampleText[] = { 0x4e00, 0x04e01, 0x0031, 0xd801, 0xdc01, 0x0032};
UChar sampleText[] = { 0x4e00, 0x04e01, 0x0031, 0xd801, 0xdc01, 0x0032};
const uint8_t expected[] = {0x7E ,0x7B, 0x52, 0x3B, 0x36, 0x21, 0x7E, 0x7D, 0x31,0x7E, 0x7D, 0x1A,0x7E, 0x7D,0x32 };
int32_t offsets[] = {0,0,0,0,1,1,2,2,2,3,3,3,5,5,5};
@ -274,8 +280,9 @@ void TestSurrogateBehaviour(){
}
/*test various error behaviours*/
void TestErrorBehaviour(){
static void TestErrorBehaviour(){
log_verbose("Testing for SBCS and LATIN_1\n");
{
#if 0
@ -586,8 +593,9 @@ void TestErrorBehaviour(){
}
/*test different convertToUnicode error behaviours*/
void TestToUnicodeErrorBehaviour()
static void TestToUnicodeErrorBehaviour()
{
log_verbose("Testing error conditions for DBCS\n");
{
@ -679,7 +687,7 @@ void TestToUnicodeErrorBehaviour()
}
void TestGetNextErrorBehaviour(){
static void TestGetNextErrorBehaviour(){
/*Test for unassigned character*/
static const char input1[]={ 0x70 };
const char* source=(const char*)input1;
@ -701,7 +709,7 @@ void TestGetNextErrorBehaviour(){
}
/*Regression test for utf8 converter*/
void TestRegression(){
static void TestRegression(){
uint8_t *buffer=0;
UChar32 c;
char *targ;
@ -793,8 +801,9 @@ void TestRegression(){
free(buffer);
}
/*Walk through the available converters*/
void TestAvailableConverters(){
static void TestAvailableConverters(){
UErrorCode status=U_ZERO_ERROR;
UConverter *conv=NULL;
int32_t i=0;
@ -811,14 +820,14 @@ void TestAvailableConverters(){
}
void TestFlushInternalBuffer(){
static void TestFlushInternalBuffer(){
TestWithBufferSize(MAX_LENGTH, 1);
TestWithBufferSize(1, 1);
TestWithBufferSize(1, MAX_LENGTH);
TestWithBufferSize(MAX_LENGTH, MAX_LENGTH);
}
void TestWithBufferSize(int32_t insize, int32_t outsize){
static void TestWithBufferSize(int32_t insize, int32_t outsize){
gInBufferSize =insize;
gOutBufferSize = outsize;
@ -889,7 +898,7 @@ void TestWithBufferSize(int32_t insize, int32_t outsize){
}
UBool convertFromU( const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
static UBool convertFromU( const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
const char *codepage, int32_t *expectOffsets, UBool doFlush, UErrorCode expectedStatus)
{
@ -978,7 +987,7 @@ UBool convertFromU( const UChar *source, int sourceLen, const uint8_t *expect,
}
UBool convertToU( const uint8_t *source, int sourceLen, const UChar *expect, int expectLen,
static UBool convertToU( const uint8_t *source, int sourceLen, const UChar *expect, int expectLen,
const char *codepage, int32_t *expectOffsets, UBool doFlush, UErrorCode expectedStatus)
{
UErrorCode status = U_ZERO_ERROR;
@ -1075,7 +1084,7 @@ UBool convertToU( const uint8_t *source, int sourceLen, const UChar *expect, int
}
UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
static UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
const char *codepage, UConverterFromUCallback callback , int32_t *expectOffsets)
{
UErrorCode status = U_ZERO_ERROR;
@ -1241,7 +1250,7 @@ UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expe
}
}
UBool testConvertToU( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
static UBool testConvertToU( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
const char *codepage, UConverterToUCallback callback, int32_t *expectOffsets)
{
UErrorCode status = U_ZERO_ERROR;

View file

@ -29,30 +29,30 @@ static void printUSeq(const UChar* a, int len);
static void TestNextUChar(UConverter* cnv, const char* source, const char* limit, const uint32_t results[], const char* message);
static void TestNextUCharError(UConverter* cnv, const char* source, const char* limit, UErrorCode expected, const char* message);
void TestNewConvertWithBufferSizes(int32_t osize, int32_t isize) ;
void TestConverterTypesAndStarters(void);
void TestAmbiguous(void);
void TestUTF8(void);
void TestUTF16BE(void);
void TestUTF16LE(void);
void TestLATIN1(void);
void TestSBCS(void);
void TestDBCS(void);
void TestMBCS(void);
void TestISO_2022(void);
void TestISO_2022_JP(void);
void TestISO_2022_JP_1(void);
void TestISO_2022_JP_2(void);
void TestISO_2022_KR(void);
void TestISO_2022_CN(void);
void TestISO_2022_CN_EXT(void);
void TestHZ(void);
void TestISO_2022_JP_Next(void);
void TestEBCDIC_STATEFUL(void);
void TestGB18030(void);
void TestLMBCS(void);
void TestJitterbug255(void);
void TestEBCDICUS4XML(void);
static void TestNewConvertWithBufferSizes(int32_t osize, int32_t isize) ;
static void TestConverterTypesAndStarters(void);
static void TestAmbiguous(void);
static void TestUTF8(void);
static void TestUTF16BE(void);
static void TestUTF16LE(void);
static void TestLATIN1(void);
static void TestSBCS(void);
static void TestDBCS(void);
static void TestMBCS(void);
static void TestISO_2022(void);
static void TestISO_2022_JP(void);
static void TestISO_2022_JP_1(void);
static void TestISO_2022_JP_2(void);
static void TestISO_2022_KR(void);
static void TestISO_2022_CN(void);
static void TestISO_2022_CN_EXT(void);
static void TestHZ(void);
static void TestISO_2022_JP_Next(void);
static void TestEBCDIC_STATEFUL(void);
static void TestGB18030(void);
static void TestLMBCS(void);
static void TestJitterbug255(void);
static void TestEBCDICUS4XML(void);
#define NEW_MAX_BUFFER 999
@ -62,14 +62,16 @@ static char gNuConvTestName[1024];
#define nct_min(x,y) ((x<y) ? x : y)
void printSeq(const unsigned char* a, int len)
static void printSeq(const unsigned char* a, int len)
{
int i=0;
log_verbose("{");
while (i<len) log_verbose("0x%02x ", a[i++]);
while (i<len)
log_verbose("0x%02x ", a[i++]);
log_verbose("}\n");
}
void printUSeq(const UChar* a, int len)
static void printUSeq(const UChar* a, int len)
{
int i=0;
log_verbose("{U+");
@ -77,21 +79,25 @@ void printUSeq(const UChar* a, int len)
log_verbose("}\n");
}
void printSeqErr(const unsigned char* a, int len)
static void printSeqErr(const unsigned char* a, int len)
{
int i=0;
fprintf(stderr, "{");
while (i<len) fprintf(stderr, "0x%02x ", a[i++]);
while (i<len)
fprintf(stderr, "0x%02x ", a[i++]);
fprintf(stderr, "}\n");
}
void printUSeqErr(const UChar* a, int len)
{
int i=0;
fprintf(stderr, "{U+");
while (i<len) fprintf(stderr, "0x%04x ", a[i++]);
while (i<len)
fprintf(stderr, "0x%04x ", a[i++]);
fprintf(stderr,"}\n");
}
void
static void
TestNextUChar(UConverter* cnv, const char* source, const char* limit, const uint32_t results[], const char* message)
{
const char* s0;
@ -114,7 +120,8 @@ TestNextUChar(UConverter* cnv, const char* source, const char* limit, const uint
r+=2;
}
}
void
static void
TestNextUCharError(UConverter* cnv, const char* source, const char* limit, UErrorCode expected, const char* message)
{
const char* s=(char*)source;
@ -129,7 +136,8 @@ TestNextUCharError(UConverter* cnv, const char* source, const char* limit, UErro
}
}
void TestInBufSizes(void)
static void TestInBufSizes(void)
{
TestNewConvertWithBufferSizes(NEW_MAX_BUFFER,1);
#if 1
@ -144,7 +152,7 @@ void TestInBufSizes(void)
#endif
}
void TestOutBufSizes(void)
static void TestOutBufSizes(void)
{
#if 1
TestNewConvertWithBufferSizes(NEW_MAX_BUFFER,NEW_MAX_BUFFER);
@ -193,7 +201,7 @@ void addTestNewConvert(TestNode** root)
This convenience function lets us make the error messages actually useful.
*/
void setNuConvTestName(const char *codepage, const char *direction)
static void setNuConvTestName(const char *codepage, const char *direction)
{
sprintf(gNuConvTestName, "[Testing %s %s Unicode, InputBufSiz=%d, OutputBufSiz=%d]",
codepage,
@ -202,7 +210,7 @@ void setNuConvTestName(const char *codepage, const char *direction)
gOutBufferSize);
}
UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
static UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
const char *codepage, int32_t *expectOffsets)
{
UErrorCode status = U_ZERO_ERROR;
@ -360,7 +368,7 @@ UBool testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expe
}
}
UBool testConvertToU( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
static UBool testConvertToU( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
const char *codepage, int32_t *expectOffsets)
{
UErrorCode status = U_ZERO_ERROR;
@ -517,7 +525,7 @@ UBool testConvertToU( const uint8_t *source, int sourcelen, const UChar *expect,
}
void TestNewConvertWithBufferSizes(int32_t outsize, int32_t insize )
static void TestNewConvertWithBufferSizes(int32_t outsize, int32_t insize )
{
/** test chars #1 */
/* 1 2 3 1Han 2Han 3Han . */
@ -874,7 +882,7 @@ void TestNewConvertWithBufferSizes(int32_t outsize, int32_t insize )
}
void TestConverterTypesAndStarters()
static void TestConverterTypesAndStarters()
{
UConverter* myConverter[3];
UErrorCode err = U_ZERO_ERROR;
@ -958,7 +966,8 @@ void TestConverterTypesAndStarters()
ucnv_close(myConverter[1]);
ucnv_close(myConverter[2]);
}
void TestAmbiguous()
static void TestAmbiguous()
{
UErrorCode status = U_ZERO_ERROR;
UConverter *ascii_cnv = 0, *sjis_cnv = 0;
@ -1037,7 +1046,7 @@ void TestAmbiguous()
}
void
TestUTF8() {
static TestUTF8() {
/* test input */
static const uint8_t in[]={
0x61,
@ -1071,8 +1080,9 @@ TestUTF8() {
TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit < source");
ucnv_close(cnv);
}
void
TestUTF16BE() {
static TestUTF16BE() {
/* test input */
static const uint8_t in[]={
0x00, 0x61,
@ -1118,7 +1128,8 @@ TestUTF16BE() {
}
ucnv_close(cnv);
}
void
static void
TestUTF16LE() {
/* test input */
static const uint8_t in[]={
@ -1162,7 +1173,8 @@ TestUTF16LE() {
ucnv_close(cnv);
}
void
static void
TestLATIN1() {
/* test input */
static const uint8_t in[]={
@ -1200,7 +1212,7 @@ TestLATIN1() {
ucnv_close(cnv);
}
void
static void
TestSBCS() {
/* test input */
static const uint8_t in[]={ 0x61, 0xc0, 0x80, 0xe0, 0xf0, 0xf4};
@ -1235,7 +1247,7 @@ TestSBCS() {
ucnv_close(cnv);
}
void
static void
TestDBCS() {
/* test input */
static const uint8_t in[]={
@ -1280,7 +1292,8 @@ TestDBCS() {
}
ucnv_close(cnv);
}
void
static void
TestMBCS() {
/* test input */
static const uint8_t in[]={
@ -1330,7 +1343,8 @@ TestMBCS() {
ucnv_close(cnv);
}
void
static void
TestISO_2022() {
/* test input */
static const uint8_t in[]={
@ -1383,12 +1397,12 @@ TestISO_2022() {
}
ucnv_close(cnv);
}
void
static void
TestISO_2022_JP_Next() {
}
void
static void
TestSmallTargetBuffer(const uint16_t* source, const UChar* sourceLimit,UConverter* cnv, char* cnvName){
const UChar* uSource;
const UChar* uSourceLimit;
@ -1457,7 +1471,8 @@ TestSmallTargetBuffer(const uint16_t* source, const UChar* sourceLimit,UConverte
free(uBuf);
free(cBuf);
}
void TestSmallSourceBuffer(const uint16_t* source, const UChar* sourceLimit,UConverter* cnv, char* cnvName){
static void TestSmallSourceBuffer(const uint16_t* source, const UChar* sourceLimit,UConverter* cnv, char* cnvName){
const UChar* uSource;
const UChar* uSourceLimit;
const char* cSource;
@ -1528,7 +1543,7 @@ void TestSmallSourceBuffer(const uint16_t* source, const UChar* sourceLimit,UCon
free(cBuf);
}
void
static void
TestGetNextUChar2022(UConverter* cnv, const char* source, const char* limit,
const uint16_t results[], const char* message){
const char* s0;
@ -1550,7 +1565,7 @@ TestGetNextUChar2022(UConverter* cnv, const char* source, const char* limit,
}
}
void
static void
TestHZ() {
/* test input */
static const uint16_t in[]={
@ -1628,7 +1643,7 @@ TestHZ() {
free(cBuf);
}
void
static void
TestISO_2022_JP() {
/* test input */
static const uint16_t in[]={
@ -1711,7 +1726,7 @@ TestISO_2022_JP() {
free(offsets);
}
void
static void
TestISO_2022_JP_1() {
/* test input */
static const uint16_t in[]={
@ -1794,7 +1809,7 @@ TestISO_2022_JP_1() {
free(cBuf);
}
void
static void
TestISO_2022_JP_2() {
/* test input */
static const uint16_t in[]={
@ -1878,7 +1893,7 @@ TestISO_2022_JP_2() {
free(offsets);
}
void
static void
TestISO_2022_KR() {
/* test input */
static const uint16_t in[]={
@ -1947,7 +1962,8 @@ TestISO_2022_KR() {
free(cBuf);
free(offsets);
}
void
static void
TestISO_2022_CN_EXT() {
/* test input */
static const uint16_t in[]={
@ -2034,7 +2050,7 @@ TestISO_2022_CN_EXT() {
free(offsets);
}
void
static void
TestISO_2022_CN() {
/* test input */
static const uint16_t in[]={
@ -2119,7 +2135,8 @@ TestISO_2022_CN() {
free(cBuf);
free(offsets);
}
void
static void
TestEBCDIC_STATEFUL() {
/* test input */
static const uint8_t in[]={
@ -2186,7 +2203,7 @@ TestEBCDIC_STATEFUL() {
}
void
static void
TestGB18030() {
/* test input */
static const UChar u2[]={
@ -2237,7 +2254,7 @@ TestGB18030() {
#endif
};
const char *source=(const char *)in,*limit=(const char *)in+sizeof(in);
/* const char *source=(const char *)in,*limit=(const char *)in+sizeof(in); */
UErrorCode errorCode=U_ZERO_ERROR;
UConverter *cnv=ucnv_open("gb18030", &errorCode);
if(U_FAILURE(errorCode)) {
@ -2248,7 +2265,7 @@ TestGB18030() {
ucnv_close(cnv);
}
void
static void
TestLMBCS() {
/* LMBCS-1 string */
static const uint8_t pszLMBCS[]={
@ -2807,7 +2824,7 @@ TestLMBCS() {
}
void TestJitterbug255()
static void TestJitterbug255()
{
const uint8_t testBytes[] = { 0x95, 0xcf, 0x8a, 0xb7, 0x0d, 0x0a, 0x00 };
const uint8_t *testBuffer = testBytes;
@ -2833,7 +2850,7 @@ void TestJitterbug255()
ucnv_close(cnv);
}
void TestEBCDICUS4XML()
static void TestEBCDICUS4XML()
{
UChar unicodes_x[] = {0x0000, 0x0000, 0x0000, 0x0000};
const UChar toUnicodeMaps_x[] = {0x000A, 0x000A, 0x000D, 0x0000};

View file

@ -21,8 +21,8 @@
#include "unicode/putil.h"
#include "unicode/ustring.h"
void TestPUtilAPI();
void testIEEEremainder();
static void TestPUtilAPI();
static void testIEEEremainder();
static void remainderTest(double x, double y, double exp);
static void doAssert(double expect, double got, const char *message);
static UBool compareWithNAN(double x, double y);
@ -37,7 +37,7 @@ addPUtilTest(TestNode** root)
}
void TestPUtilAPI(){
static void TestPUtilAPI(){
double n1=0.0, y1=0.0, expn1, expy1;
int result=0;
@ -298,7 +298,8 @@ void TestPUtilAPI(){
}
void testIEEEremainder()
static void testIEEEremainder()
{
double pinf = uprv_getInfinity();
double ninf = -uprv_getInfinity();
@ -347,7 +348,7 @@ static UBool compareWithNAN(double x, double y)
return TRUE;
}
void remainderTest(double x, double y, double exp)
static void remainderTest(double x, double y, double exp)
{
double result = uprv_IEEEremainder(x,y);
@ -363,7 +364,8 @@ void remainderTest(double x, double y, double exp)
}
}
void doAssert(double got, double expect, const char *message)
static void doAssert(double got, double expect, const char *message)
{
if(! compareWithNAN(expect, got) ) {
log_err("ERROR : %s. Expected : %lf, Got: %lf\n", message, expect, got);

View file

@ -638,7 +638,7 @@ void TestAppData()
if(!u_strcmp(icuString, appString))
{
log_err("%s:%d: Error! Expected ICU and App root version strings to be DIFFERENT but they are both %s and %s\n", __FILE__, __LINE__, austrdup(icuString),
austrdup(appString));
austrdup(appString));
}
else
{

View file

@ -44,7 +44,7 @@ addUTF8Test(TestNode** root)
addTest(root, &TestAppendChar, "utf8tst/TestAppendChar" );
}
void TestCodeUnitValues()
static void TestCodeUnitValues()
{
static uint8_t codeunit[]={0x00, 0x65, 0x7e, 0x7f, 0xc0, 0xc4, 0xf0, 0xfd, 0x80, 0x81, 0xbc, 0xbf,};
@ -70,7 +70,8 @@ void TestCodeUnitValues()
}
}
}
void TestCharLength()
static void TestCharLength()
{
static uint32_t codepoint[]={
1, 0x0061,
@ -104,7 +105,8 @@ void TestCharLength()
}
}
}
void TestGetChar()
static void TestGetChar()
{
static uint8_t input[]={
/* code unit,*/
@ -169,7 +171,7 @@ void TestGetChar()
}
void TestNextPrevChar(){
static void TestNextPrevChar(){
static uint8_t input[]={0x61, 0xf0, 0x90, 0x90, 0x81, 0xc0, 0x80, 0xfd, 0xbf, 0xc0, 0x61, 0x81, 0x90, 0x90, 0xf0, 0x00};
static uint32_t result[]={
@ -313,7 +315,8 @@ void TestNextPrevChar(){
}
}
void TestFwdBack(){
static void TestFwdBack(){
static uint8_t input[]={0x61, 0xF0, 0x90, 0x90, 0x81, 0xff, 0x62, 0xc0, 0x80, 0x7f, 0x8f, 0xc0, 0x63, 0x81, 0x90, 0x90, 0xF0, 0x00};
static uint16_t fwd_unsafe[] ={1, 5, 6, 7, 9, 10, 11, 13, 14, 15, 16, 20, };
static uint16_t fwd_safe[] ={1, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18};
@ -392,7 +395,8 @@ void TestFwdBack(){
}
}
}
void TestSetChar(){
static void TestSetChar(){
static uint8_t input[]={0x61, 0xe4, 0xba, 0x8c, 0x7f, 0xfe, 0x62, 0xc5, 0x7f, 0x61, 0x80, 0x80, 0xe0, 0x00};
static uint16_t start_unsafe[]={0, 1, 1, 1, 4, 5, 6, 7, 8, 9, 9, 9, 12, 13};
static uint16_t start_safe[] ={0, 1, 1, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
@ -435,7 +439,8 @@ void TestSetChar(){
i++;
}
}
void TestAppendChar(){
static void TestAppendChar(){
static uint8_t s[11]={0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x00};
static uint32_t test[]={
/*append-position(unsafe), CHAR to be appended */
@ -603,7 +608,8 @@ void TestAppendChar(){
}
void printUChars(uint8_t *uchars, int16_t len){
static void printUChars(uint8_t *uchars, int16_t len){
int16_t i=0;
for(i=0; i<len; i++){
printf("0x%02x ", *(uchars+i));
@ -611,4 +617,3 @@ void printUChars(uint8_t *uchars, int16_t len){
}

View file

@ -18,12 +18,12 @@
#define TEST(x) addTest(root, &x, "utrans/" # x)
void TestAPI();
void TestSimpleRules();
void TestFilter();
void TestOpenInverse();
void TestClone();
void TestRegisterUnregister();
static void TestAPI();
static void TestSimpleRules();
static void TestFilter();
static void TestOpenInverse();
static void TestClone();
static void TestRegisterUnregister();
static void _expectRules(const char*, const char*, const char*);
static void _expect(const UTransliterator* trans, const char* cfrom, const char* cto);
@ -38,7 +38,7 @@ addUTransTest(TestNode** root) {
TEST(TestRegisterUnregister);
}
void TestAPI() {
static void TestAPI() {
enum { BUF_CAP = 128 };
char buf[BUF_CAP], buf2[BUF_CAP];
UErrorCode status = U_ZERO_ERROR;
@ -78,7 +78,7 @@ void TestAPI() {
utrans_close(trans);
}
void TestOpenInverse(){
static void TestOpenInverse(){
UErrorCode status=U_ZERO_ERROR;
UTransliterator* t1=NULL;
UTransliterator* inverse1=NULL;
@ -106,11 +106,11 @@ void TestOpenInverse(){
};
for(i=0; i<sizeof(TransID)/sizeof(TransID[0]); i=i+2){
t1=utrans_open(TransID[i], UTRANS_FORWARD, &status);
if(t1 == NULL || U_FAILURE(status)){
t1=utrans_open(TransID[i], UTRANS_FORWARD, &status);
if(t1 == NULL || U_FAILURE(status)){
log_err("FAIL: in instantiation for id=%s\n", TransID[i]);
continue;
}
continue;
}
inverse1=utrans_openInverse(t1, &status);
if(U_FAILURE(status)){
log_err("FAIL: utrans_openInverse() failed for id=%s. Error=%s\n", TransID[i], myErrorName(status));
@ -121,11 +121,11 @@ void TestOpenInverse(){
log_err("FAIL :openInverse() for %s returned %s instead of %s\n", TransID[i], buf1, TransID[i+1]);
}
utrans_close(t1);
utrans_close(inverse1);
utrans_close(inverse1);
}
}
void TestClone(){
static void TestClone(){
UErrorCode status=U_ZERO_ERROR;
UTransliterator* t1=NULL;
UTransliterator* t2=NULL;
@ -134,20 +134,20 @@ void TestClone(){
enum { BUF_CAP = 128 };
char buf1[BUF_CAP], buf2[BUF_CAP], buf3[BUF_CAP];
t1=utrans_open("Latin-Devanagari", UTRANS_FORWARD, &status);
t1=utrans_open("Latin-Devanagari", UTRANS_FORWARD, &status);
if(U_FAILURE(status)){
log_err("FAIL: construction\n");
return;
}
t2=utrans_open("Latin-Hebrew", UTRANS_FORWARD, &status);
if(U_FAILURE(status)){
t2=utrans_open("Latin-Hebrew", UTRANS_FORWARD, &status);
if(U_FAILURE(status)){
log_err("FAIL: construction\n");
utrans_close(t1);
return;
}
t3=utrans_clone(t1, &status);
t4=utrans_clone(t2, &status);
t3=utrans_clone(t1, &status);
t4=utrans_clone(t2, &status);
utrans_getID(t1, buf1, BUF_CAP);
utrans_getID(t2, buf2, BUF_CAP);
@ -172,7 +172,7 @@ void TestClone(){
}
void TestRegisterUnregister(){
static void TestRegisterUnregister(){
UErrorCode status=U_ZERO_ERROR;
UTransliterator* t1=NULL;
UTransliterator* rules=NULL;
@ -229,7 +229,7 @@ void TestRegisterUnregister(){
utrans_close(inverse1);
}
void TestSimpleRules() {
static void TestSimpleRules() {
/* Test rules */
/* Example: rules 1. ab>x|y
* 2. yc>z
@ -275,7 +275,7 @@ void TestSimpleRules() {
"abcdefgABCDEFGU", "&bcd&fg!^**!^*&");
}
void TestFilter() {
static void TestFilter() {
UErrorCode status = U_ZERO_ERROR;
UChar filt[128];
UChar buf[128];
@ -339,7 +339,7 @@ void TestFilter() {
utrans_close(hex);
}
void _expectRules(const char* crules,
static void _expectRules(const char* crules,
const char* cfrom,
const char* cto) {
/* u_uastrcpy has no capacity param for the buffer -- so just
@ -366,7 +366,7 @@ void _expectRules(const char* crules,
utrans_close(trans);
}
void _expect(const UTransliterator* trans,
static void _expect(const UTransliterator* trans,
const char* cfrom,
const char* cto) {
/* u_uastrcpy has no capacity param for the buffer -- so just