Lines Matching refs:test
14 static void kfifo_test_reset_should_clear_the_fifo(struct kunit *test) in kfifo_test_reset_should_clear_the_fifo() argument
21 KUNIT_EXPECT_EQ(test, kfifo_len(&my_fifo), 3); in kfifo_test_reset_should_clear_the_fifo()
25 KUNIT_EXPECT_EQ(test, kfifo_len(&my_fifo), 0); in kfifo_test_reset_should_clear_the_fifo()
26 KUNIT_EXPECT_TRUE(test, kfifo_is_empty(&my_fifo)); in kfifo_test_reset_should_clear_the_fifo()
29 static void kfifo_test_define_should_define_an_empty_fifo(struct kunit *test) in kfifo_test_define_should_define_an_empty_fifo() argument
33 KUNIT_EXPECT_TRUE(test, kfifo_initialized(&my_fifo)); in kfifo_test_define_should_define_an_empty_fifo()
34 KUNIT_EXPECT_TRUE(test, kfifo_is_empty(&my_fifo)); in kfifo_test_define_should_define_an_empty_fifo()
35 KUNIT_EXPECT_EQ(test, kfifo_len(&my_fifo), 0); in kfifo_test_define_should_define_an_empty_fifo()
38 static void kfifo_test_len_should_ret_n_of_stored_elements(struct kunit *test) in kfifo_test_len_should_ret_n_of_stored_elements() argument
47 KUNIT_EXPECT_EQ(test, kfifo_len(&my_fifo), 0); in kfifo_test_len_should_ret_n_of_stored_elements()
50 KUNIT_EXPECT_EQ(test, kfifo_len(&my_fifo), N_ELEMENTS); in kfifo_test_len_should_ret_n_of_stored_elements()
53 KUNIT_EXPECT_EQ(test, kfifo_len(&my_fifo), N_ELEMENTS * 2); in kfifo_test_len_should_ret_n_of_stored_elements()
56 KUNIT_EXPECT_EQ(test, kfifo_len(&my_fifo), 0); in kfifo_test_len_should_ret_n_of_stored_elements()
59 static void kfifo_test_put_should_insert_and_get_should_pop(struct kunit *test) in kfifo_test_put_should_insert_and_get_should_pop() argument
69 KUNIT_EXPECT_EQ(test, processed_elements, 0); in kfifo_test_put_should_insert_and_get_should_pop()
70 KUNIT_EXPECT_EQ(test, out_data, 0); in kfifo_test_put_should_insert_and_get_should_pop()
77 KUNIT_EXPECT_EQ(test, processed_elements, 1); in kfifo_test_put_should_insert_and_get_should_pop()
78 KUNIT_EXPECT_EQ(test, out_data, elements[i]); in kfifo_test_put_should_insert_and_get_should_pop()
82 static void kfifo_test_in_should_insert_multiple_elements(struct kunit *test) in kfifo_test_in_should_insert_multiple_elements() argument
94 KUNIT_EXPECT_EQ(test, processed_elements, 1); in kfifo_test_in_should_insert_multiple_elements()
95 KUNIT_EXPECT_EQ(test, out_data, in_buffer[i]); in kfifo_test_in_should_insert_multiple_elements()
99 static void kfifo_test_out_should_pop_multiple_elements(struct kunit *test) in kfifo_test_out_should_pop_multiple_elements() argument
111 KUNIT_EXPECT_EQ(test, copied_elements, 3); in kfifo_test_out_should_pop_multiple_elements()
114 KUNIT_EXPECT_EQ(test, out_buffer[i], in_buffer[i]); in kfifo_test_out_should_pop_multiple_elements()
115 KUNIT_EXPECT_TRUE(test, kfifo_is_empty(&my_fifo)); in kfifo_test_out_should_pop_multiple_elements()
118 static void kfifo_test_dec_init_should_define_an_empty_fifo(struct kunit *test) in kfifo_test_dec_init_should_define_an_empty_fifo() argument
125 KUNIT_EXPECT_FALSE(test, __is_kfifo_ptr(&my_fifo)); in kfifo_test_dec_init_should_define_an_empty_fifo()
127 KUNIT_EXPECT_TRUE(test, kfifo_initialized(&my_fifo)); in kfifo_test_dec_init_should_define_an_empty_fifo()
130 static void kfifo_test_define_should_equal_declare_init(struct kunit *test) in kfifo_test_define_should_equal_declare_init() argument
142 KUNIT_EXPECT_EQ(test, sizeof(my_fifo1), sizeof(my_fifo2)); in kfifo_test_define_should_equal_declare_init()
143 KUNIT_EXPECT_EQ(test, kfifo_initialized(&my_fifo1), in kfifo_test_define_should_equal_declare_init()
145 KUNIT_EXPECT_EQ(test, kfifo_is_empty(&my_fifo1), in kfifo_test_define_should_equal_declare_init()
149 static void kfifo_test_alloc_should_initiliaze_a_ptr_fifo(struct kunit *test) in kfifo_test_alloc_should_initiliaze_a_ptr_fifo() argument
157 KUNIT_EXPECT_FALSE(test, kfifo_initialized(&my_fifo)); in kfifo_test_alloc_should_initiliaze_a_ptr_fifo()
161 KUNIT_EXPECT_EQ_MSG(test, ret, 0, "Memory allocation should succeed"); in kfifo_test_alloc_should_initiliaze_a_ptr_fifo()
162 KUNIT_EXPECT_TRUE(test, kfifo_initialized(&my_fifo)); in kfifo_test_alloc_should_initiliaze_a_ptr_fifo()
168 static void kfifo_test_peek_should_not_remove_elements(struct kunit *test) in kfifo_test_peek_should_not_remove_elements() argument
177 KUNIT_EXPECT_EQ(test, processed_elements, 0); in kfifo_test_peek_should_not_remove_elements()
183 KUNIT_EXPECT_EQ(test, kfifo_len(&my_fifo), 3); in kfifo_test_peek_should_not_remove_elements()
186 KUNIT_EXPECT_EQ(test, processed_elements, 1); in kfifo_test_peek_should_not_remove_elements()
187 KUNIT_EXPECT_EQ(test, out_data, 3); in kfifo_test_peek_should_not_remove_elements()
189 KUNIT_EXPECT_EQ(test, kfifo_len(&my_fifo), 3); in kfifo_test_peek_should_not_remove_elements()
195 KUNIT_EXPECT_EQ(test, processed_elements, 1); in kfifo_test_peek_should_not_remove_elements()
196 KUNIT_EXPECT_EQ(test, out_data, 3); in kfifo_test_peek_should_not_remove_elements()
198 KUNIT_EXPECT_EQ(test, kfifo_len(&my_fifo), 3); in kfifo_test_peek_should_not_remove_elements()