Lines Matching +full:non +full:- +full:safety
1 // SPDX-License-Identifier: GPL-2.0
3 //! KUnit-based macros for Rust unit tests.
7 //! Reference: <https://docs.kernel.org/dev-tools/kunit/index.html>
11 /// Prints a KUnit error-level message.
16 // SAFETY: The format string is null-terminated and the `%pA` specifier matches the argument we in err()
27 /// Prints a KUnit info-level message.
32 // SAFETY: The format string is null-terminated and the `%pA` specifier matches the argument we in info()
60 static LINE: i32 = core::line!() as i32 - $diff;
63 // SAFETY: FFI call without safety requirements.
69 // `scripts/rustdoc_test_gen.rs`) or if some non-test code calls this macro by
81 " Failure not reported to KUnit since this is a non-KUnit task\n"
92 // SAFETY: There is only a static instance and in that one the pointer field points to
96 // SAFETY: There is only a static instance and in that one the pointer field points to
110 // SAFETY:
111 // - FFI call.
112 // - The `kunit_test` pointer is valid because we got it from
115 // - The string pointers (`file` and `condition` above) point to null-terminated
117 // - The function pointer (`format`) points to the proper function.
118 // - The pointers passed will remain valid since they point to `static`s.
119 // - The format string is allowed to be null.
120 // - There are, however, problems with this: first of all, this will end up stopping
139 // SAFETY: FFI call; the `test` pointer is valid because this hidden macro should only