[1/4] io: Do not skip timestamps tests for 32-bit time_t

Message ID 20210719163846.2954193-2-adhemerval.zanella@linaro.org
State Committed
Commit 3692c0df7f066d01863fc05a5f7cedd2628961e7
Headers
Series 64-bit time_t tests improvements |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Adhemerval Zanella July 19, 2021, 4:38 p.m. UTC
  The first test in the set do not require 64-bit time_t support, so there
is no need to return UNSUPPORTED for the whole test.  The patch also adds
another test with arbitrary date prior y2038.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 io/tst-utimensat-skeleton.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Adhemerval Zanella Oct. 4, 2021, 11:43 a.m. UTC | #1
I will commit this patch shortly if no one opposes it.

On 19/07/2021 13:38, Adhemerval Zanella wrote:
> The first test in the set do not require 64-bit time_t support, so there
> is no need to return UNSUPPORTED for the whole test.  The patch also adds
> another test with arbitrary date prior y2038.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu.
> ---
>  io/tst-utimensat-skeleton.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/io/tst-utimensat-skeleton.c b/io/tst-utimensat-skeleton.c
> index ad9f6763c5..2b956f1661 100644
> --- a/io/tst-utimensat-skeleton.c
> +++ b/io/tst-utimensat-skeleton.c
> @@ -30,6 +30,8 @@ const static struct {
>    int64_t v1;
>    int64_t v2;
>  } tests[] = {
> +  /* Some arbitrary date before Y2038.  */
> +  { 0x60ECA720LL, 0x60eca721LL },
>    /* Y2038 threshold minus 2 and 1 seconds.  */
>    { 0x7FFFFFFELL, 0x7FFFFFFFLL },
>    /* Y2038 threshold plus 1 and 2 seconds.  */
> @@ -59,7 +61,7 @@ do_prepare (int argc, char *argv[])
>  static int
>  do_test (void)
>  {
> -  if (!support_path_support_time64 (testfile))
> +  if (sizeof (time_t) == 8 && !support_path_support_time64 (testfile))
>      FAIL_UNSUPPORTED ("File %s does not support 64-bit timestamps",
>  		      testfile);
>  
>
  

Patch

diff --git a/io/tst-utimensat-skeleton.c b/io/tst-utimensat-skeleton.c
index ad9f6763c5..2b956f1661 100644
--- a/io/tst-utimensat-skeleton.c
+++ b/io/tst-utimensat-skeleton.c
@@ -30,6 +30,8 @@  const static struct {
   int64_t v1;
   int64_t v2;
 } tests[] = {
+  /* Some arbitrary date before Y2038.  */
+  { 0x60ECA720LL, 0x60eca721LL },
   /* Y2038 threshold minus 2 and 1 seconds.  */
   { 0x7FFFFFFELL, 0x7FFFFFFFLL },
   /* Y2038 threshold plus 1 and 2 seconds.  */
@@ -59,7 +61,7 @@  do_prepare (int argc, char *argv[])
 static int
 do_test (void)
 {
-  if (!support_path_support_time64 (testfile))
+  if (sizeof (time_t) == 8 && !support_path_support_time64 (testfile))
     FAIL_UNSUPPORTED ("File %s does not support 64-bit timestamps",
 		      testfile);