also, delete trailing whitespace.
X-SVN-Rev: 34347
uprv_strcmp("zh", locName)==0 ||
uprv_strcmp("zh_Hant", locName)==0
) {
- log_verbose("Don't know how to test %s. "
- "TODO: Fix ticket #6040 and reenable RamsRulesTest for this locale.\n", locName);
+ if(log_knownIssue("6040", NULL)) {
+ log_verbose("Can't test %s - TODO: Fix ticket #6040 and reenable RamsRulesTest for this locale.\n", locName);
continue;
+ }
}
log_verbose("Testing locale %s\n", locName);
status = U_ZERO_ERROR;
doTestOneTestCase(fiStdTests, LEN(fiStdTests), fiStdRules, LEN(fiStdRules));
doTestOneTestCase(fiEorTests, LEN(fiEorTests), eorFiStdRules, LEN(eorFiStdRules));
+ log_knownIssue("8962", NULL);
/* TODO: Fix ICU ticket #8962 by uncommenting the following test after fi.txt is updated with the following rule:
eor{
Sequence{
UBool IntlTest::printKnownIssues()
{
if(knownList != NULL) {
- udbg_knownIssue_print(knownList, NULL);
+ udbg_knownIssue_print(knownList);
udbg_knownIssue_close(knownList);
return TRUE;
} else {
doTest(formatter, testData, TRUE);
#if !UCONFIG_NO_COLLATION
- /* Skipping this test until #9503 is fixed.
- formatter->setLenient(TRUE);
- static const char* lpTestData[][2] = {
+ if( !logKnownIssue("9503") ) {
+ formatter->setLenient(TRUE);
+ static const char* lpTestData[][2] = {
{ "fifty-7", "57" },
{ " fifty-7", "57" },
{ " fifty-7", "57" },
{ "fifteen hundred and zero", "1,500" },
{ "FOurhundred thiRTY six", "436" },
{ NULL, NULL}
- };
- doLenientParseTest(formatter, lpTestData);
- */
+ };
+ doLenientParseTest(formatter, lpTestData);
+ }
#endif
}
delete formatter;
/*
**********************************************************************
-* Copyright (C) 2000-2011, International Business Machines
+* Copyright (C) 2000-2013, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
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);
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;
+ }
}
}
ON_LINE=FALSE; /* just in case */
if(knownList != NULL) {
- if( udbg_knownIssue_print(knownList, NULL) ) {
+ if( udbg_knownIssue_print(knownList) ) {
fprintf(stdout, "(To run suppressed tests, use the -K option.) \n\n");
}
udbg_knownIssue_close(knownList);
static UBool vlog_knownIssue(const char *ticket, const char *pattern, va_list ap)
{
- char buf[2048], url[1024];
+ char buf[2048];
UBool firstForTicket;
UBool firstForWhere;
#include "putilimp.h"
#include "unicode/ulocdata.h"
#include "unicode/ucnv.h"
+#include "unicode/unistr.h"
/*
-To add a new enum type
+To add a new enum type
(For example: UShoeSize with values USHOE_WIDE=0, USHOE_REGULAR, USHOE_NARROW, USHOE_COUNT)
1. udbgutil.h: add UDBG_UShoeSize to the UDebugEnumType enum before UDBG_ENUM_COUNT
( The subsequent steps involve this file, udbgutil.cpp )
2. Find the marker "Add new enum types above this line"
3. Before that marker, add a #include of any header file you need.
- 4. Each enum type has three things in this section: a #define, a count_, and an array of Fields.
+ 4. Each enum type has three things in this section: a #define, a count_, and an array of Fields.
It may help to copy and paste a previous definition.
5. In the case of the USHOE_... strings above, "USHOE_" is common to all values- six characters
- " #define LEN_USHOE 6 "
+ " #define LEN_USHOE 6 "
6 characters will strip off "USHOE_" leaving enum values of WIDE, REGULAR, and NARROW.
- 6. Define the 'count_' variable, with the number of enum values. If the enum has a _MAX or _COUNT value,
+ 6. Define the 'count_' variable, with the number of enum values. If the enum has a _MAX or _COUNT value,
that can be helpful for automatically defining the count. Otherwise define it manually.
" static const int32_t count_UShoeSize = USHOE_COUNT; "
7. Define the field names, in order.
" static const Field names_UShoeSize[] = {
- " FIELD_NAME_STR( LEN_USHOE, USHOE_WIDE ),
- " FIELD_NAME_STR( LEN_USHOE, USHOE_REGULAR ),
- " FIELD_NAME_STR( LEN_USHOE, USHOE_NARROW ),
+ " FIELD_NAME_STR( LEN_USHOE, USHOE_WIDE ),
+ " FIELD_NAME_STR( LEN_USHOE, USHOE_REGULAR ),
+ " FIELD_NAME_STR( LEN_USHOE, USHOE_NARROW ),
" };
( The following command was usedfor converting ucol.h into partially correct entities )
- grep "^[ ]*UCOL" < unicode/ucol.h |
- sed -e 's%^[ ]*\([A-Z]*\)_\([A-Z_]*\).*% FIELD_NAME_STR( LEN_\1, \1_\2 ),%g'
+ grep "^[ ]*UCOL" < unicode/ucol.h |
+ sed -e 's%^[ ]*\([A-Z]*\)_\([A-Z_]*\).*% FIELD_NAME_STR( LEN_\1, \1_\2 ),%g'
8. Now, a bit farther down, add the name of the enum itself to the end of names_UDebugEnumType
( UDebugEnumType is an enum, too!)
- names_UDebugEnumType[] { ...
+ names_UDebugEnumType[] { ...
" FIELD_NAME_STR( LEN_UDBG, UDBG_UShoeSize ), "
9. Find the function _udbg_enumCount and add the count macro:
" COUNT_CASE(UShoeSize)
// 'UCAL_' = 5
#define LEN_UCAL 5 /* UCAL_ */
static const int32_t count_UCalendarDateFields = UCAL_FIELD_COUNT;
-static const Field names_UCalendarDateFields[] =
+static const Field names_UCalendarDateFields[] =
{
FIELD_NAME_STR( LEN_UCAL, UCAL_ERA ),
FIELD_NAME_STR( LEN_UCAL, UCAL_YEAR ),
static const int32_t count_UCalendarMonths = UCAL_UNDECIMBER+1;
-static const Field names_UCalendarMonths[] =
+static const Field names_UCalendarMonths[] =
{
FIELD_NAME_STR( LEN_UCAL, UCAL_JANUARY ),
FIELD_NAME_STR( LEN_UCAL, UCAL_FEBRUARY ),
#define LEN_UDAT 5 /* "UDAT_" */
static const int32_t count_UDateFormatStyle = UDAT_SHORT+1;
-static const Field names_UDateFormatStyle[] =
+static const Field names_UDateFormatStyle[] =
{
FIELD_NAME_STR( LEN_UDAT, UDAT_FULL ),
FIELD_NAME_STR( LEN_UDAT, UDAT_LONG ),
};
#endif
-
+
#include "unicode/uloc.h"
#define LEN_UAR 12 /* "ULOC_ACCEPT_" */
static const int32_t count_UAcceptResult = 3;
-static const Field names_UAcceptResult[] =
+static const Field names_UAcceptResult[] =
{
FIELD_NAME_STR( LEN_UAR, ULOC_ACCEPT_FAILED ),
FIELD_NAME_STR( LEN_UAR, ULOC_ACCEPT_VALID ),
#define LEN_UDBG 5 /* "UDBG_" */
static const int32_t count_UDebugEnumType = UDBG_ENUM_COUNT;
-static const Field names_UDebugEnumType[] =
+static const Field names_UDebugEnumType[] =
{
FIELD_NAME_STR( LEN_UDBG, UDBG_UDebugEnumType ),
#if !UCONFIG_NO_FORMATTING
}
const char * udbg_enumName(UDebugEnumType type, int32_t field) {
- if(field<0 ||
+ if(field<0 ||
field>=_udbg_enumCount(type,FALSE)) { // also will catch unsupported items
return NULL;
} else {
}
int32_t udbg_enumArrayValue(UDebugEnumType type, int32_t field) {
- if(field<0 ||
+ if(field<0 ||
field>=_udbg_enumCount(type,FALSE)) { // also will catch unsupported items
return -1;
} else {
} else {
return fields[field].num;
}
- }
+ }
}
int32_t udbg_enumByName(UDebugEnumType type, const char *value) {
for(int32_t field = 0;field<_udbg_enumCount(type, FALSE);field++) {
if(!strcmp(value, fields[field].str + fields[field].prefix)) {
return fields[field].num;
- }
+ }
}
// try with the prefix
for(int32_t field = 0;field<_udbg_enumCount(type, FALSE);field++) {
if(!strcmp(value, fields[field].str)) {
return fields[field].num;
- }
+ }
}
// fail
return -1;
}
/* platform info */
-/**
- * Print the current platform
+/**
+ * Print the current platform
*/
U_CAPI const char *udbg_getPlatform(void)
{
static const char *nullString = "(null)";
static int32_t stringToStringBuffer(char *target, int32_t targetCapacity, const char *str, UErrorCode *status) {
- if(str==NULL) str=nullString;
+ if(str==NULL) str=nullString;
int32_t len = uprv_strlen(str);
if (U_SUCCESS(*status)) {
UChar buf[100];
char buf2[100];
int32_t len;
-
+
len = ucal_getDefaultTimeZone(buf, 100, status);
if(U_SUCCESS(*status)&&len>0) {
u_UCharsToChars(buf, buf2, len+1);
{ "icudata.path", paramIcudataPath, NULL, 0},
{ "cldr.version", paramCldrVersion, NULL, 0},
-
+
#if !UCONFIG_NO_FORMATTING
{ "tz.version", paramTimezoneVersion, NULL, 0},
{ "tz.default", paramTimezoneDefault, NULL, 0},
#endif
-
+
{ "cpu.bits", paramInteger, "d", (sizeof(void*))*8},
{ "cpu.big_endian", paramInteger, "b", U_IS_BIG_ENDIAN},
{ "os.wchar_width", paramInteger, "d", U_SIZEOF_WCHAR_T},
return (void*)warning;
}
-U_CAPI UBool udbg_knownIssue_print(void *ptr, FILE *output) {
+U_CAPI UBool udbg_knownIssue_print(void *ptr) {
puts(warning);
return FALSE;
}
~KnownIssues();
void add(const char *ticket, const char *where, const UChar *msg, UBool *firstForTicket, UBool *firstForWhere);
void add(const char *ticket, const char *where, const char *msg, UBool *firstForTicket, UBool *firstForWhere);
- UBool print(FILE *output) ;
+ UBool print();
private:
- std::map< std::string,
+ std::map< std::string,
std::map < std::string, std::set < std::string > > > fTable;
};
fTable[ticket][where].insert(str);
}
-UBool KnownIssues::print(FILE *output)
+UBool KnownIssues::print()
{
if(fTable.empty()) {
return FALSE;
return static_cast<void*>(t);
}
-U_CAPI UBool udbg_knownIssue_print(void *ptr, FILE *output) {
+U_CAPI UBool udbg_knownIssue_print(void *ptr) {
KnownIssues *t = static_cast<KnownIssues*>(ptr);
if(t==NULL) {
return FALSE;
} else {
- t->print(output);
+ t->print();
return TRUE;
}
}
UDBG_UPlugReason, /* Count = UPLUG_REASON_COUNT */
UDBG_UPlugLevel, /* COUNT = UPLUG_LEVEL_COUNT */
UDBG_UAcceptResult, /* Count = ULOC_ACCEPT_FALLBACK+1=3 */
-
- /* All following enums may be discontiguous. */
-
+
+ /* All following enums may be discontiguous. */
+
#if !UCONFIG_NO_COLLATION
UDBG_UColAttributeValue, /* UCOL_ATTRIBUTE_VALUE_COUNT */
#endif
/**
* @param type the type of enum
- * Print how many enums are contained for this type.
+ * Print how many enums are contained for this type.
* Should be equal to the appropriate _COUNT constant or there is an error. Return -1 if unsupported.
*/
U_CAPI int32_t U_EXPORT2 udbg_enumCount(UDebugEnumType type);
/**
* for consistency checking
* @param type the type of enum
- * Print how many enums should be contained for this type.
+ * Print how many enums should be contained for this type.
* This is equal to the appropriate _COUNT constant or there is an error. Returns -1 if unsupported.
*/
U_CAPI int32_t U_EXPORT2 udbg_enumExpectedCount(UDebugEnumType type);
/**
- * For consistency checking, returns the expected enum ordinal value for the given index value.
+ * For consistency checking, returns the expected enum ordinal value for the given index value.
* @param type which type
* @param field field number
* @return should be equal to 'field' or -1 if out of range.
U_CAPI int32_t U_EXPORT2 udbg_enumArrayValue(UDebugEnumType type, int32_t field);
/**
- * Locate the specified field value by name.
+ * Locate the specified field value by name.
* @param type which type
* @param name name of string (case sensitive)
* @return should be a field value or -1 if not found.
UBool *firstForWhere);
/**
- * Print 'known issue' table.
+ * Print 'known issue' table, to std::cout.
* @param ptr pointer from udbg_knownIssue
- * @param output file to print to
* @return TRUE if there were any issues.
*/
-U_CAPI UBool udbg_knownIssue_print(void *ptr, FILE *output);
+U_CAPI UBool udbg_knownIssue_print(void *ptr);
/**
* Close 'known issue' table.