ICU-953 Now uses the invarient converter for static data.

X-SVN-Rev: 4632
This commit is contained in:
George Rhoten 2001-05-09 23:15:05 +00:00
parent f89197ab0c
commit 06e8676f93
7 changed files with 54 additions and 60 deletions

View file

@ -1012,6 +1012,7 @@ CalendarTest::TestSecondsZero121()
void
CalendarTest::TestAddSetGet0610()
{
UnicodeString EXPECTED_0610("1993/0/5", "");
UErrorCode status = U_ZERO_ERROR;
{
Calendar *calendar = new GregorianCalendar(status);
@ -1066,7 +1067,6 @@ CalendarTest::value(Calendar* calendar)
(U_FAILURE(status) ? " FAIL: Calendar::get failed" : "");
}
UnicodeString CalendarTest::EXPECTED_0610 = "1993/0/5";
// -------------------------------------

View file

@ -125,7 +125,6 @@ public:
public: // package
// internal routine for checking date
static UnicodeString value(Calendar* calendar);
static UnicodeString EXPECTED_0610;
public:
/**

View file

@ -17,8 +17,8 @@
static UErrorCode status = U_ZERO_ERROR;
const UnicodeString CollationIteratorTest::test1 = "What subset of all possible test cases?";
const UnicodeString CollationIteratorTest::test2 = "has the highest probability of detecting";
const UnicodeString CollationIteratorTest::test1("What subset of all possible test cases?", "");
const UnicodeString CollationIteratorTest::test2("has the highest probability of detecting", "");
CollationIteratorTest::CollationIteratorTest()
{

View file

@ -38,7 +38,7 @@
#define MAX(x,y) ((x) > (y) ? (x) : (y))
#endif
const UnicodeString CollationMonkeyTest::source("-abcdefghijklmnopqrstuvwxyz#&^$@");
const UnicodeString CollationMonkeyTest::source("-abcdefghijklmnopqrstuvwxyz#&^$@", "");
CollationMonkeyTest::CollationMonkeyTest()
: myCollator(0)

View file

@ -24,47 +24,6 @@
#include "unicode/choicfmt.h"
#include "unicode/gregocal.h"
Formattable TestMessageFormat::testArgs[] = {
Formattable(double(1)), Formattable(double(3456)),
Formattable("Disk"), Formattable(UDate((int32_t)1000000000L), Formattable::kIsDate)
};
UnicodeString TestMessageFormat::testCases[] = {
"Quotes '', '{', 'a' {0} '{0}'",
"Quotes '', '{', 'a' {0,number} '{0}'",
"'{'1,number,'#',##} {1,number,'#',##}",
"There are {1} files on {2} at {3}.",
"On {2}, there are {1} files, with {0,number,currency}.",
"'{1,number,percent}', {1,number,percent},",
"'{1,date,full}', {1,date,full},",
"'{3,date,full}', {3,date,full},",
"'{1,number,#,##}' {1,number,#,##}",
};
UnicodeString TestMessageFormat::testResultPatterns[] = {
"Quotes '', '{', a {0} '{'0}",
"Quotes '', '{', a {0,number} '{'0}",
"'{'1,number,#,##} {1,number,'#'#,##}",
"There are {1} files on {2} at {3}.",
"On {2}, there are {1} files, with {0,number,currency}.",
"'{'1,number,percent}, {1,number,percent},",
"'{'1,date,full}, {1,date,full},",
"'{'3,date,full}, {3,date,full},",
"'{'1,number,#,##} {1,number,#,##}"
};
UnicodeString TestMessageFormat::testResultStrings[] = {
"Quotes ', {, a 1 {0}",
"Quotes ', {, a 1 {0}",
"{1,number,#,##} #34,56",
"There are 3,456 files on Disk at 1/12/70 5:46 AM.",
"On Disk, there are 3,456 files, with $1.00.",
"{1,number,percent}, 345,600%,",
"{1,date,full}, Wednesday, December 31, 1969,",
"{3,date,full}, Monday, January 12, 1970,",
"{1,number,#,##} 34,56"
};
void TestMessageFormat::testBug3()
@ -250,6 +209,46 @@ operator<<( IntlTest& stream,
void TestMessageFormat::PatternTest()
{
Formattable testArgs[] = {
Formattable(double(1)), Formattable(double(3456)),
Formattable("Disk"), Formattable(UDate((int32_t)1000000000L), Formattable::kIsDate)
};
UnicodeString testCases[] = {
"Quotes '', '{', 'a' {0} '{0}'",
"Quotes '', '{', 'a' {0,number} '{0}'",
"'{'1,number,'#',##} {1,number,'#',##}",
"There are {1} files on {2} at {3}.",
"On {2}, there are {1} files, with {0,number,currency}.",
"'{1,number,percent}', {1,number,percent},",
"'{1,date,full}', {1,date,full},",
"'{3,date,full}', {3,date,full},",
"'{1,number,#,##}' {1,number,#,##}",
};
UnicodeString testResultPatterns[] = {
"Quotes '', '{', a {0} '{'0}",
"Quotes '', '{', a {0,number} '{'0}",
"'{'1,number,#,##} {1,number,'#'#,##}",
"There are {1} files on {2} at {3}.",
"On {2}, there are {1} files, with {0,number,currency}.",
"'{'1,number,percent}, {1,number,percent},",
"'{'1,date,full}, {1,date,full},",
"'{'3,date,full}, {3,date,full},",
"'{'1,number,#,##} {1,number,#,##}"
};
UnicodeString testResultStrings[] = {
"Quotes ', {, a 1 {0}",
"Quotes ', {, a 1 {0}",
"{1,number,#,##} #34,56",
"There are 3,456 files on Disk at 1/12/70 5:46 AM.",
"On Disk, there are 3,456 files, with $1.00.",
"{1,number,percent}, 345,600%,",
"{1,date,full}, Wednesday, December 31, 1969,",
"{3,date,full}, Monday, January 12, 1970,",
"{1,number,#,##} 34,56"
};
for (int32_t i = 0; i < 9; ++i) {
//it_out << "\nPat in: " << testCases[i] << endl;

View file

@ -73,10 +73,6 @@ public:
void testAdopt(void);
private:
static Formattable testArgs[];
static UnicodeString testCases[];
static UnicodeString testResultPatterns[];
static UnicodeString testResultStrings[];
};

View file

@ -573,22 +573,22 @@ struct FormatThreadTestData
//
FormatThreadTestData kNumberFormatTestData[] =
{
FormatThreadTestData((double)5., UnicodeString("5")),
FormatThreadTestData( 6., "6" ),
FormatThreadTestData( 20., "20" ),
FormatThreadTestData( 8., "8" ),
FormatThreadTestData( 8.3, "8.3" ),
FormatThreadTestData( 12345, "12,345" ),
FormatThreadTestData( 81890.23, "81,890.23" ),
FormatThreadTestData((double)5.0, UnicodeString("5", "")),
FormatThreadTestData( 6.0, UnicodeString("6", "")),
FormatThreadTestData( 20.0, UnicodeString("20", "")),
FormatThreadTestData( 8.0, UnicodeString("8", "")),
FormatThreadTestData( 8.3, UnicodeString("8.3", "")),
FormatThreadTestData( 12345, UnicodeString("12,345", "")),
FormatThreadTestData( 81890.23, UnicodeString("81,890.23", "")),
};
int32_t kNumberFormatTestDataLength = (int32_t)(sizeof(kNumberFormatTestData) / sizeof(kNumberFormatTestData[0]));
//
FormatThreadTestData kPercentFormatTestData[] =
{
FormatThreadTestData((double)5., UnicodeString("500%")),
FormatThreadTestData( 1, "100%" ),
FormatThreadTestData( 0.26, "26%" ),
FormatThreadTestData((double)5.0, UnicodeString("500%", "")),
FormatThreadTestData( 1.0, UnicodeString("100%", "")),
FormatThreadTestData( 0.26, UnicodeString("26%", "")),
FormatThreadTestData( 16384.99, CharsToUnicodeString("1\\u00a0638\\u00a0499%") ), // U+00a0 = NBSP
FormatThreadTestData( 81890.23, CharsToUnicodeString("8\\u00a0189\\u00a0023%" )),
};