X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Ftest%2Ftest-time.c;h=254a8d0e529eec9ca4871552eb2b95c1d4ed17c7;hb=2d60169dd60d503712d5c2e81a01158e82e636e6;hp=ca44f81f9c5b55b307c3c32d2ab0b12c38a115f9;hpb=34172476c891c2887e5a457bcbe6537115b41d50;p=thirdparty%2Fsystemd.git diff --git a/src/test/test-time.c b/src/test/test-time.c index ca44f81f9c5..254a8d0e529 100644 --- a/src/test/test-time.c +++ b/src/test/test-time.c @@ -192,6 +192,8 @@ static void test_usec_add(void) { } int main(int argc, char *argv[]) { + uintmax_t x; + test_parse_sec(); test_parse_time(); test_parse_nsec(); @@ -202,5 +204,13 @@ int main(int argc, char *argv[]) { test_get_timezones(); test_usec_add(); + /* Ensure time_t is signed */ + assert_cc((time_t) -1 < (time_t) 1); + + /* Ensure TIME_T_MAX works correctly */ + x = (uintmax_t) TIME_T_MAX; + x ++; + assert((time_t) x < 0); + return 0; }