[libc-commits] [PATCH] D148837: [LIBC] Strengthen `pthread_join` tests; NFC
Siva Chandra via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon Jun 5 23:42:44 PDT 2023
sivachandra added a comment.
In D148837#4397873 <https://reviews.llvm.org/D148837#4397873>, @goldstein.w.n wrote:
>> 1. The non-null join test is best suited as a fuzz test. See examples here: https://github.com/llvm/llvm-project/tree/main/libc/fuzzing/stdlib
>
> Why is that? Its really just checking that the runtime 1) returns the correct value and 2) doesn't return early.
> I can drop the detached aspect if thats getting in the way.
>
> The random values are seeded with with `srand(123)` which should make the test entirely deterministic.
I agree it is entirely deterministic. In which case, I would prefer a hand-crafted series without reliance on `[s]rand`. I am suggesting a fuzz test because you can do two things better: a) The test actually get a real random input. b) The test will get stress tested. But, if you eliminate the use of `[s]rand`, I will leave it up to you if you want to add a fuzz test at all.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148837/new/
https://reviews.llvm.org/D148837
More information about the libc-commits
mailing list