Skip to main content

Module testing

Module testing 

Source
Expand description

Failures of thread starts that tests cause on purpose, only in builds with debug_assertions, which tests use and release builds lack.

fail_starts and fail_starts_named make the next attempts of the calling thread fail, and of the threads that it starts through the helper, which share the same count; threads that it starts otherwise, and every other thread, never meet them, so tests that run at once in one process never meet each other’s failures. fail_starts_in_process makes the next attempts of every thread of the process fail, for the kizz binary’s end-to-end test. An attempt that fails on purpose goes through the retries, which record its wait in the failures instead of sleeping.

Structs§

Injected
Failures that the calling thread, and the threads that it starts through the helper, meet until this is dropped; then the thread has the failures it had before.

Enums§

Failure
How an attempt that fails on purpose fails.

Constants§

EAGAIN
The error number of EAGAIN on Linux: the system cannot start a thread for the moment.

Functions§

fail_starts
Make the next count attempts to start a thread fail as failure says.
fail_starts_in_process
Make the next count attempts to start any thread of the process fail with EAGAIN, where the starting thread has no failures of its own.
fail_starts_named
Make the next count attempts to start a thread named name fail as failure says, and leave the starts of threads of other names alone.