Page MenuHomeFreeBSD

libc: Update mktime(3) / timegm(3) tests.
ClosedPublic

Authored by des on Jan 24 2023, 8:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 8, 4:26 PM
Unknown Object (File)
Sun, May 5, 3:43 PM
Unknown Object (File)
Sat, May 4, 5:00 AM
Unknown Object (File)
Thu, May 2, 10:54 AM
Unknown Object (File)
Thu, May 2, 10:54 AM
Unknown Object (File)
Thu, May 2, 10:53 AM
Unknown Object (File)
Thu, May 2, 9:28 AM
Unknown Object (File)
Thu, May 2, 7:12 AM
Subscribers

Details

Summary

Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49203
Build 46092: arc lint + arc unit

Event Timeline

des requested review of this revision.Jan 24 2023, 8:34 AM
markj added inline comments.
contrib/netbsd-tests/lib/libc/time/t_mktime.c
76

Presumably we shouldn't rely on errno being clear if the call was successful? Where does it get set?

We should probably stop clearing errno above too then?

contrib/netbsd-tests/lib/libc/time/t_mktime.c
76

Presumably we shouldn't rely on errno being clear if the call was successful?

Neither C nor POSIX say anything about mktime() setting errno. It just so happens that a previous version of tzcode left errno untouched when mktime() was successful, NetBSD incorrectly assumed that this was mandated and added a test for it, and we trusted them and imported that test. The current version of tzcode almost always sets errno to EOVERFLOW on 64-bit platforms, even when successful, so the test fails.

We should probably stop clearing errno above too then?

This is contrib code, I don't want to make gratuitous changes.

ATF_REQUIRE_EQ is generally better because it emits the LHS and RHS of the expression in the check, whereas ATF_REQUIRE omits this information (it’s about as good as “assert a == b”).

This revision is now accepted and ready to land.Jan 24 2023, 8:07 PM
contrib/netbsd-tests/lib/libc/time/t_mktime.c
76

We should file a NetBSD PR, so our fix can be picked up in the next update.

This revision was automatically updated to reflect the committed changes.
des marked 2 inline comments as done.Jan 25 2023, 6:32 AM
des added inline comments.
contrib/netbsd-tests/lib/libc/time/t_mktime.c
76

There is no “our fix”. This commit reverts the test to the latest upstream revision.

des marked an inline comment as done.Jan 25 2023, 6:33 AM