*/
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[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) {
- return !isICUVersionBefore(major, minor, milli);
+ log_knownIssue("9744", "fix call to isICUVersionAtLeast()");
+ return FALSE;
+ //return !isICUVersionBefore(major, minor, milli);
}
#endif
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * Copyright (c) 1997-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
/**
* Returns true if u_getVersion() < major.minor.milli.
+ * @deprecated use log_KnownIssue
*/
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
#include "putilimp.h" // for uprv_getRawUTCtime()
#include "unicode/locid.h"
#include "unicode/ctest.h" // for str_timeDelta
+#include "udbgutil.h"
#ifdef XP_MAC_CONSOLE
#include <console.h>
// Static list of errors found
static UnicodeString errorList;
+static UnicodeString knownList;
//-----------------------------------------------------------------------------
//convenience classes to ease porting code that uses the Java
LL_indentlevel = indentLevel_offset;
numProps = 0;
strcpy(basePath, "/");
+ currName[0]=0;
}
void IntlTest::setCaller( IntlTest* callingTest )
strcpy(saveBaseLoc,name);
strcat(saveBaseLoc,"/");
+ strcpy(currName, name); // set
this->runIndexedTest( index, TRUE, name, par );
+ currName[0]=0; // reset
UDate timeStop = uprv_getRawUTCtime();
rval = TRUE; // at least one test has been called
}
}
+UBool IntlTest::logKnownIssue(const char *ticket, const char *fmt, ...)
+{
+ char buffer[4000];
+ va_list ap;
+
+ va_start(ap, fmt);
+ /* sprintf it just to make sure that the information is valid */
+ vsprintf(buffer, fmt, ap);
+ va_end(ap);
+ return logKnownIssue(ticket, UnicodeString(buffer, ""));
+}
+
+UBool IntlTest::logKnownIssue(const char *ticket) {
+ return logKnownIssue(ticket, UnicodeString());
+}
+
+UBool IntlTest::logKnownIssue(const char *ticket, const UnicodeString &msg) {
+ knownList.append(UnicodeString(ticket, ""));
+ knownList.append(UnicodeString(" ",""));
+ knownList.append(UnicodeString(basePath, ""));
+ knownList.append(UnicodeString(currName, ""));
+ knownList.append(UnicodeString(" ",""));
+ char URL[UDBG_KNOWNISSUE_LEN];
+ knownList.append(UnicodeString(udbg_knownIssueURLFrom(ticket, URL), ""));
+ knownList.append(UnicodeString(" ",""));
+ knownList.append(msg);
+ knownList.append(UnicodeString("\n", ""));
+
+ return true;
+}
+
/* convenience functions that include sprintf formatting */
void IntlTest::info(const char *fmt, ...)
{
IntlTest::LL_message(errorList, TRUE);
}
+UBool IntlTest::printKnownIssues()
+{
+ if(knownList.length()>0) {
+ IntlTest::LL_message( UnicodeString("KNOWN ISSUES:\n", ""), TRUE );
+ IntlTest::LL_message( knownList, TRUE );
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
void IntlTest::LL_message( UnicodeString message, UBool newline )
{
// string that starts with a LineFeed character and continues
}
fprintf(stdout, "\n--------------------------------------\n");
+ major.printKnownIssues();
if (major.getErrors() == 0) {
/* Call it twice to make sure that the defaults were reset. */
/* Call it before the OK message to verify proper cleanup. */
UVersionInfo iv;
UVersionInfo ov = { (uint8_t)major, (uint8_t)minor, (uint8_t)milli, 0 };
u_getVersion(iv);
- return uprv_memcmp(iv, ov, U_MAX_VERSION_LENGTH) < 0;
+ 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
virtual void logln( void );
+ UBool logKnownIssue( const char *ticket, const UnicodeString &message );
+ UBool logKnownIssue( const char *ticket );
+ UBool logKnownIssue( const char *ticket, const char *fmt, ...);
+
virtual void info( const UnicodeString &message );
virtual void infoln( const UnicodeString &message );
// Print ALL named errors encountered so far
void printErrors();
+
+ // print known issues. return TRUE if there were any.
+ UBool printKnownIssues();
virtual void usage( void ) ;
/**
* Returns true if u_getVersion() < major.minor.
*/
- static UBool isICUVersionBefore(int major, int minor) {
+ UBool isICUVersionBefore(int major, int minor) {
return isICUVersionBefore(major, minor, 0);
}
/**
* Returns true if u_getVersion() < major.minor.milli.
*/
- static UBool isICUVersionBefore(int major, int minor, int milli);
+ UBool isICUVersionBefore(int major, int minor, int milli);
/**
* Returns true if u_getVersion() >= major.minor.
*/
- static UBool isICUVersionAtLeast(int major, int minor) {
+ UBool isICUVersionAtLeast(int major, int minor) {
return isICUVersionAtLeast(major, minor, 0);
}
/**
* Returns true if u_getVersion() >= major.minor.milli.
*/
- static UBool isICUVersionAtLeast(int major, int minor, int milli) {
+ UBool isICUVersionAtLeast(int major, int minor, int milli) {
return !isICUVersionBefore(major, minor, milli);
}
char* testPath; // specifies subtests
char basePath[1024];
+ char currName[1024]; // current test name
//FILE *testoutfp;
void *testoutfp;
void RBBITest::runUnicodeTestData(const char *fileName, RuleBasedBreakIterator *bi) {
#if !UCONFIG_NO_REGULAR_EXPRESSIONS
// TODO(andy): Match line break behavior to Unicode 6.0 and remove this time bomb. Ticket #7270
- UBool isTicket7270Fixed = isICUVersionAtLeast(52, 1);
+ UBool isTicket7270Fixed = !logKnownIssue("7270");
UBool isLineBreak = 0 == strcmp(fileName, "LineBreakTest.txt");
UErrorCode status = U_ZERO_ERROR;
col->setAttribute(UCOL_NORMALIZATION_MODE, UCOL_ON, status);
for(int32_t i = 0; i < testCount; i += 1) {
- if (!isICUVersionAtLeast(52, 0, 2) && i>=4 && i<=6) {
+ if (i>=4 && i<=6 && logKnownIssue("9156")) {
continue; // timebomb until ticket #9156 (was #8081) is resolved
}
UnicodeString ts = CharsToUnicodeString(test[i]);
*/
static void vlog_err(const char *prefix, const char *pattern, va_list ap);
static void vlog_verbose(const char *prefix, const char *pattern, va_list ap);
+static UBool vlog_knownIssue(const char *ticket, const char *pattern, va_list ap);
/**
* Log test structure, with indent
GLOBAL_PRINT_COUNT++;
}
+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];
+ vsprintf(buf, pattern, ap);
+
+ 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;
+}
+
+
void T_CTEST_EXPORT2
vlog_info(const char *prefix, const char *pattern, va_list ap)
{
vlog_err(NULL, pattern, ap);
}
+UBool T_CTEST_EXPORT2
+log_knownIssue(const char *ticket, const char *pattern, ...) {
+ va_list ap;
+ va_start(ap, pattern);
+ return vlog_knownIssue(ticket, pattern, ap);
+}
+
void T_CTEST_EXPORT2
log_err_status(UErrorCode status, const char* pattern, ...)
{
/*
********************************************************************************
*
- * Copyright (C) 1996-2010, International Business Machines
+ * Copyright (C) 1996-2013, International Business Machines
* Corporation and others. All Rights Reserved.
*
********************************************************************************
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
}
fprintf(out, " </icuSystemParams>\n");
}
+
+#define ICU_TRAC_URL "http://bugs.icu-project.org/trac/ticket/"
+#define CLDR_TRAC_URL "http://unicode.org/cldr/trac/ticket/"
+#define CLDR_TICKET_PREFIX "cldrbug:"
+
+U_CAPI char *udbg_knownIssueURLFrom(const char *ticket, char *buf) {
+ if( ticket==NULL ) {
+ return NULL;
+ }
+
+ if( !strncmp(ticket, CLDR_TICKET_PREFIX, strlen(CLDR_TICKET_PREFIX)) ) {
+ strcpy( buf, CLDR_TRAC_URL );
+ strcat( buf, ticket+strlen(CLDR_TICKET_PREFIX) );
+ } else {
+ strcpy( buf, ICU_TRAC_URL );
+ strcat( buf, ticket );
+ }
+ return buf;
+}
/*
************************************************************************
-* Copyright (c) 2008-2011, International Business Machines
+* Copyright (c) 2008-2013, International Business Machines
* Corporation and others. All Rights Reserved.
************************************************************************
*/
*/
U_CAPI void udbg_writeIcuInfo(FILE *f);
+/**
+ * \def UDBG_KNOWNISSUE_LEN
+ * Length of output buffer for udbg_knownIssueURLFrom
+ */
+#define UDBG_KNOWNISSUE_LEN 255
+
+/**
+ * Convert a "known issue" string into a URL
+ * @param ticket ticket string such as "10245" or "cldrbug:5013"
+ * @param buf output buffer - must be UDBG_KNOWNISSUE_LEN in size
+ * @return pointer to output buffer, or NULL on err
+ */
+U_CAPI char *udbg_knownIssueURLFrom(const char *ticket, char *buf);
+
#endif