text
stringlengths
0
2.2M
{ L_, "Australia/Darwin", ROOT "/Australia/Darwin" },
{ L_, "Pacific/Honolulu", ROOT "/Pacific/Honolulu" },
{ L_, "Europe/London", ROOT "/Europe/London" },
{ L_, "Europe/Isle_of_Man", ROOT "/Europe/Isle_of_Man" },
{ L_, "America/New_York", ROOT "/America/New_York" },
{ L_, "America/Indiana/Indianapolis",
ROOT "/America/Indiana/Indianapolis" },
{ L_, "America/Blanc-Sablon", ROOT "/America/Blanc-Sablon" },
{ L_, "America/Port-au-Prince", ROOT "/America/Port-au-Prince" },
{ L_, "America/Argentina/Buenos_Aires",
ROOT "/America/Argentina/Buenos_Aires" },
{ L_, "EET", ROOT "/EET" },
{ L_, "EST5EDT", ROOT "/EST5EDT" },
{ L_, "Etc/GMT-14", ROOT "/Etc/GMT-14" },
{ L_, "Etc/GMT+12", ROOT "/Etc/GMT+12" },
{ L_, "Etc/GMT-0", ROOT "/Etc/GMT-0" },
{ L_, "Etc/GMT+0", ROOT "/Etc/GMT+0" },
{ L_, "Etc/GMT0", ROOT "/Etc/GMT0" },
{ L_, "Etc/UTC", ROOT "/Etc/UTC" },
{ L_, "Arctic/Longyearbyen", ROOT "/Arctic/Longyearbyen" },
{ L_, "UTC", ROOT "/UTC" },
#endif
};
const int NUM_DATA = sizeof DATA / sizeof *DATA;
if (verbose) cout <<
"\nTesting with various time zone identifier." << endl;
{
for (int ti = 0; ti < NUM_DATA; ++ti) {
const int LINE = DATA[ti].d_line;
const char *TZ_ID = DATA[ti].d_tzId;
const bsl::string EXP = DATA[ti].d_result;
Obj mX; const Obj& X = mX;
mX.configureRootPath(ROOT);
bsl::string bslResult;
LOOP_ASSERT(LINE,
0 == X.loadTimeZoneFilePath(&bslResult,
TZ_ID));
LOOP3_ASSERT(LINE, EXP, bslResult, EXP == bslResult);
std::string stdResult;
LOOP_ASSERT(LINE,
0 == X.loadTimeZoneFilePath(&stdResult,
TZ_ID));
LOOP3_ASSERT(LINE, EXP, stdResult, EXP == stdResult);
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR
std::pmr::string pmrResult;
LOOP_ASSERT(LINE,
0 == X.loadTimeZoneFilePath(&pmrResult,
TZ_ID));
LOOP3_ASSERT(LINE, EXP, pmrResult, EXP == pmrResult);
#endif
}
}
#undef ROOT
}
} break;
case 4: {
// --------------------------------------------------------------------
// BASIC ACCESSORS
//
// Concerns:
//: 1 'rootPath' returns the value of the root path stored in the
//: object.
//:
//: 2 'isRootPathPlausible' returns 'true' if the specified root path
//: is a valid directory and contains a file name 'GMT, and false
//: otherwise.
//:
//: 3 Each accessor is declared 'const'.
//
// Plan:
//: 1 Use primary manipulators to set the root path to various values.
//:
//: 2 Verify that each basic accessor, invoked on a reference to the
//: non-modifiable object created in P1 returns the expected value.
//
// Testing:
// const bsl::string& rootPath() const;
// bool isRootPathPlausible() const;
// --------------------------------------------------------------------
if (verbose) cout << endl
<< "BASIC ACCESSORS" << endl
<< "===============" << endl;
if (verbose) cout << "\nSetup plausible directory" << endl;
ASSERT(true == Obj::isPlausibleZoneinfoRootPath(TEST_DIRECTORY));
static const struct {
int d_line;
const char *d_path;
int d_isPlausible;
} DATA [] = {