[PATCH] tst: Provide Y2038 tests for mktime (tst-mktime4.c)

Florian Weimer fweimer@redhat.com
Mon Jan 25 20:01:59 GMT 2021


* Paul Eggert:

> On 1/25/21 5:03 AM, Lukasz Majewski wrote:
>
>> +  /* Set time zone for the test.  */
>> +  TEST_VERIFY_EXIT (setenv ("TZ", "Europe/Warsaw", 1) == 0);
>> +  tzset ();
>
> Your test data assume UTC, so why set the time zone to Warsaw's?
>
> Also, there's no need to call tzset; mktime is supposed to do that.
>
> I suggest also testing 2**32 - 1 and 2**32, when using 64-bit time_t.

Furthermore, if the test can't use UTC for some reason, please add a
custom time zone for it, so that it does not depend on real tzdata files
for future dates, which can change.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill



More information about the Libc-alpha mailing list