]> Savannah Git Hosting - gnulib.git/commitdiff
gettimeofday, timespec_get tests: Avoid test failure on glibc/Linux.
authorBruno Haible <bruno@clisp.org>
Wed, 8 Mar 2023 16:09:37 +0000 (17:09 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 8 Mar 2023 16:09:37 +0000 (17:09 +0100)
* 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.

ChangeLog
modules/gettimeofday-tests
modules/timespec_get-tests
tests/test-gettimeofday.c
tests/test-timespec_get.c

index 580b78c33173c5f10f0e9ca763ebef8fee150f7c..fc3bf8e0873edc391ca6aef0a0488b9f63c9d4dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 83c7c4b36368a96e769fc51d28917d1401240bea..a08631d836eb8c10e9b173b569846910b38feb3e 100644 (file)
@@ -4,6 +4,7 @@ tests/signature.h
 tests/macros.h
 
 Depends-on:
+time
 
 configure.ac:
 
index 7784792196eaaee0d93349522331764c4d7aa403..bb11062cb0c5531304529099297a12c35f1e4732 100644 (file)
@@ -4,6 +4,7 @@ tests/signature.h
 tests/macros.h
 
 Depends-on:
+time
 
 configure.ac:
 
index 6daf0693396c30d1f7fb931ffcb26b6d79dd9354..d1d5206709c7d3d19df1b392f0de336eee3f47b8 100644 (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);
index 69b98c5c64c43f8c790658c3e29e9d742af77532..a7e927cf6252601d311f8e7e04073f5ac3b99786 100644 (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);