mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 00:56:20 +01:00
Add a kunit_fail_current_test() function to fail the currently running
test, if any, with an error message.
This is largely intended for dynamic analysis tools like UBSAN and for
fakes.
E.g. say I had a fake ops struct for testing and I wanted my `free`
function to complain if it was called with an invalid argument, or
caught a double-free. Most return void and have no normal means of
signalling failure (e.g. super_operations, iommu_ops, etc.).
Key points:
* Always update current->kunit_test so anyone can use it.
* commit
|
||
|---|---|---|
| .. | ||
| assert.h | ||
| test-bug.h | ||
| test.h | ||
| try-catch.h | ||