1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-09-01 02:34:55 +00:00

gettimeofday, timespec_get tests: Avoid test failure on glibc/Linux.

* modules/gettimeofday-tests (Depends-on): Add 'time'.
* modules/timespec_get-tests (Depends-on): Likewise.
* tests/test-gettimeofday.c (test_consistency): Update comment.
* tests/test-timespec_get.c (main): Likewise.
This commit is contained in:
Bruno Haible
2023-03-08 17:09:37 +01:00
parent 8e356e3d3d
commit 570d7dbfff
5 changed files with 12 additions and 2 deletions
+6
View File
@@ -1,5 +1,11 @@
2023-03-08 Bruno Haible <bruno@clisp.org>
gettimeofday, timespec_get tests: Avoid test failure on glibc/Linux.
* modules/gettimeofday-tests (Depends-on): Add 'time'.
* modules/timespec_get-tests (Depends-on): Likewise.
* tests/test-gettimeofday.c (test_consistency): Update comment.
* tests/test-timespec_get.c (main): Likewise.
time: Add tests.
* tests/test-time.c: New file.
* modules/time-tests: New file.
+1
View File
@@ -4,6 +4,7 @@ tests/signature.h
tests/macros.h
Depends-on:
time
configure.ac:
+1
View File
@@ -4,6 +4,7 @@ tests/signature.h
tests/macros.h
Depends-on:
time
configure.ac:
+2 -1
View File
@@ -70,7 +70,8 @@ test_consistency ()
ASSERT (tt2 <= tt4);
/* Verify that the tv_sec field of the result is the same as time(NULL). */
/* Note: This assertion sometimes fails on glibc systems, see
/* Note: It's here that the dependency to the 'time' module is needed.
Without it, this assertion would sometimes fail on glibc systems, see
https://sourceware.org/bugzilla/show_bug.cgi?id=30200 */
ASSERT (tv1.tv_sec <= tt2);
ASSERT (tt2 <= tv3.tv_sec);
+2 -1
View File
@@ -46,7 +46,8 @@ main (void)
ASSERT (tt2 <= tt4);
/* Verify that the tv_sec field of the result is the same as time(NULL). */
/* Note: This assertion sometimes fails on glibc systems, see
/* Note: It's here that the dependency to the 'time' module is needed.
Without it, this assertion would sometimes fail on glibc systems, see
https://sourceware.org/bugzilla/show_bug.cgi?id=30200 */
ASSERT (ts1.tv_sec <= tt2);
ASSERT (tt2 <= ts3.tv_sec);