]> granicus.if.org Git - strace/commitdiff
tests: extend coverage of time syscall
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 7 Feb 2016 23:46:33 +0000 (23:46 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 8 Feb 2016 18:27:17 +0000 (18:27 +0000)
* tests/time.c (main): Check decoding of NULL time_t pointer.

tests/time.c

index f9fde5cb9d14c8928ce58aa0536155fe8e30c3e2..041b011747869a66ac90aec6b6c9a393e397c8b1 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * This file is part of time strace test.
+ *
  * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
  * All rights reserved.
  *
@@ -39,11 +41,13 @@ int
 main(void)
 {
        time_t *p = tail_alloc(sizeof(time_t));
-       time_t t = syscall(__NR_time, p);
 
+       time_t t = syscall(__NR_time, NULL);
        if ((time_t) -1 == t)
                perror_msg_and_skip("time");
+       printf("time(NULL) = %jd\n", (intmax_t) t);
 
+       t = syscall(__NR_time, p);
        printf("time([%jd]) = %jd\n", (intmax_t) *p, (intmax_t) t);
 
        puts("+++ exited with 0 +++");