ICU-3312 We no longer test properly getting the time zone from the OS.
The tests will now work in all time zones, but the tests will manually set the time zone to the expected time zone for testing. X-SVN-Rev: 13353
This commit is contained in:
parent
be16e68b51
commit
c65d4d8669
@ -970,10 +970,6 @@ main(int argc, char* argv[])
|
||||
UErrorCode errorCode = U_ZERO_ERROR;
|
||||
UConverter *cnv = NULL;
|
||||
const char *warnOrErr = "Failure";
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
const char* zone = "America/Los_Angeles";
|
||||
int argzone = -1;
|
||||
#endif
|
||||
|
||||
#ifdef XP_MAC_CONSOLE
|
||||
argc = ccommand( &argv );
|
||||
@ -1015,24 +1011,6 @@ main(int argc, char* argv[])
|
||||
warnOnMissingData = TRUE;
|
||||
warnOrErr = "WARNING";
|
||||
}
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
else if (strcmp("tz", str) == 0) {
|
||||
zone = 0;
|
||||
if ((i+1) < argc) {
|
||||
switch (argv[i+1][0]) {
|
||||
case 0:
|
||||
argzone = ++i; /* consume empty string in {-tz ""} */
|
||||
break;
|
||||
case '-':
|
||||
break; /* don't process next arg if it is -x */
|
||||
default:
|
||||
argzone = ++i;
|
||||
zone = argv[argzone]; /* next arg is zone */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
syntax = TRUE;
|
||||
}
|
||||
@ -1053,15 +1031,6 @@ main(int argc, char* argv[])
|
||||
"### IntlTest [-option1 -option2 ...] [testname1 testname2 ...] \n"
|
||||
"### where options are: verbose (v), all (a), noerrormsg (n), \n"
|
||||
"### exhaustive (e), leaks (l)"
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
", and default time zone (tz)"
|
||||
#endif
|
||||
". \n"
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
"### -tz takes an optional zone argument. If absent, \n"
|
||||
"### or if the empty string, then the default time zone \n"
|
||||
"### is not set (host time zone is used). \n"
|
||||
#endif
|
||||
"### (Specify either -all (shortcut -a) or a test name). \n"
|
||||
"### -all will run all of the tests.\n"
|
||||
"### \n"
|
||||
@ -1093,9 +1062,6 @@ main(int argc, char* argv[])
|
||||
fprintf(stdout, " No error messages (n) : %s\n", (no_err_msg? "On" : "Off"));
|
||||
fprintf(stdout, " Exhaustive (e) : %s\n", (!quick? "On" : "Off"));
|
||||
fprintf(stdout, " Leaks (l) : %s\n", (leaks? "On" : "Off"));
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
fprintf(stdout, " Time zone (tz) : %s\n", (zone? zone : "UNSET"));
|
||||
#endif
|
||||
fprintf(stdout, "-----------------------------------------------\n");
|
||||
|
||||
// Check that u_init() works
|
||||
@ -1161,33 +1127,6 @@ main(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
/* Set the default time zone */
|
||||
if (zone != 0) {
|
||||
UErrorCode ec = U_ZERO_ERROR;
|
||||
UnicodeString id(zone, ""), s;
|
||||
TimeZone *z = TimeZone::createTimeZone(id);
|
||||
if (z == 0) {
|
||||
fprintf(stdout,
|
||||
"*** Error: TimeZone::createTimeZone(\"%s\") returned 0.\n",
|
||||
zone);
|
||||
} else if (z->getID(s) != id) {
|
||||
fprintf(stdout,
|
||||
"*** Error: \"%s\" is not a valid time zone.\n",
|
||||
zone);
|
||||
delete z;
|
||||
z = 0;
|
||||
}
|
||||
if (z == 0) {
|
||||
fprintf(stdout,
|
||||
"*** Exiting. Use the '-tz' option with no argument to\n"
|
||||
"*** bypass the setting of the default time zone.\n");
|
||||
return 1;
|
||||
}
|
||||
TimeZone::adoptDefault(z);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* TODO: Add option to call u_cleanup and rerun tests. */
|
||||
if (all) {
|
||||
major.runTest();
|
||||
@ -1196,11 +1135,6 @@ main(int argc, char* argv[])
|
||||
}
|
||||
}else{
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
if (i == argzone) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (argv[i][0] != '-') {
|
||||
char* name = argv[i];
|
||||
fprintf(stdout, "\n=== Handling test: %s: ===\n", name);
|
||||
|
Loading…
Reference in New Issue
Block a user