Lines Matching refs:test

22 static void example_simple_test(struct kunit *test)  in example_simple_test()  argument
30 KUNIT_EXPECT_EQ(test, 1 + 1, 2); in example_simple_test()
37 static int example_test_init(struct kunit *test) in example_test_init() argument
39 kunit_info(test, "initializing\n"); in example_test_init()
48 static void example_test_exit(struct kunit *test) in example_test_exit() argument
50 kunit_info(test, "cleaning up\n"); in example_test_exit()
78 static void example_skip_test(struct kunit *test) in example_skip_test() argument
81 kunit_info(test, "You should not see a line below."); in example_skip_test()
84 kunit_skip(test, "this test should be skipped"); in example_skip_test()
87 KUNIT_FAIL(test, "You should not see this line."); in example_skip_test()
93 static void example_mark_skipped_test(struct kunit *test) in example_mark_skipped_test() argument
96 kunit_info(test, "You should see a line below."); in example_mark_skipped_test()
99 kunit_mark_skipped(test, "this test should be skipped"); in example_mark_skipped_test()
102 kunit_info(test, "You should see this line."); in example_mark_skipped_test()
108 static void example_all_expect_macros_test(struct kunit *test) in example_all_expect_macros_test() argument
114 KUNIT_EXPECT_TRUE(test, true); in example_all_expect_macros_test()
115 KUNIT_EXPECT_FALSE(test, false); in example_all_expect_macros_test()
118 KUNIT_EXPECT_EQ(test, 1, 1); /* check == */ in example_all_expect_macros_test()
119 KUNIT_EXPECT_GE(test, 1, 1); /* check >= */ in example_all_expect_macros_test()
120 KUNIT_EXPECT_LE(test, 1, 1); /* check <= */ in example_all_expect_macros_test()
121 KUNIT_EXPECT_NE(test, 1, 0); /* check != */ in example_all_expect_macros_test()
122 KUNIT_EXPECT_GT(test, 1, 0); /* check > */ in example_all_expect_macros_test()
123 KUNIT_EXPECT_LT(test, 0, 1); /* check < */ in example_all_expect_macros_test()
126 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, test); in example_all_expect_macros_test()
127 KUNIT_EXPECT_PTR_EQ(test, NULL, NULL); in example_all_expect_macros_test()
128 KUNIT_EXPECT_PTR_NE(test, test, NULL); in example_all_expect_macros_test()
129 KUNIT_EXPECT_NULL(test, NULL); in example_all_expect_macros_test()
130 KUNIT_EXPECT_NOT_NULL(test, test); in example_all_expect_macros_test()
133 KUNIT_EXPECT_STREQ(test, "hi", "hi"); in example_all_expect_macros_test()
134 KUNIT_EXPECT_STRNEQ(test, "hi", "bye"); in example_all_expect_macros_test()
137 KUNIT_EXPECT_MEMEQ(test, array1, array1, sizeof(array1)); in example_all_expect_macros_test()
138 KUNIT_EXPECT_MEMNEQ(test, array1, array2, sizeof(array1)); in example_all_expect_macros_test()
144 KUNIT_ASSERT_GT(test, sizeof(char), 0); in example_all_expect_macros_test()
150 KUNIT_EXPECT_GT_MSG(test, sizeof(int), 0, "Your ints are 0-bit?!"); in example_all_expect_macros_test()
151 KUNIT_ASSERT_GT_MSG(test, sizeof(int), 0, "Your ints are 0-bit?!"); in example_all_expect_macros_test()
184 static void example_static_stub_test(struct kunit *test) in example_static_stub_test() argument
187 KUNIT_EXPECT_EQ(test, add_one(1), 2); in example_static_stub_test()
190 kunit_activate_static_stub(test, add_one, subtract_one); in example_static_stub_test()
193 KUNIT_EXPECT_EQ(test, add_one(1), 0); in example_static_stub_test()
196 kunit_deactivate_static_stub(test, add_one); in example_static_stub_test()
197 KUNIT_EXPECT_EQ(test, add_one(1), 2); in example_static_stub_test()
208 static void example_static_stub_using_fn_ptr_test(struct kunit *test) in example_static_stub_using_fn_ptr_test() argument
211 KUNIT_EXPECT_EQ(test, add_one(1), 2); in example_static_stub_using_fn_ptr_test()
214 kunit_activate_static_stub(test, add_one_fn_ptr, subtract_one); in example_static_stub_using_fn_ptr_test()
217 KUNIT_EXPECT_EQ(test, add_one(1), 0); in example_static_stub_using_fn_ptr_test()
220 kunit_deactivate_static_stub(test, add_one_fn_ptr); in example_static_stub_using_fn_ptr_test()
221 KUNIT_EXPECT_EQ(test, add_one(1), 2); in example_static_stub_using_fn_ptr_test()
243 static void example_params_test(struct kunit *test) in example_params_test() argument
245 const struct example_param *param = test->param_value; in example_params_test()
248 KUNIT_ASSERT_NOT_NULL(test, param); in example_params_test()
252 kunit_skip(test, "unsupported param value %d", param->value); in example_params_test()
255 KUNIT_EXPECT_EQ(test, param->value % param->value, 0); in example_params_test()
261 static void example_priv_test(struct kunit *test) in example_priv_test() argument
264 KUNIT_ASSERT_NULL(test, test->priv); in example_priv_test()
267 test->priv = kunit_kzalloc(test, 1, GFP_KERNEL); in example_priv_test()
268 KUNIT_EXPECT_NOT_NULL(test, test->priv); in example_priv_test()
269 KUNIT_ASSERT_PTR_EQ(test, test->priv, kunit_get_current_test()->priv); in example_priv_test()
275 static void example_slow_test(struct kunit *test) in example_slow_test() argument
277 KUNIT_EXPECT_EQ(test, 1 + 1, 2); in example_slow_test()
348 static void __init example_init_test(struct kunit *test) in example_init_test() argument
350 KUNIT_EXPECT_EQ(test, init_add(1, 1), 2); in example_init_test()