Index: source/test/intltest/intltest.cpp |
diff --git a/source/test/intltest/intltest.cpp b/source/test/intltest/intltest.cpp |
index 8a717e4ad894810c66dd39d7e99585874bc3ae87..9998250f790b0d1daf5080878e3ee5b6c85c277d 100644 |
--- a/source/test/intltest/intltest.cpp |
+++ b/source/test/intltest/intltest.cpp |
@@ -1,6 +1,6 @@ |
/******************************************************************** |
* COPYRIGHT: |
- * Copyright (c) 1997-2013, International Business Machines Corporation and |
+ * Copyright (c) 1997-2014, International Business Machines Corporation and |
* others. All Rights Reserved. |
********************************************************************/ |
@@ -977,10 +977,12 @@ UBool IntlTest::logKnownIssue(const char *ticket, const UnicodeString &msg) { |
UBool firstForTicket, firstForWhere; |
knownList = udbg_knownIssue_openU(knownList, ticket, fullpath, msg2.getTerminatedBuffer(), &firstForTicket, &firstForWhere); |
+ msg2 = UNICODE_STRING_SIMPLE("(Known issue #") + |
+ UnicodeString(ticket, -1, US_INV) + UNICODE_STRING_SIMPLE(") ") + msg; |
if(firstForTicket || firstForWhere) { |
- infoln(UnicodeString("(Known issue #","") + UnicodeString(ticket,"")+ UnicodeString(") \"","") + msg); |
+ infoln(msg2); |
} else { |
- logln(UnicodeString("(Known issue #","") + UnicodeString(ticket,"")+ UnicodeString(") \"","") + msg); |
+ logln(msg2); |
} |
return TRUE; |
@@ -1095,7 +1097,7 @@ void IntlTest::LL_message( UnicodeString message, UBool newline ) |
}; |
UnicodeString indent(FALSE, indentUChars, 1 + LL_indentlevel); |
- char buffer[10000]; |
+ char buffer[30000]; |
int32_t length; |
// stream out the indentation string first if necessary |
@@ -1110,7 +1112,7 @@ void IntlTest::LL_message( UnicodeString message, UBool newline ) |
// stream out the message |
length = message.extract(0, message.length(), buffer, sizeof(buffer)); |
if (length > 0) { |
- length = length > 10000 ? 10000 : length; |
+ length = length > 30000 ? 30000 : length; |
fwrite(buffer, sizeof(*buffer), length, (FILE *)testoutfp); |
} |
@@ -1606,6 +1608,48 @@ const char *IntlTest::getSourceTestData(UErrorCode& /*err*/) { |
return srcDataDir; |
} |
+char *IntlTest::getUnidataPath(char path[]) { |
+ const int kUnicodeDataTxtLength = 15; // strlen("UnicodeData.txt") |
+ |
+ // Look inside ICU_DATA first. |
+ strcpy(path, pathToDataDirectory()); |
+ strcat(path, "unidata" U_FILE_SEP_STRING "UnicodeData.txt"); |
+ FILE *f = fopen(path, "r"); |
+ if(f != NULL) { |
+ fclose(f); |
+ *(strchr(path, 0) - kUnicodeDataTxtLength) = 0; // Remove the basename. |
+ return path; |
+ } |
+ |
+ // As a fallback, try to guess where the source data was located |
+ // at the time ICU was built, and look there. |
+# ifdef U_TOPSRCDIR |
+ strcpy(path, U_TOPSRCDIR U_FILE_SEP_STRING "data"); |
+# else |
+ UErrorCode errorCode = U_ZERO_ERROR; |
+ const char *testDataPath = loadTestData(errorCode); |
+ if(U_FAILURE(errorCode)) { |
+ it_errln(UnicodeString( |
+ "unable to find path to source/data/unidata/ and loadTestData() failed: ") + |
+ u_errorName(errorCode)); |
+ return NULL; |
+ } |
+ strcpy(path, testDataPath); |
+ strcat(path, U_FILE_SEP_STRING ".." U_FILE_SEP_STRING ".." |
+ U_FILE_SEP_STRING ".." U_FILE_SEP_STRING ".." |
+ U_FILE_SEP_STRING "data"); |
+# endif |
+ strcat(path, U_FILE_SEP_STRING); |
+ strcat(path, "unidata" U_FILE_SEP_STRING "UnicodeData.txt"); |
+ f = fopen(path, "r"); |
+ if(f != NULL) { |
+ fclose(f); |
+ *(strchr(path, 0) - kUnicodeDataTxtLength) = 0; // Remove the basename. |
+ return path; |
+ } |
+ return NULL; |
+} |
+ |
const char* IntlTest::fgDataDir = NULL; |
/* returns the path to icu/source/data */ |