Lines Matching refs:stream

41 static char *get_str_from_stream(struct kunit *test, struct string_stream *stream)  in get_str_from_stream()  argument
43 char *str = string_stream_get_string(stream); in get_str_from_stream()
53 struct string_stream *stream; in kunit_test_assert_prologue() local
60 stream = kunit_alloc_string_stream(test, GFP_KERNEL); in kunit_test_assert_prologue()
61 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, stream); in kunit_test_assert_prologue()
64 kunit_assert_prologue(&location, KUNIT_EXPECTATION, stream); in kunit_test_assert_prologue()
65 str = get_str_from_stream(test, stream); in kunit_test_assert_prologue()
71 string_stream_clear(stream); in kunit_test_assert_prologue()
72 kunit_assert_prologue(&location, KUNIT_ASSERTION, stream); in kunit_test_assert_prologue()
73 str = get_str_from_stream(test, stream); in kunit_test_assert_prologue()
84 struct string_stream *stream, in verify_assert_print_msg() argument
94 string_stream_clear(stream); in verify_assert_print_msg()
95 kunit_assert_print_msg(&vformat, stream); in verify_assert_print_msg()
96 KUNIT_EXPECT_STREQ(test, get_str_from_stream(test, stream), expected); in verify_assert_print_msg()
101 struct string_stream *stream; in kunit_test_assert_print_msg() local
103 stream = kunit_alloc_string_stream(test, GFP_KERNEL); in kunit_test_assert_print_msg()
104 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, stream); in kunit_test_assert_print_msg()
106 verify_assert_print_msg(test, stream, "\nTest", "Test"); in kunit_test_assert_print_msg()
107 verify_assert_print_msg(test, stream, "\nAbacaba -123 234", "%s %d %u", in kunit_test_assert_print_msg()
109 verify_assert_print_msg(test, stream, "", NULL); in kunit_test_assert_print_msg()
120 struct string_stream *stream, int num_checks, ...) in validate_assert() argument
128 string_stream_clear(stream); in validate_assert()
129 format_func(assert, &message, stream); in validate_assert()
133 ASSERT_TEST_EXPECT_CONTAIN(test, get_str_from_stream(test, stream), cur_substr_exp); in validate_assert()
139 struct string_stream *stream; in kunit_test_unary_assert_format() local
147 stream = kunit_alloc_string_stream(test, GFP_KERNEL); in kunit_test_unary_assert_format()
148 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, stream); in kunit_test_unary_assert_format()
151 stream, 2, "true", "is false"); in kunit_test_unary_assert_format()
155 stream, 2, "false", "is true"); in kunit_test_unary_assert_format()
160 struct string_stream *stream; in kunit_test_ptr_not_err_assert_format() local
168 stream = kunit_alloc_string_stream(test, GFP_KERNEL); in kunit_test_ptr_not_err_assert_format()
169 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, stream); in kunit_test_ptr_not_err_assert_format()
174 stream, 1, "null"); in kunit_test_ptr_not_err_assert_format()
179 &not_err_assert.assert, stream, 2, in kunit_test_ptr_not_err_assert_format()
185 struct string_stream *stream; in kunit_test_binary_assert_format() local
199 stream = kunit_alloc_string_stream(test, GFP_KERNEL); in kunit_test_binary_assert_format()
200 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, stream); in kunit_test_binary_assert_format()
207 stream, 4, "1 + 2", "2", "3", "=="); in kunit_test_binary_assert_format()
211 stream, 3, "==", "1 + 2", "4 - 2"); in kunit_test_binary_assert_format()
215 stream, 4, "3", "4 - 2", "2", "=="); in kunit_test_binary_assert_format()
219 stream, 3, "3", "2", "=="); in kunit_test_binary_assert_format()
224 struct string_stream *stream; in kunit_test_binary_ptr_assert_format() local
253 stream = kunit_alloc_string_stream(test, GFP_KERNEL); in kunit_test_binary_ptr_assert_format()
254 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, stream); in kunit_test_binary_ptr_assert_format()
256 stream, 3, addr_var_a, addr_var_b, "=="); in kunit_test_binary_ptr_assert_format()
261 struct string_stream *stream; in kunit_test_binary_str_assert_format() local
277 stream = kunit_alloc_string_stream(test, GFP_KERNEL); in kunit_test_binary_str_assert_format()
278 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, stream); in kunit_test_binary_str_assert_format()
282 stream, 5, "var_a", "var_b", "\"abacaba\"", in kunit_test_binary_str_assert_format()
287 stream, 4, "\"abacaba\"", "var_b", "\"kernel\"", "=="); in kunit_test_binary_str_assert_format()
291 stream, 3, "\"abacaba\"", "\"kernel\"", "=="); in kunit_test_binary_str_assert_format()
304 struct string_stream *stream; in kunit_test_assert_hexdump() local
309 stream = kunit_alloc_string_stream(test, GFP_KERNEL); in kunit_test_assert_hexdump()
310 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, stream); in kunit_test_assert_hexdump()
312 kunit_assert_hexdump(stream, hex_testbuf1, hex_testbuf2, sizeof(hex_testbuf1)); in kunit_test_assert_hexdump()
313 str = get_str_from_stream(test, stream); in kunit_test_assert_hexdump()
320 string_stream_clear(stream); in kunit_test_assert_hexdump()
321 kunit_assert_hexdump(stream, hex_testbuf1, hex_testbuf1, sizeof(hex_testbuf1)); in kunit_test_assert_hexdump()
322 str = get_str_from_stream(test, stream); in kunit_test_assert_hexdump()
329 struct string_stream *stream; in kunit_test_mem_assert_format() local
347 stream = kunit_alloc_string_stream(test, GFP_KERNEL); in kunit_test_mem_assert_format()
348 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, stream); in kunit_test_mem_assert_format()
352 stream, 2, "hex_testbuf1", "is not null"); in kunit_test_mem_assert_format()
358 stream, 2, "hex_testbuf2", "is not null"); in kunit_test_mem_assert_format()
365 stream, 3, "hex_testbuf1", "hex_testbuf2", "=="); in kunit_test_mem_assert_format()