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()
174 static void example_static_stub_test(struct kunit *test) in example_static_stub_test() argument
177 KUNIT_EXPECT_EQ(test, add_one(1), 2); in example_static_stub_test()
180 kunit_activate_static_stub(test, add_one, subtract_one); in example_static_stub_test()
183 KUNIT_EXPECT_EQ(test, add_one(1), 0); in example_static_stub_test()
186 kunit_deactivate_static_stub(test, add_one); in example_static_stub_test()
187 KUNIT_EXPECT_EQ(test, add_one(1), 2); in example_static_stub_test()
208 static void example_params_test(struct kunit *test) in example_params_test() argument
210 const struct example_param *param = test->param_value; in example_params_test()
213 KUNIT_ASSERT_NOT_NULL(test, param); in example_params_test()
217 kunit_skip(test, "unsupported param value"); in example_params_test()
220 KUNIT_EXPECT_EQ(test, param->value % param->value, 0); in example_params_test()
226 static void example_slow_test(struct kunit *test) in example_slow_test() argument
228 KUNIT_EXPECT_EQ(test, 1 + 1, 2); in example_slow_test()