Compared with cintltst and commented away tests that are not tested.
Added necessary attributes to the French collation test.

X-SVN-Rev: 3628
This commit is contained in:
Syn Wee Quek 2001-02-15 01:44:15 +00:00
parent 1d15c0c65a
commit b35e4607a1
3 changed files with 85 additions and 30 deletions

View file

@ -4,6 +4,13 @@
* others. All Rights Reserved.
********************************************************************/
/***********************************************************************
* Modification history
* Date Name Description
* 02/14/2001 synwee Added attributes in TestTertiary and
* TestSecondary
***********************************************************************/
#ifndef _COLL
#include "unicode/coll.h"
#endif
@ -182,11 +189,17 @@ void CollationFrenchTest::doTest( UnicodeString source, UnicodeString target, Co
void CollationFrenchTest::TestTertiary(/* char* par */)
{
int32_t i = 0;
UErrorCode status = U_ZERO_ERROR;
myCollation->setStrength(Collator::TERTIARY);
for (i = 0; i < 12 ; i++)
{
doTest(testSourceCases[i], testTargetCases[i], results[i]);
}
myCollation->setAttribute(UCOL_FRENCH_COLLATION, UCOL_ON, status);
myCollation->setAttribute(UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, status);
if (U_FAILURE(status))
errln("Error setting attribute in French collator");
else
for (i = 0; i < 12 ; i++)
{
doTest(testSourceCases[i], testTargetCases[i], results[i]);
}
}
void CollationFrenchTest::TestSecondary(/* char* par */)
@ -195,19 +208,26 @@ void CollationFrenchTest::TestSecondary(/* char* par */)
int32_t i = 0;
int32_t j;
Collator::EComparisonResult expected;
const int32_t testAcuteSize = sizeof(testAcute) / sizeof(testAcute[0]);
for (i = 0; i < testAcuteSize; i++)
UErrorCode status = U_ZERO_ERROR;
myCollation->setAttribute(UCOL_FRENCH_COLLATION, UCOL_ON, status);
if (U_FAILURE(status))
errln("Error setting attribute in French collator");
else
{
for (j = 0; j < testAcuteSize; j++)
{
if (i < j)
expected = Collator::LESS;
else if (i == j)
expected = Collator::EQUAL;
else // (i > j)
expected = Collator::GREATER;
doTest(testAcute[i], testAcute[j], expected );
}
const int32_t testAcuteSize = sizeof(testAcute) / sizeof(testAcute[0]);
for (i = 0; i < testAcuteSize; i++)
{
for (j = 0; j < testAcuteSize; j++)
{
if (i < j)
expected = Collator::LESS;
else if (i == j)
expected = Collator::EQUAL;
else // (i > j)
expected = Collator::GREATER;
doTest(testAcute[i], testAcute[j], expected );
}
}
}
}

View file

@ -8,6 +8,12 @@
* MajorTestLevel is the top level test class for everything in the directory "IntlWork".
*/
/***********************************************************************
* Modification history
* Date Name Description
* 02/14/2001 synwee Release collation for testing.
***********************************************************************/
#include "unicode/utypes.h"
#include "itmajor.h"
@ -34,10 +40,8 @@ void MajorTestLevel::runIndexedTest( int32_t index, UBool exec, const char* &nam
if (exec) {
logln("TestSuite Collator----"); logln();
logln("Is currently not being executed---");
/* WEIVTODO: return collation here */
//TODO: this should work
//IntlTestCollator test;
//callTest( test, par );
IntlTestCollator test;
callTest( test, par );
}
break;

View file

@ -8,6 +8,13 @@
* IntlTestCollator is the medium level test class for everything in the directory "collate".
*/
/***********************************************************************
* Modification history
* Date Name Description
* 02/14/2001 synwee Compare with cintltst and commented away tests
* that are not run.
***********************************************************************/
#include "unicode/utypes.h"
#include "tscoll.h"
@ -111,10 +118,13 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n
if (exec)
{
logln("CollationFinnishtest---");
logln("");
logln("Temporary removed");
/*
synwee TODO
CollationFinnishTest test;
callTest( test, par );
callTest( test, par );
*/
}
break;
@ -124,7 +134,7 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n
if (exec)
{
logln("CollationKanatest---");
logln("");
logln("Temporary removed");
CollationKanaTest test;
callTest( test, par );
@ -150,10 +160,13 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n
if (exec)
{
logln("CollationDummyTest---");
logln("");
logln("Temporary removed");
/*
synwee TODO
CollationDummyTest test;
callTest( test, par );
*/
}
break;
@ -163,10 +176,13 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n
if (exec)
{
logln("G7CollationTest---");
logln("");
logln("Temporary removed");
/*
synwee TODO
G7CollationTest test;
callTest( test, par );
*/
}
break;
@ -176,10 +192,13 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n
if (exec)
{
logln("CollationMonkeyTest---");
logln("");
logln("Temporary removed");
/*
synwee TODO
CollationMonkeyTest test;
callTest( test, par );
*/
}
break;
@ -202,10 +221,13 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n
if (exec)
{
logln("CollationRegressionTest---");
logln("");
logln("Temporary removed");
/*
synwee TODO
CollationRegressionTest test;
callTest( test, par );
*/
}
break;
@ -228,10 +250,13 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n
if (exec)
{
logln("CollationIteratorTest---");
logln("");
logln("Temporary removed");
/*
synwee TODO
CollationIteratorTest test;
callTest( test, par );
*/
}
break;
@ -247,7 +272,8 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n
case 16: */
name = "BasicNormalizerTest";
if (exec) {
logln("BasicNormalizerTest---"); logln("");
logln("BasicNormalizerTest---");
logln("");
BasicNormalizerTest test;
callTest( test, par );
}
@ -265,9 +291,14 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n
case 17:
name = "CollationThaiTest";
if (exec) {
logln("CollationThaiTest---"); logln("");
logln("CollationThaiTest---");
logln("Temporary removed");
/*
synwee TODO
CollationThaiTest test;
callTest( test, par );
*/
}
break;