| KTEST_GET_INPUT(9F) | Kernel Functions for Drivers | KTEST_GET_INPUT(9F) |
ktest_get_input —
get the input stream
#include
<sys/ktest.h>
void
ktest_get_input(const ktest_ctx_hdl_t
*ctx, uchar_t **bytes, size_t
*len);
Volatile - This interface is still evolving in illumos. API and ABI stability is not guaranteed.
The
ktest_get_input()
function is used to get a handle to the input stream passed to the test
along with its length.
This function panics when called on a context with no input stream.
This examples shows a test that verifies all bytes in the input stream are lowercase ASCII.
void
is_lower_ascii_test(ktest_ctx_hdl_t *ctx)
{
uchar_t *bytes = NULL;
size_t len = 0;
ktest_get_input(ctx, &bytes, &len);
for (size_t i = 0; i < len; i++) {
KT_ASSERT3U(bytes[i], >=, 'a', ctx);
KT_ASSERT3U(bytes[i], <=, 'z', ctx);
}
KT_PASS(ctx);
}
| February 15, 2023 | OmniOS |