+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
-* Copyright (C) 2000-2011, International Business Machines
+* Copyright (C) 2000-2016, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
#include "cmemory.h"
#include "transrt.h"
#include "testutil.h"
+#include "uassert.h"
#include <string.h>
#include <stdio.h>
break;
case U_TITLECASE_LETTER:
if (haveLower) return TRUE;
- // drop through, since second letter is lower.
+ // fall through, since second letter is lower.
+ U_FALLTHROUGH;
case U_LOWERCASE_LETTER:
haveLower = TRUE;
break;
UBool isError = FALSE;
int32_t destIdx = 0;
U8_APPEND(bufForOneChar, destIdx, (int32_t)sizeof(bufForOneChar), c, isError);
+ U_ASSERT(!isError);
fwrite(bufForOneChar, 1, destIdx, out);
}
}
void TransliteratorRoundTripTest::TestGreek() {
-
- // CLDR bug #1911: This test should be moved into CLDR.
+ logKnownIssue( "cldrbug:1911");
// It is left in its current state as a regression test.
-
-// if (isICUVersionAtLeast(ICU_39)) {
-// // We temporarily filter against Unicode 4.1, but we only do this
-// // before version 3.4.
-// errln("FAIL: TestGreek needs to be updated to remove delete the [:Age=4.0:] filter ");
-// return;
-// } else {
-// logln("Warning: TestGreek needs to be updated to remove delete the section marked [:Age=4.0:] filter");
-// }
-
+
RTTest test("Latin-Greek");
LegalGreek *legal = new LegalGreek(TRUE);
void TransliteratorRoundTripTest::TestGreekUNGEGN() {
-
- // CLDR bug #1911: This test should be moved into CLDR.
+ logKnownIssue( "cldrbug:1911");
// It is left in its current state as a regression test.
-// if (isICUVersionAtLeast(ICU_39)) {
-// // We temporarily filter against Unicode 4.1, but we only do this
-// // before version 3.4.
-// errln("FAIL: TestGreek needs to be updated to remove delete the [:Age=4.0:] filter ");
-// return;
-// } else {
-// logln("Warning: TestGreek needs to be updated to remove delete the section marked [:Age=4.0:] filter");
-// }
-
RTTest test("Latin-Greek/UNGEGN");
LegalGreek *legal = new LegalGreek(FALSE);
}
void TransliteratorRoundTripTest::Testel() {
-
- // CLDR bug #1911: This test should be moved into CLDR.
+ logKnownIssue( "cldrbug:1911");
// It is left in its current state as a regression test.
-// if (isICUVersionAtLeast(ICU_39)) {
-// // We temporarily filter against Unicode 4.1, but we only do this
-// // before version 3.4.
-// errln("FAIL: TestGreek needs to be updated to remove delete the [:Age=4.0:] filter ");
-// return;
-// } else {
-// logln("Warning: TestGreek needs to be updated to remove delete the section marked [:Age=4.0:] filter");
-// }
-
RTTest test("Latin-el");
LegalGreek *legal = new LegalGreek(FALSE);
return TRUE;
}
void TransliteratorRoundTripTest::TestHebrew() {
- // CLDR bug #1911: This test should be moved into CLDR.
+ logKnownIssue( "cldrbug:1911");
// It is left in its current state as a regression test.
-// if (isICUVersionAtLeast(ICU_39)) {
-// // We temporarily filter against Unicode 4.1, but we only do this
-// // before version 3.4.
-// errln("FAIL: TestHebrew needs to be updated to remove delete the [:Age=4.0:] filter ");
-// return;
-// } else {
-// logln("Warning: TestHebrew needs to be updated to remove delete the section marked [:Age=4.0:] filter");
-// }
+
//long start = System.currentTimeMillis();
UErrorCode error = U_ZERO_ERROR;
LegalHebrew* legal = new LegalHebrew(error);
}
RTTest test("Latin-Devanagari");
Legal *legal = new LegalIndic();
- // CLDR bug #1911: This test should be moved into CLDR.
+ logKnownIssue( "cldrbug:1911");
// It is left in its current state as a regression test.
-// if (isICUVersionAtLeast(ICU_39)) {
-// // We temporarily filter against Unicode 4.1, but we only do this
-// // before version 3.4.
-// errln("FAIL: TestDevanagariLatin needs to be updated to remove delete the [:Age=4.1:] filter ");
-// return;
-// } else {
-// logln("Warning: TestDevanagariLatin needs to be updated to remove delete the section marked [:Age=4.1:] filter");
-// }
+
test.test(UnicodeString(latinForIndic, ""),
UnicodeString("[[[:Devanagari:][\\u094d][\\u0964\\u0965]]&[:Age=4.1:]-[\\u0970]]", ""), "[\\u0965\\u0904]", this, quick,
legal, 50);
void TransliteratorRoundTripTest::TestInterIndic() {
//TestDebug("Latin-Gurmukhi", latinForIndic, "[:Gurmukhi:]","[\\u0965\\u0a02\\u0a72\\u0a73\\u0a74]",TRUE);
- int32_t num = (int32_t)(sizeof(interIndicArray)/(INTER_INDIC_ARRAY_WIDTH*sizeof(char*)));
+ int32_t num = UPRV_LENGTHOF(interIndicArray)/INTER_INDIC_ARRAY_WIDTH;
if(quick){
logln("Testing only 5 of %i. Skipping rest (use -e for exhaustive)",num);
num = 5;
}
- // CLDR bug #1911: This test should be moved into CLDR.
- // It is left in its current state as a regression test.
-// if (isICUVersionAtLeast(ICU_39)) {
-// // We temporarily filter against Unicode 4.1, but we only do this
-// // before version 3.4.
-// errln("FAIL: TestInterIndic needs to be updated to remove delete the [:Age=4.1:] filter ");
-// return;
-// } else {
-// logln("Warning: TestInterIndic needs to be updated to remove delete the section marked [:Age=4.1:] filter");
-// }
for(int i = 0; i < num;i++){
RTTest test(interIndicArray[i*INTER_INDIC_ARRAY_WIDTH + 0]);
Legal *legal = new LegalIndic();
logln(UnicodeString("Stress testing ") + interIndicArray[i*INTER_INDIC_ARRAY_WIDTH + 0]);
- /* Uncomment lines below when transliterator is fixed */
- /*
+ if( !logKnownIssue( "cldrbug:1911" ) ) {
+ /* "full test" */
+ // CLDR bug #1911: This test should be moved into CLDR.
test.test( interIndicArray[i*INTER_INDIC_ARRAY_WIDTH + 1],
interIndicArray[i*INTER_INDIC_ARRAY_WIDTH + 2],
interIndicArray[i*INTER_INDIC_ARRAY_WIDTH + 3], // roundtrip exclusions
this, quick, legal, 50);
- */
- /* comment lines below when transliterator is fixed */
+ } else {
+ // It is left in its current state as a regression test.
+ // CLDR should test, and remove the age filter.
+ /* regression test - ""temporary"" until CLDR#1911 is fixed */
// start
UnicodeString source("[");
source.append(interIndicArray[i*INTER_INDIC_ARRAY_WIDTH + 1]);
UnicodeString target("[");
target.append(interIndicArray[i*INTER_INDIC_ARRAY_WIDTH + 2]);
target.append(" & [:Age=4.1:]]");
- test.test( source,
- target,
+ test.test( source,
+ target,
interIndicArray[i*INTER_INDIC_ARRAY_WIDTH + 3], // roundtrip exclusions
this, quick, legal, 50);
// end
delete legal;
+ }
}
}