From 439b8753465c5e51619d98e6b376ea92067eee71 Mon Sep 17 00:00:00 2001 From: Ram Viswanadha Date: Tue, 6 Mar 2001 03:42:35 +0000 Subject: [PATCH] ICU-96 Fixed Collation tests X-SVN-Rev: 3914 --- icu4c/source/test/cintltst/callcoll.c | 8 +++--- icu4c/source/test/cintltst/callcoll.h | 2 +- icu4c/source/test/cintltst/cdantst.c | 33 +----------------------- icu4c/source/test/cintltst/cdantst.h | 3 --- icu4c/source/test/cintltst/cdetst.c | 33 +----------------------- icu4c/source/test/cintltst/cdetst.h | 6 +---- icu4c/source/test/cintltst/cestst.c | 32 +----------------------- icu4c/source/test/cintltst/cestst.h | 4 +-- icu4c/source/test/cintltst/cfintst.c | 32 +----------------------- icu4c/source/test/cintltst/cfintst.h | 2 -- icu4c/source/test/cintltst/cfrtst.c | 35 +------------------------- icu4c/source/test/cintltst/cfrtst.h | 3 --- icu4c/source/test/cintltst/cg7coll.c | 33 +----------------------- icu4c/source/test/cintltst/cg7coll.h | 5 +--- icu4c/source/test/cintltst/cjaptst.c | 36 +-------------------------- icu4c/source/test/cintltst/cjaptst.h | 6 +---- icu4c/source/test/cintltst/cmsccoll.c | 34 +------------------------ icu4c/source/test/cintltst/cturtst.c | 33 +----------------------- icu4c/source/test/cintltst/cturtst.h | 3 --- icu4c/source/test/cintltst/encoll.c | 33 +----------------------- icu4c/source/test/cintltst/encoll.h | 4 --- icu4c/source/test/cintltst/nucnvtst.c | 4 +-- 22 files changed, 21 insertions(+), 363 deletions(-) diff --git a/icu4c/source/test/cintltst/callcoll.c b/icu4c/source/test/cintltst/callcoll.c index ab9c2868ca1..2d2e15c7d14 100644 --- a/icu4c/source/test/cintltst/callcoll.c +++ b/icu4c/source/test/cintltst/callcoll.c @@ -35,6 +35,7 @@ #include "unicode/utypes.h" #include "unicode/ucol.h" #include "unicode/uloc.h" +#include "cstring.h" #include "cintltst.h" #include "ccolltst.h" #include "callcoll.h" @@ -413,10 +414,10 @@ void addAllCollTest(TestNode** root) addTest(root, &TestJB581, "tscoll/callcoll/TestJB581"); } -static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) +void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) { int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; + int temp=0; UCollationResult compareResult, keyResult, incResult; uint8_t *sortKey1, *sortKey2; @@ -434,8 +435,7 @@ static void doTest(UCollator* myCollation, const UChar source[], const UChar tar sortKey2=(uint8_t*)malloc(sizeof(uint8_t) * (sortklenmax+1)); ucol_getSortKey(myCollation, target, u_strlen(target), sortKey2, sortklen2+1); - - temp= memcmp(sortKey1, sortKey2, sortklenmin); + temp= uprv_strcmp(sortKey1, sortKey2);/*memcmp(sortKey1, sortKey2,sortklenmax);*/ if(temp < 0) keyResult=UCOL_LESS; else if(temp > 0) keyResult= UCOL_GREATER; else keyResult = UCOL_EQUAL; diff --git a/icu4c/source/test/cintltst/callcoll.h b/icu4c/source/test/cintltst/callcoll.h index 41b0aeacc96..1ca59e3852e 100644 --- a/icu4c/source/test/cintltst/callcoll.h +++ b/icu4c/source/test/cintltst/callcoll.h @@ -28,7 +28,7 @@ #define MAX_TOKEN_LEN 128 /* tests comparison of custom collation with different strengths */ -static void doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result); +void doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result); /* perform test with strength PRIMARY */ static void TestPrimary(void); diff --git a/icu4c/source/test/cintltst/cdantst.c b/icu4c/source/test/cintltst/cdantst.c index f2abd9feb0f..b84a172f527 100644 --- a/icu4c/source/test/cintltst/cdantst.c +++ b/icu4c/source/test/cintltst/cdantst.c @@ -26,6 +26,7 @@ #include "cintltst.h" #include "ccolltst.h" #include "cdantst.h" +#include "callcoll.h" #include "unicode/ustring.h" static UCollator *myCollation; @@ -189,38 +190,6 @@ void addDanishCollTest(TestNode** root) -static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) -{ - int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; - UCollationResult compareResult, keyResult, incResult; - uint8_t *sortKey1, *sortKey2; - - compareResult = ucol_strcoll(myCollation, source, u_strlen(source), target, u_strlen(target)); - incResult = ctst_strcollTestIncremental(myCollation, source, u_strlen(source), target, u_strlen(target)); - - sortklen1=ucol_getSortKey(myCollation, source, u_strlen(source), NULL, 0); - sortklen2=ucol_getSortKey(myCollation, target, u_strlen(target), NULL, 0); - - sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2); - sortklenmin = (sortklen1 0) keyResult= UCOL_GREATER; - else keyResult = UCOL_EQUAL; - reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, incResult, result ); - free(sortKey1); - free(sortKey2); -} - static void TestTertiary( ) { diff --git a/icu4c/source/test/cintltst/cdantst.h b/icu4c/source/test/cintltst/cdantst.h index 430df822602..66be3f10ba7 100644 --- a/icu4c/source/test/cintltst/cdantst.h +++ b/icu4c/source/test/cintltst/cdantst.h @@ -26,9 +26,6 @@ #define MAX_TOKEN_LEN 128 - - /*main test routine, tests comparisons for a set of strings against sets of expected results */ -static void doTest(UCollator*, const UChar source[], const UChar target[], UCollationResult result); /* performs test with strength PRIMARY */ static void TestPrimary(void); diff --git a/icu4c/source/test/cintltst/cdetst.c b/icu4c/source/test/cintltst/cdetst.c index 60a435965ea..1b2da3a17db 100644 --- a/icu4c/source/test/cintltst/cdetst.c +++ b/icu4c/source/test/cintltst/cdetst.c @@ -25,6 +25,7 @@ #include "cintltst.h" #include "cdetst.h" #include "ccolltst.h" +#include "callcoll.h" #include "unicode/ustring.h" #include "string.h" @@ -92,38 +93,6 @@ void addGermanCollTest(TestNode** root) } -static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) -{ - int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; - UCollationResult compareResult, keyResult, incResult; - uint8_t *sortKey1, *sortKey2; - - compareResult = ucol_strcoll(myCollation, source, u_strlen(source), target, u_strlen(target)); - incResult = ctst_strcollTestIncremental(myCollation, source, u_strlen(source), target, u_strlen(target)); - - sortklen1=ucol_getSortKey(myCollation, source, u_strlen(source), NULL, 0); - sortklen2=ucol_getSortKey(myCollation, target, u_strlen(target), NULL, 0); - - sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2); - sortklenmin = (sortklen1 0) keyResult= UCOL_GREATER; - else keyResult = UCOL_EQUAL; - reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, incResult, result ); - free(sortKey1); - free(sortKey2); -} - static void TestTertiary( ) { diff --git a/icu4c/source/test/cintltst/cdetst.h b/icu4c/source/test/cintltst/cdetst.h index c790f7cfc89..79c83b91303 100644 --- a/icu4c/source/test/cintltst/cdetst.h +++ b/icu4c/source/test/cintltst/cdetst.h @@ -27,13 +27,9 @@ #define MAX_TOKEN_LEN 128 - - /* main test routine, tests comparisons for a set of strings against sets of expected results*/ - static void doTest(UCollator*, const UChar source[], const UChar target[], UCollationResult result); - /* performs test with strength PRIMARY */ - static void TestPrimary(void); +static void TestPrimary(void); /* perform test with strength TERTIARY */ static void TestTertiary(void); diff --git a/icu4c/source/test/cintltst/cestst.c b/icu4c/source/test/cintltst/cestst.c index 009b9ebad3e..378b1ddafd9 100644 --- a/icu4c/source/test/cintltst/cestst.c +++ b/icu4c/source/test/cintltst/cestst.c @@ -25,6 +25,7 @@ #include "cintltst.h" #include "cestst.h" #include "ccolltst.h" +#include "callcoll.h" #include "unicode/ustring.h" #include "string.h" @@ -76,37 +77,6 @@ void addSpanishCollTest(TestNode** root) } -static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) -{ - int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; - UCollationResult compareResult, keyResult, incResult; - uint8_t *sortKey1, *sortKey2; - - compareResult = ucol_strcoll(myCollation, source, u_strlen(source), target, u_strlen(target)); - incResult = ctst_strcollTestIncremental(myCollation, source, u_strlen(source), target, u_strlen(target)); - - sortklen1=ucol_getSortKey(myCollation, source, u_strlen(source), NULL, 0); - sortklen2=ucol_getSortKey(myCollation, target, u_strlen(target), NULL, 0); - - sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2); - sortklenmin = (sortklen1 0) keyResult= UCOL_GREATER; - else keyResult = UCOL_EQUAL; - reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, incResult, result ); - free(sortKey1); - free(sortKey2); -} static void TestTertiary( ) { diff --git a/icu4c/source/test/cintltst/cestst.h b/icu4c/source/test/cintltst/cestst.h index 06286c08d39..54d0133c4e0 100644 --- a/icu4c/source/test/cintltst/cestst.h +++ b/icu4c/source/test/cintltst/cestst.h @@ -27,9 +27,7 @@ #define MAX_TOKEN_LEN 128 - /* main test routine, tests comparisons for a set of strings against sets of expected results*/ -static void doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result); - + /* perform test with strength SECONDARY */ static void TestPrimary(void); diff --git a/icu4c/source/test/cintltst/cfintst.c b/icu4c/source/test/cintltst/cfintst.c index 9e30b22dfd5..1c54daa0db5 100644 --- a/icu4c/source/test/cintltst/cfintst.c +++ b/icu4c/source/test/cintltst/cfintst.c @@ -24,6 +24,7 @@ #include "unicode/uloc.h" #include "cintltst.h" #include "ccolltst.h" +#include "callcoll.h" #include "cfintst.h" #include "unicode/ustring.h" #include "string.h" @@ -67,37 +68,6 @@ void addFinnishCollTest(TestNode** root) } -static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) -{ - int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; - UCollationResult compareResult, keyResult, incResult; - uint8_t *sortKey1, *sortKey2; - - compareResult = ucol_strcoll(myCollation, source, u_strlen(source), target, u_strlen(target)); - incResult = ctst_strcollTestIncremental(myCollation, source, u_strlen(source), target, u_strlen(target)); - - sortklen1=ucol_getSortKey(myCollation, source, u_strlen(source), NULL, 0); - sortklen2=ucol_getSortKey(myCollation, target, u_strlen(target), NULL, 0); - - sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2); - sortklenmin = (sortklen1 0) keyResult= UCOL_GREATER; - else keyResult = UCOL_EQUAL; - reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, incResult, result ); - free(sortKey1); - free(sortKey2); -} static void TestTertiary( ) { diff --git a/icu4c/source/test/cintltst/cfintst.h b/icu4c/source/test/cintltst/cfintst.h index 11137865f21..0d931dba5e8 100644 --- a/icu4c/source/test/cintltst/cfintst.h +++ b/icu4c/source/test/cintltst/cfintst.h @@ -27,8 +27,6 @@ #define MAX_TOKEN_LEN 128 - /* main test routine, tests comparisons for a set of strings against sets of expected results*/ - static void doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result); /* perform test with strength SECONDARY*/ static void TestPrimary(void); diff --git a/icu4c/source/test/cintltst/cfrtst.c b/icu4c/source/test/cintltst/cfrtst.c index 33ecb148ea8..e0aea9ab923 100644 --- a/icu4c/source/test/cintltst/cfrtst.c +++ b/icu4c/source/test/cintltst/cfrtst.c @@ -24,6 +24,7 @@ #include "unicode/uloc.h" #include "cintltst.h" #include "ccolltst.h" +#include "callcoll.h" #include "cfrtst.h" #include "unicode/ustring.h" #include "string.h" @@ -136,40 +137,6 @@ void addFrenchCollTest(TestNode** root) } -static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) -{ - int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; - UCollationResult compareResult, keyResult, incResult; - uint8_t *sortKey1, *sortKey2; - - compareResult = ucol_strcoll(myCollation, source, u_strlen(source), target, u_strlen(target)); - incResult = ctst_strcollTestIncremental(myCollation, source, u_strlen(source), target, u_strlen(target)); - - sortklen1=ucol_getSortKey(myCollation, source, u_strlen(source), NULL, 0); - sortklen2=ucol_getSortKey(myCollation, target, u_strlen(target), NULL, 0); - - sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2); - sortklenmin = (sortklen1 0) - keyResult= UCOL_GREATER; - else - keyResult = UCOL_EQUAL; - reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, incResult, result ); - free(sortKey1); - free(sortKey2); -} static void TestTertiary( ) { diff --git a/icu4c/source/test/cintltst/cfrtst.h b/icu4c/source/test/cintltst/cfrtst.h index 67e783c874f..417c34e632e 100644 --- a/icu4c/source/test/cintltst/cfrtst.h +++ b/icu4c/source/test/cintltst/cfrtst.h @@ -27,9 +27,6 @@ #define MAX_TOKEN_LEN 128 - /*main test routine, tests comparisons for a set of strings against sets of expected results*/ - static void doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result); - /* performs Extra tests*/ static void TestExtra(void); diff --git a/icu4c/source/test/cintltst/cg7coll.c b/icu4c/source/test/cintltst/cg7coll.c index 04390877ab2..b94248defa5 100644 --- a/icu4c/source/test/cintltst/cg7coll.c +++ b/icu4c/source/test/cintltst/cg7coll.c @@ -43,6 +43,7 @@ #include "cintltst.h" #include "cg7coll.h" #include "ccolltst.h" +#include "callcoll.h" #include "unicode/ustring.h" @@ -160,38 +161,6 @@ void addRuleBasedCollTest(TestNode** root) } -static void doTest(UCollator *myCollation, const UChar source[], const UChar target[], UCollationResult result) -{ - int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; - UCollationResult compareResult, keyResult, incResult; - uint8_t *sortKey1, *sortKey2; - - compareResult = ucol_strcoll(myCollation, source, u_strlen(source), target, u_strlen(target)); - incResult = ctst_strcollTestIncremental(myCollation, source, u_strlen(source), target, u_strlen(target)); - - sortklen1=ucol_getSortKey(myCollation, source, u_strlen(source), NULL, 0); - sortklen2=ucol_getSortKey(myCollation, target, u_strlen(target), NULL, 0); - - sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2); - sortklenmin = (sortklen1 0) keyResult= UCOL_GREATER; - else keyResult = UCOL_EQUAL; - reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, incResult, result ); - free(sortKey1); - free(sortKey2); -} - static void TestG7Locales() { UCollator *myCollation, *tblColl1; diff --git a/icu4c/source/test/cintltst/cg7coll.h b/icu4c/source/test/cintltst/cg7coll.h index 60aeb428a84..13101c201de 100644 --- a/icu4c/source/test/cintltst/cg7coll.h +++ b/icu4c/source/test/cintltst/cg7coll.h @@ -45,10 +45,7 @@ #define FIXEDTESTSET 15 #define TOTALTESTSET 30 - - /* main test routine, tests comparisons for a set of strings against sets of expected results */ - static void doTest(UCollator *myCollation, const UChar* source, const UChar* target, UCollationResult result); - + /* perform test for G7 locales */ static void TestG7Locales(void); diff --git a/icu4c/source/test/cintltst/cjaptst.c b/icu4c/source/test/cintltst/cjaptst.c index 18deba4d9e2..babf4c5244e 100644 --- a/icu4c/source/test/cintltst/cjaptst.c +++ b/icu4c/source/test/cintltst/cjaptst.c @@ -24,6 +24,7 @@ #include "unicode/uloc.h" #include "cintltst.h" #include "ccolltst.h" +#include "callcoll.h" #include "cjaptst.h" #include "unicode/ustring.h" #include "string.h" @@ -79,41 +80,6 @@ void addKannaCollTest(TestNode** root) } -static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) -{ - int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; - UCollationResult compareResult, keyResult, incResult; - uint8_t *sortKey1, *sortKey2; - - compareResult = ucol_strcoll(myCollation, source, u_strlen(source), target, u_strlen(target)); - incResult = ctst_strcollTestIncremental(myCollation, source, u_strlen(source), target, u_strlen(target)); - - sortklen1=ucol_getSortKey(myCollation, source, u_strlen(source), NULL, 0); - sortklen2=ucol_getSortKey(myCollation, target, u_strlen(target), NULL, 0); - - sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2); - sortklenmin = (sortklen1 0) - keyResult= UCOL_GREATER; - else - keyResult = UCOL_EQUAL; - reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, incResult, result ); - free(sortKey1); - free(sortKey2); -} - static void TestTertiary( ) { diff --git a/icu4c/source/test/cintltst/cjaptst.h b/icu4c/source/test/cintltst/cjaptst.h index d4678be7687..603eabdd36d 100644 --- a/icu4c/source/test/cintltst/cjaptst.h +++ b/icu4c/source/test/cintltst/cjaptst.h @@ -28,11 +28,7 @@ #define MAX_TOKEN_LEN 128 - /*main test routine, tests comparisons for a set of strings against sets of expected results*/ - static void doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result); - - - /*perform test with strength TERTIARY*/ + /*perform test with strength TERTIARY*/ static void TestTertiary(void); diff --git a/icu4c/source/test/cintltst/cmsccoll.c b/icu4c/source/test/cintltst/cmsccoll.c index 0b1cf6c947c..3e244d01851 100644 --- a/icu4c/source/test/cintltst/cmsccoll.c +++ b/icu4c/source/test/cintltst/cmsccoll.c @@ -22,6 +22,7 @@ #include "cintltst.h" #include "cdetst.h" #include "ccolltst.h" +#include "callcoll.h" #include "unicode/ustring.h" #include "string.h" @@ -112,36 +113,3 @@ void addMiscCollTest(TestNode** root) } - -static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) -{ - int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; - UCollationResult compareResult, keyResult, incResult; - uint8_t *sortKey1, *sortKey2; - - compareResult = ucol_strcoll(myCollation, source, u_strlen(source), target, u_strlen(target)); - incResult = ctst_strcollTestIncremental(myCollation, source, u_strlen(source), target, u_strlen(target)); - - sortklen1=ucol_getSortKey(myCollation, source, u_strlen(source), NULL, 0); - sortklen2=ucol_getSortKey(myCollation, target, u_strlen(target), NULL, 0); - - sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2); - sortklenmin = (sortklen1 0) keyResult= UCOL_GREATER; - else keyResult = UCOL_EQUAL; - reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, incResult, result ); - free(sortKey1); - free(sortKey2); -} - diff --git a/icu4c/source/test/cintltst/cturtst.c b/icu4c/source/test/cintltst/cturtst.c index 2b5b7b9d88c..8f381d2e850 100644 --- a/icu4c/source/test/cintltst/cturtst.c +++ b/icu4c/source/test/cintltst/cturtst.c @@ -24,6 +24,7 @@ #include "unicode/uloc.h" #include "cintltst.h" #include "ccolltst.h" +#include "callcoll.h" #include "cturtst.h" #include "unicode/ustring.h" #include "string.h" @@ -83,38 +84,6 @@ void addTurkishCollTest(TestNode** root) } -static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) -{ - int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; - UCollationResult compareResult, keyResult, incResult; - uint8_t *sortKey1, *sortKey2; - - compareResult = ucol_strcoll(myCollation, source, u_strlen(source), target, u_strlen(target)); - incResult = ctst_strcollTestIncremental(myCollation, source, u_strlen(source), target, u_strlen(target)); - - sortklen1=ucol_getSortKey(myCollation, source, u_strlen(source), NULL, 0); - sortklen2=ucol_getSortKey(myCollation, target, u_strlen(target), NULL, 0); - - sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2); - sortklenmin = (sortklen1 0) keyResult= UCOL_GREATER; - else keyResult = UCOL_EQUAL; - reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, incResult, result ); - free(sortKey1); - free(sortKey2); -} - static void TestTertiary( ) { diff --git a/icu4c/source/test/cintltst/cturtst.h b/icu4c/source/test/cintltst/cturtst.h index e0650ce5de2..d23673eea08 100644 --- a/icu4c/source/test/cintltst/cturtst.h +++ b/icu4c/source/test/cintltst/cturtst.h @@ -27,9 +27,6 @@ #define MAX_TOKEN_LEN 128 - /* main test routine, tests comparisons for a set of strings against sets of expected results */ - static void doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result); - /*perform test with strength PRIMARY */ static void TestPrimary(void); /* perform test with strength TERTIARY */ diff --git a/icu4c/source/test/cintltst/encoll.c b/icu4c/source/test/cintltst/encoll.c index d8ff89b44bf..c04896e8bfc 100644 --- a/icu4c/source/test/cintltst/encoll.c +++ b/icu4c/source/test/cintltst/encoll.c @@ -26,6 +26,7 @@ #include "cintltst.h" #include "encoll.h" #include "ccolltst.h" +#include "callcoll.h" #include "unicode/ustring.h" static UCollator *myCollation = NULL; @@ -254,38 +255,6 @@ void addEnglishCollTest(TestNode** root) } -static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) -{ - int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; - int32_t temp; - UCollationResult compareResult, keyResult, incResult; - uint8_t *sortKey1, *sortKey2; - - compareResult = ucol_strcoll(myCollation, source, u_strlen(source), target, u_strlen(target)); - incResult = ctst_strcollTestIncremental(myCollation, source, u_strlen(source), target, u_strlen(target)); - - sortklen1=ucol_getSortKey(myCollation, source, u_strlen(source), NULL, 0); - sortklen2=ucol_getSortKey(myCollation, target, u_strlen(target), NULL, 0); - - sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2); - sortklenmin = (sortklen1 0) keyResult= UCOL_GREATER; - else keyResult = UCOL_EQUAL; - reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, incResult, result ); - free(sortKey1); - free(sortKey2); -} - static void TestTertiary( ) { int32_t testMoreSize; diff --git a/icu4c/source/test/cintltst/encoll.h b/icu4c/source/test/cintltst/encoll.h index 2b153fb4836..8e33a5ea230 100644 --- a/icu4c/source/test/cintltst/encoll.h +++ b/icu4c/source/test/cintltst/encoll.h @@ -26,10 +26,6 @@ #define MAX_TOKEN_LEN 128 - - /* main test routine, tests comparisons for a set of strings against sets of expected results */ -static void doTest( UCollator*, const UChar source[], const UChar target[], UCollationResult result); - /* performs test with strength PRIMARY */ static void TestPrimary(void); diff --git a/icu4c/source/test/cintltst/nucnvtst.c b/icu4c/source/test/cintltst/nucnvtst.c index 431937310b8..d147a631bbf 100644 --- a/icu4c/source/test/cintltst/nucnvtst.c +++ b/icu4c/source/test/cintltst/nucnvtst.c @@ -1821,7 +1821,7 @@ TestSmallTargetBuffer(const uint16_t* source, const UChar* sourceLimit,UConverte UChar *uBuf,*test; int32_t uBufSize = 120; int len=0; - int i=1; + int i=2; UErrorCode errorCode=U_ZERO_ERROR; uBuf = (UChar*)malloc(uBufSize * sizeof(UChar)*5); cBuf =(char*)malloc(uBufSize * sizeof(char) * 10); @@ -1937,7 +1937,7 @@ static void TestSmallSourceBuffer(const uint16_t* source, const UChar* sourceLim UChar *uBuf,*test; int32_t uBufSize = 120; int len=0; - int i=1; + int i=2; const UChar *temp = sourceLimit; UErrorCode errorCode=U_ZERO_ERROR; uBuf = (UChar*)malloc(uBufSize * sizeof(UChar)*5);