ICU-9744 remove timebomb code, update docs for logKnownIssue and log_knownIssue

X-SVN-Rev: 34341
This commit is contained in:
Steven R. Loomis 2013-09-17 00:55:39 +00:00
parent dcd43f9055
commit 76fce4a987
9 changed files with 54 additions and 119 deletions

View file

@ -689,31 +689,5 @@ U_CFUNC UBool assertEquals(const char* message, const char* expected,
#endif
return TRUE;
}
/*--------------------------------------------------------------------
* Time bomb - allows temporary behavior that expires at a given
* release
*--------------------------------------------------------------------
*/
U_CFUNC UBool isICUVersionBefore(int major, int minor, int milli) {
log_knownIssue("9744", "fix call to isICUVersionBefore()");
return TRUE;
/*
UVersionInfo iv;
UVersionInfo ov;
ov[0] = (uint8_t)major;
ov[1] = (uint8_t)minor;
ov[2] = (uint8_t)milli;
ov[3] = 0;
u_getVersion(iv);
return uprv_memcmp(iv, ov, U_MAX_VERSION_LENGTH) < 0;
*/
}
U_CFUNC UBool isICUVersionAtLeast(int major, int minor, int milli) {
log_knownIssue("9744", "fix call to isICUVersionAtLeast()");
return FALSE;
//return !isICUVersionBefore(major, minor, milli);
}
#endif

View file

@ -132,17 +132,9 @@ U_CFUNC UBool assertTrue(const char* msg, int condition);
U_CFUNC UBool assertEquals(const char* msg, const char* expectedString,
const char* actualString);
/**
* Returns true if u_getVersion() < major.minor.milli.
* @deprecated use log_KnownIssue
/*
* note - isICUVersionBefore and isICUVersionAtLeast have been removed.
* use log_knownIssue() instead.
*/
U_CFUNC UBool isICUVersionBefore(int major, int minor, int milli);
/**
* Returns true if u_getVersion() >= major.minor.milli.
* @deprecated use log_KnownIssue
*/
U_CFUNC UBool isICUVersionAtLeast(int major, int minor, int milli);
#endif

View file

@ -995,7 +995,7 @@ static void VerifyTranslation(void) {
log_err("error ures_getStringByIndex(%d) returned %s\n", idx, u_errorName(errorCode));
continue;
}
if (uprv_strstr(currLoc, "uz_Arab") != currLoc || isICUVersionAtLeast(52, 0, 2)) { /* TODO: FIX or REMOVE this test! */
if (uprv_strstr(currLoc, "uz_Arab") != currLoc || !log_knownIssue("10405", "skipping exemplar check: %s", currLoc)) { /* TODO: FIX or REMOVE this test! */
strIdx = findStringSetMismatch(currLoc, fromBundleStr, langSize, mergedExemplarSet, TRUE, &badChar);
if (strIdx >= 0) {
log_err("getDayNames(%s, %d) at index %d returned characters not in the exemplar characters: %04X.\n",
@ -1026,7 +1026,7 @@ static void VerifyTranslation(void) {
log_err("error ures_getStringByIndex(%d) returned %s\n", idx, u_errorName(errorCode));
continue;
}
if (uprv_strstr(currLoc, "uz_Arab") != currLoc || isICUVersionAtLeast(52, 0, 2)) { /* TODO: FIX or REMOVE this test! */
if (uprv_strstr(currLoc, "uz_Arab") != currLoc || !log_knownIssue("10405", "skipping exemplar check: %s", currLoc)) { /* TODO: FIX or REMOVE this test! */
strIdx = findStringSetMismatch(currLoc, fromBundleStr, langSize, mergedExemplarSet, TRUE, &badChar);
if (strIdx >= 0) {
log_err("getMonthNames(%s, %d) at index %d returned characters not in the exemplar characters: %04X.\n",

View file

@ -5211,17 +5211,17 @@ TestTailor6179(void)
}
log_err("\n");
}
if(isICUVersionAtLeast(52, 0, 2)) { /* TODO: debug & fix, see ticket #8982 */
tLen = u_strlen(tData2[1]);
rLen = ucol_getSortKey(coll, tData2[1], tLen, resColl, 100);
if (rLen != LEN(firstSecondaryIgnCE) || uprv_memcmp(resColl, firstSecondaryIgnCE, rLen) != 0) {
if(!log_knownIssue("8982", "debug and fix")) { /* TODO: debug & fix, see ticket #8982 */
tLen = u_strlen(tData2[1]);
rLen = ucol_getSortKey(coll, tData2[1], tLen, resColl, 100);
if (rLen != LEN(firstSecondaryIgnCE) || uprv_memcmp(resColl, firstSecondaryIgnCE, rLen) != 0) {
log_err("Bad result for &[lsi]<<<a...: Data[%d] :%s \tlen: %d key: ", 1, tData2[1], rLen);
for(i = 0; i<rLen; i++) {
log_err(" %02X", resColl[i]);
log_err(" %02X", resColl[i]);
}
log_err("\n");
}
}
}
ucol_close(coll);
}

View file

@ -388,8 +388,9 @@ CalendarLimitTest::doLimitsTest(Calendar& cal,
}
if (v < minActual || v > maxActual) {
// timebomb per #9967, fix with #9972
if ( isICUVersionBefore(52,0,2) && uprv_strcmp(cal.getType(), "dangi") == 0 &&
testMillis >= 1865635198000.0 ) { // Feb 2029 gregorian, end of dangi 4361
if ( uprv_strcmp(cal.getType(), "dangi") == 0 &&
testMillis >= 1865635198000.0 &&
logKnownIssue("9972", "as per #9967")) { // Feb 2029 gregorian, end of dangi 4361
logln((UnicodeString)"Fail: [" + cal.getType() + "] " +
ymdToString(cal, ymd) +
" " + FIELD_NAME[f] + "(" + f + ")=" + v +

View file

@ -1958,23 +1958,6 @@ UBool IntlTest::assertEquals(const UnicodeString& message,
int64_t actual) {
return assertEquals(extractToAssertBuf(message), expected, actual);
}
//--------------------------------------------------------------------
// Time bomb - allows temporary behavior that expires at a given
// release
//--------------------------------------------------------------------
UBool IntlTest::isICUVersionBefore(int major, int minor, int milli) {
UVersionInfo iv;
UVersionInfo ov = { (uint8_t)major, (uint8_t)minor, (uint8_t)milli, 0 };
u_getVersion(iv);
logKnownIssue("9744", "fix call to isICUVersionBefore");
return TRUE;
if( uprv_memcmp(iv, ov, U_MAX_VERSION_LENGTH) < 0 ) {
return FALSE;
} else {
return FALSE;
}
}
#if !UCONFIG_NO_FORMATTING
UBool IntlTest::assertEquals(const UnicodeString& message,

View file

@ -156,8 +156,34 @@ public:
virtual void logln( void );
/**
* Replaces isICUVersionAtLeast and isICUVersionBefore
* log that an issue is known.
* Usually used this way:
* <code>if( ... && logKnownIssue("12345", "some bug")) continue; </code>
* @param ticket ticket string, "12345" or "cldrbug:1234"
* @param message optional message string
* @return true if test should be skipped
*/
UBool logKnownIssue( const char *ticket, const UnicodeString &message );
/**
* Replaces isICUVersionAtLeast and isICUVersionBefore
* log that an issue is known.
* Usually used this way:
* <code>if( ... && logKnownIssue("12345", "some bug")) continue; </code>
* @param ticket ticket string, "12345" or "cldrbug:1234"
* @return true if test should be skipped
*/
UBool logKnownIssue( const char *ticket );
/**
* Replaces isICUVersionAtLeast and isICUVersionBefore
* log that an issue is known.
* Usually used this way:
* <code>if( ... && logKnownIssue("12345", "some bug")) continue; </code>
* @param ticket ticket string, "12345" or "cldrbug:1234"
* @param message optional message string
* @return true if test should be skipped
*/
UBool logKnownIssue( const char *ticket, const char *fmt, ...);
virtual void info( const UnicodeString &message );
@ -167,7 +193,7 @@ public:
virtual void infoln( void );
virtual void err(void);
virtual void err( const UnicodeString &message );
virtual void errln( const UnicodeString &message );
@ -175,7 +201,7 @@ public:
virtual void dataerr( const UnicodeString &message );
virtual void dataerrln( const UnicodeString &message );
void errcheckln(UErrorCode status, const UnicodeString &message );
// convenience functions: sprintf() + errln() etc.
@ -220,32 +246,6 @@ public:
*/
static float random();
/**
* Returns true if u_getVersion() < major.minor.
*/
UBool isICUVersionBefore(int major, int minor) {
return isICUVersionBefore(major, minor, 0);
}
/**
* Returns true if u_getVersion() < major.minor.milli.
*/
UBool isICUVersionBefore(int major, int minor, int milli);
/**
* Returns true if u_getVersion() >= major.minor.
*/
UBool isICUVersionAtLeast(int major, int minor) {
return isICUVersionAtLeast(major, minor, 0);
}
/**
* Returns true if u_getVersion() >= major.minor.milli.
*/
UBool isICUVersionAtLeast(int major, int minor, int milli) {
return !isICUVersionBefore(major, minor, milli);
}
enum { kMaxProps = 16 };
virtual void setProperty(const char* propline);

View file

@ -694,11 +694,6 @@ static void vlog_err(const char *prefix, const char *pattern, va_list ap)
static UBool vlog_knownIssue(const char *ticket, const char *pattern, va_list ap)
{
/* fputs("!", stdout); /\* col 1 - bang *\/ */
/* fprintf(stdout, "%-*s", INDENT_LEVEL,"" ); */
/* if(prefix) { */
/* fputs(prefix, stdout); */
/* } */
char buf[2048], url[1024];
UBool firstForTicket;
UBool firstForWhere;
@ -707,7 +702,8 @@ static UBool vlog_knownIssue(const char *ticket, const char *pattern, va_list ap
if(pattern==NULL) pattern="";
vsprintf(buf, pattern, ap);
knownList = udbg_knownIssue_open(knownList, ticket, gTestName, buf, &firstForTicket, &firstForWhere);
knownList = udbg_knownIssue_open(knownList, ticket, gTestName, buf,
&firstForTicket, &firstForWhere);
if(firstForTicket || firstForWhere) {
log_info("(Known issue #%s) %s", ticket, buf);
@ -715,16 +711,6 @@ static UBool vlog_knownIssue(const char *ticket, const char *pattern, va_list ap
log_verbose("(Known issue #%s) %s", ticket, buf);
}
/*printf("KNOWN ISSUE: #%s %s\n", ticket, buf); */
/* fflush(stdout); */
/* va_end(ap); */
/* if((*pattern==0) || (pattern[strlen(pattern)-1]!='\n')) { */
/* HANGING_OUTPUT=1; */
/* } else { */
/* HANGING_OUTPUT=0; */
/* } */
/* GLOBAL_PRINT_COUNT++; */
return TRUE;
}

View file

@ -224,6 +224,16 @@ log_verbose(const char* pattern, ...);
T_CTEST_API void T_CTEST_EXPORT2
log_data_err(const char *pattern, ...);
/**
* Log a known issue.
* @param ticket ticket number such as "12345" for ICU tickets or "cldrbug:6636" for CLDR tickets.
* @param fmt ... sprintf-style format, optional message. can be NULL.
* @return TRUE if known issue test should be skipped, FALSE if it should be run
*/
T_CTEST_API UBool
T_CTEST_EXPORT2
log_knownIssue(const char *ticket, const char *fmt, ...);
/**
* Initialize the variables above. This allows the test to set up accordingly
* before running the tests.
@ -299,15 +309,4 @@ T_CTEST_API int32_t
T_CTEST_EXPORT2
ctest_xml_testcase(const char *classname, const char *name, const char *time, const char *failMsg);
/**
* Log a known issue.
* @param ticket ticket number such as "12345" for ICU tickets or "cldr:6636" for CLDR tickets.
* @param fmt ... sprintf-style format, optional message. can be NULL.
* @return TRUE unless known issues should be tested
*/
T_CTEST_API UBool
T_CTEST_EXPORT2
log_knownIssue(const char *ticket, const char *fmt, ...);
#endif