text stringlengths 0 2.2M |
|---|
#define ASSERT_SAFE_PASS(EXPR) BSLS_ASSERTTEST_ASSERT_SAFE_PASS(EXPR)
|
#define ASSERT_SAFE_FAIL(EXPR) BSLS_ASSERTTEST_ASSERT_SAFE_FAIL(EXPR)
|
#define ASSERT_PASS(EXPR) BSLS_ASSERTTEST_ASSERT_PASS(EXPR)
|
#define ASSERT_FAIL(EXPR) BSLS_ASSERTTEST_ASSERT_FAIL(EXPR)
|
#define ASSERT_OPT_PASS(EXPR) BSLS_ASSERTTEST_ASSERT_OPT_PASS(EXPR)
|
#define ASSERT_OPT_FAIL(EXPR) BSLS_ASSERTTEST_ASSERT_OPT_FAIL(EXPR)
|
//=============================================================================
|
// GLOBALS, TYPEDEFS, CONSTANTS FOR TESTING
|
//-----------------------------------------------------------------------------
|
typedef bdlt::Iso8601Util Util;
|
typedef bdlt::Iso8601UtilConfiguration Config;
|
typedef bsl::string_view StrView;
|
const int k_INTERVAL_MAX_PRECISION = 9;
|
const int k_DATE_MAX_PRECISION = 3;
|
const int k_DATETZ_MAX_PRECISION = 3;
|
const int k_DATETIME_MAX_PRECISION = 6;
|
const int k_DATETIMETZ_MAX_PRECISION = 6;
|
const int k_TIME_MAX_PRECISION = 6;
|
const int k_TIMETZ_MAX_PRECISION = 6;
|
// ============================================================================
|
// GLOBAL TEST DATA
|
// ----------------------------------------------------------------------------
|
// Define DEFAULT DATA generally usable across 'generate' and 'parse' test
|
// cases.
|
// *** 'TimeInterval' Data ***
|
struct DefaultIntervalDataRow {
|
int d_line; // source line number
|
bsls::Types::Int64 d_sec; // seconds
|
int d_usec; // nanoseconds
|
const char *d_iso8601; // ISO 8601 string
|
bool d_canonical; // There are many strings which can be
|
// parsed into the same TimeInterval,
|
// but for each TimeInterval there is
|
// only one canonical string
|
// representation (the string returned
|
// by the generate functions).
|
};
|
static const DefaultIntervalDataRow DEFAULT_INTERVAL_DATA[] = {
|
//LINE SECONDS NANOSECONDS
|
//---- ------------------------------ -----------
|
// ISO8601 CANONICAL
|
// ------------------------------------ ---------
|
{ L_, 0, 0,
|
"P0W", false },
|
{ L_, 0, 0,
|
"P0D", false },
|
{ L_, 0, 0,
|
"PT0H", false },
|
{ L_, 0, 0,
|
"PT0M", false },
|
{ L_, 0, 0,
|
"PT0S", false },
|
{ L_, 0, 0,
|
"PT0.000000000S", true },
|
{ L_, 0, 0,
|
"P0DT0M", false },
|
{ L_, 0, 0,
|
"P0DT0S", false },
|
{ L_, 0, 0,
|
"P0W0DT0H0M0S", false },
|
{ L_, 0, 0,
|
"P0W0DT0H0M0.0S", false },
|
{ L_, 0, 0,
|
"P0W0DT0H0M0.000000000S", false },
|
{ L_, 0, 0,
|
"P0W0DT0H0M0.0000000000S", false },
|
{ L_, 604800, 0,
|
"P1W", false },
|
{ L_, 604800, 0,
|
"P1WT0.000000000S", true },
|
{ L_, 86400, 0,
|
"P1D", false },
|
{ L_, 86400, 0,
|
"P1DT0.000000000S", true },
|
{ L_, 3600, 0,
|
"PT1H", false },
|
{ L_, 3600, 0,
|
"PT1H0.000000000S", true },
|
{ L_, 60, 0,
|
"PT1M", false },
|
{ L_, 60, 0,
|
"PT1M0.000000000S", true },
|
{ L_, 1, 0,
|
"PT1S", false },
|
{ L_, 1, 0,
|
"PT1.000000000S", true },
|
{ L_, 93600, 0,
|
"P1DT2H0.000000000S", true },
|
{ L_, 93600, 0,
|
"PT26H", false },
|
{ L_, 172800 + 300, 0,
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.