|
3 | 3 | #include "bson/bson-iso8601-private.h" |
4 | 4 | #include "TestSuite.h" |
5 | 5 |
|
6 | | -#define IS_TIME_T_SMALL (sizeof (time_t) == sizeof (int32_t)) |
| 6 | +static const bool is_time_t_small = (sizeof (time_t) == sizeof (int32_t)); |
7 | 7 |
|
8 | 8 | static void |
9 | 9 | test_date (const char *str, int64_t millis) |
@@ -91,7 +91,7 @@ test_bson_iso8601_utc (void) |
91 | 91 | test_date_rt ("1970-06-30T01:06:40.981Z", 15556000981ULL); |
92 | 92 | test_date ("1970-01-01T00:00:00.000+0100", -3600LL * 1000); |
93 | 93 |
|
94 | | - if (!IS_TIME_T_SMALL) { |
| 94 | + if (!is_time_t_small) { |
95 | 95 | test_date_rt ("2058-02-20T18:29:11.100Z", 2781455351100ULL); |
96 | 96 | test_date ("3001-01-01T08:00:00.000Z", 32535244800000ULL); |
97 | 97 | } |
@@ -134,7 +134,7 @@ test_bson_iso8601_local (void) |
134 | 134 | 15556000981ULL); |
135 | 135 | test_date_io ("1969-12-31T16:00:00.000-0800", "1970-01-01T00:00:00Z", 0ULL); |
136 | 136 |
|
137 | | - if (!IS_TIME_T_SMALL) { |
| 137 | + if (!is_time_t_small) { |
138 | 138 | test_date_io ("2058-02-20T13:29:11.100-0500", |
139 | 139 | "2058-02-20T18:29:11.100Z", |
140 | 140 | 2781455351100ULL); |
@@ -291,7 +291,7 @@ test_bson_iso8601_leap_year (void) |
291 | 291 | test_date_rt ("2032-02-29T00:00:00Z", 1961625600000ULL); |
292 | 292 | test_date_rt ("2036-02-29T00:00:00Z", 2087856000000ULL); |
293 | 293 |
|
294 | | - if (!IS_TIME_T_SMALL) { |
| 294 | + if (!is_time_t_small) { |
295 | 295 | test_date_rt ("2040-02-29T00:00:00Z", 2214086400000ULL); |
296 | 296 | test_date_rt ("2044-02-29T00:00:00Z", 2340316800000ULL); |
297 | 297 | test_date_rt ("2048-02-29T00:00:00Z", 2466547200000ULL); |
|
0 commit comments