[libc-commits] [PATCH] D137371: [libc] Fix matching on struct tm
Dominic Chen via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon Nov 7 10:50:20 PST 2022
ddcc added a comment.
In D137371#3912177 <https://reviews.llvm.org/D137371#3912177>, @jeffbailey wrote:
> Ate these test changes enough to catch this? It seems a bit magical with the numbers. Should there be an explicit test that tests matching more than one field?
I'm not sure I understand the question. There were three issues with the tests that this commit fixes:
1. The tests don't check that the pointer `tm_data` is not NULL before dereferencing it
2. The test matcher only checked that at least one field of `struct tm` matches, and not that all fields match.
3. Multiple testcases contained incorrect values for the `tm_yday` field.
I've been running the llvm-libc tests against a different libc, which is what led me to identify these testcase issues. After these above fixes, the tests against that libc no longer fail. I haven't manually tested these changes against the llvm-libc implementation itself, but from looking at the CI build output they seem fine.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137371/new/
https://reviews.llvm.org/D137371
More information about the libc-commits
mailing list