-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add threadPool unit tests to fuzzer.c #2604
Conversation
aca15e0
to
092e6dc
Compare
int err; | ||
} threadPoolTests_compressionJob_payload; | ||
|
||
static void* threadPoolTests_compressionJob(void* payload) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/fuzzer.c:350:14: error: ‘threadPoolTests_compressionJob’ defined but not used [-Werror=unused-function]
350 | static void* threadPoolTests_compressionJob(void* payload) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
May need ZSTD_MULTITHREAD
too.
4a2ecee
to
7e0259e
Compare
tests/fuzzer.c
Outdated
@@ -3988,6 +4114,11 @@ int main(int argc, const char** argv) | |||
|
|||
if (nbTests < testNb) nbTests = testNb; | |||
|
|||
result = threadPoolTests(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This invocation of threadPoolTests()
could be done inside basicUnitTests()
.
It would make it similar to other unit tests, which can be skipped on demand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I've added it to the end of basicUnitTests()
.
7e0259e
to
92e9078
Compare
92e9078
to
1789c97
Compare
This PR adds
threadPool
API tests for basic functionality. We test pool re-use and simultaneous use (I think in practice these are pretty similar scenarios). It's gated behindZSTD_MULTITHREAD
.We add a dependency to
fuzzer.c
in order to give us access toZSTD_pthread_create/join
, (whichpoolTests.c
already includes too).