Lines Matching full:test

6 #include <kunit/test.h>
10 static void pe_test_uints(struct kunit *test) in pe_test_uints() argument
28 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, node); in pe_test_uints()
31 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints()
32 KUNIT_EXPECT_EQ(test, (int)val_u8, 8); in pe_test_uints()
35 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints()
36 KUNIT_EXPECT_EQ(test, (int)array_u8[0], 8); in pe_test_uints()
39 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
42 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
45 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
48 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints()
49 KUNIT_EXPECT_EQ(test, (int)val_u16, 16); in pe_test_uints()
52 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints()
53 KUNIT_EXPECT_EQ(test, (int)array_u16[0], 16); in pe_test_uints()
56 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
59 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
62 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
65 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints()
66 KUNIT_EXPECT_EQ(test, (int)val_u32, 32); in pe_test_uints()
69 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints()
70 KUNIT_EXPECT_EQ(test, (int)array_u32[0], 32); in pe_test_uints()
73 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
76 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
79 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
82 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints()
83 KUNIT_EXPECT_EQ(test, (int)val_u64, 64); in pe_test_uints()
86 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints()
87 KUNIT_EXPECT_EQ(test, (int)array_u64[0], 64); in pe_test_uints()
90 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
93 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
96 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints()
101 static void pe_test_uint_arrays(struct kunit *test) in pe_test_uint_arrays() argument
123 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, node); in pe_test_uint_arrays()
126 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
127 KUNIT_EXPECT_EQ(test, (int)val_u8, 8); in pe_test_uint_arrays()
130 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
131 KUNIT_EXPECT_EQ(test, (int)array_u8[0], 8); in pe_test_uint_arrays()
134 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
135 KUNIT_EXPECT_EQ(test, (int)array_u8[0], 8); in pe_test_uint_arrays()
136 KUNIT_EXPECT_EQ(test, (int)array_u8[1], 9); in pe_test_uint_arrays()
139 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
142 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
145 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
148 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
149 KUNIT_EXPECT_EQ(test, (int)val_u16, 16); in pe_test_uint_arrays()
152 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
153 KUNIT_EXPECT_EQ(test, (int)array_u16[0], 16); in pe_test_uint_arrays()
156 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
157 KUNIT_EXPECT_EQ(test, (int)array_u16[0], 16); in pe_test_uint_arrays()
158 KUNIT_EXPECT_EQ(test, (int)array_u16[1], 17); in pe_test_uint_arrays()
161 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
164 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
167 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
170 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
171 KUNIT_EXPECT_EQ(test, (int)val_u32, 32); in pe_test_uint_arrays()
174 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
175 KUNIT_EXPECT_EQ(test, (int)array_u32[0], 32); in pe_test_uint_arrays()
178 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
179 KUNIT_EXPECT_EQ(test, (int)array_u32[0], 32); in pe_test_uint_arrays()
180 KUNIT_EXPECT_EQ(test, (int)array_u32[1], 33); in pe_test_uint_arrays()
183 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
186 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
189 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
192 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
193 KUNIT_EXPECT_EQ(test, (int)val_u64, 64); in pe_test_uint_arrays()
196 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
197 KUNIT_EXPECT_EQ(test, (int)array_u64[0], 64); in pe_test_uint_arrays()
200 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uint_arrays()
201 KUNIT_EXPECT_EQ(test, (int)array_u64[0], 64); in pe_test_uint_arrays()
202 KUNIT_EXPECT_EQ(test, (int)array_u64[1], 65); in pe_test_uint_arrays()
205 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
208 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
211 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uint_arrays()
216 static void pe_test_strings(struct kunit *test) in pe_test_strings() argument
236 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, node); in pe_test_strings()
239 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_strings()
240 KUNIT_EXPECT_STREQ(test, str, "single"); in pe_test_strings()
243 KUNIT_EXPECT_EQ(test, error, 1); in pe_test_strings()
244 KUNIT_EXPECT_STREQ(test, strs[0], "single"); in pe_test_strings()
248 KUNIT_EXPECT_EQ(test, error, 1); in pe_test_strings()
249 KUNIT_EXPECT_STREQ(test, strs[0], "single"); in pe_test_strings()
252 KUNIT_EXPECT_NE(test, error, 0); in pe_test_strings()
255 KUNIT_EXPECT_LT(test, error, 0); in pe_test_strings()
258 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_strings()
259 KUNIT_EXPECT_STREQ(test, str, ""); in pe_test_strings()
262 KUNIT_EXPECT_EQ(test, error, 2); in pe_test_strings()
263 KUNIT_EXPECT_STREQ(test, strs[0], "string-a"); in pe_test_strings()
264 KUNIT_EXPECT_STREQ(test, strs[1], "string-b"); in pe_test_strings()
267 KUNIT_EXPECT_EQ(test, error, 1); in pe_test_strings()
268 KUNIT_EXPECT_STREQ(test, strs[0], "string-a"); in pe_test_strings()
272 KUNIT_EXPECT_EQ(test, error, 2); in pe_test_strings()
276 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_strings()
277 KUNIT_EXPECT_STREQ(test, str, "string-a"); in pe_test_strings()
282 static void pe_test_bool(struct kunit *test) in pe_test_bool() argument
292 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, node); in pe_test_bool()
294 KUNIT_EXPECT_TRUE(test, fwnode_property_read_bool(node, "prop")); in pe_test_bool()
295 KUNIT_EXPECT_FALSE(test, fwnode_property_read_bool(node, "not-prop")); in pe_test_bool()
301 static void pe_test_move_inline_u8(struct kunit *test) in pe_test_move_inline_u8() argument
315 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, copy); in pe_test_move_inline_u8()
317 KUNIT_EXPECT_TRUE(test, copy[0].is_inline); in pe_test_move_inline_u8()
319 KUNIT_EXPECT_EQ(test, (int)data_ptr[0], 1); in pe_test_move_inline_u8()
320 KUNIT_EXPECT_EQ(test, (int)data_ptr[1], 2); in pe_test_move_inline_u8()
322 KUNIT_EXPECT_FALSE(test, copy[1].is_inline); in pe_test_move_inline_u8()
324 KUNIT_EXPECT_EQ(test, (int)data_ptr[0], 5); in pe_test_move_inline_u8()
325 KUNIT_EXPECT_EQ(test, (int)data_ptr[1], 6); in pe_test_move_inline_u8()
331 static void pe_test_move_inline_str(struct kunit *test) in pe_test_move_inline_str() argument
347 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, copy); in pe_test_move_inline_str()
349 KUNIT_EXPECT_TRUE(test, copy[0].is_inline); in pe_test_move_inline_str()
350 KUNIT_EXPECT_STREQ(test, copy[0].value.str[0], "a"); in pe_test_move_inline_str()
352 KUNIT_EXPECT_FALSE(test, copy[1].is_inline); in pe_test_move_inline_str()
354 KUNIT_EXPECT_STREQ(test, data_ptr[0], "b"); in pe_test_move_inline_str()
355 KUNIT_EXPECT_STREQ(test, data_ptr[1], "c"); in pe_test_move_inline_str()
357 KUNIT_EXPECT_TRUE(test, copy[2].is_inline); in pe_test_move_inline_str()
358 KUNIT_EXPECT_STREQ(test, copy[2].value.str[0], ""); in pe_test_move_inline_str()
364 static void pe_test_reference(struct kunit *test) in pe_test_reference() argument
396 KUNIT_ASSERT_EQ(test, error, 0); in pe_test_reference()
399 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, node); in pe_test_reference()
403 KUNIT_ASSERT_EQ(test, error, 0); in pe_test_reference()
404 KUNIT_EXPECT_PTR_EQ(test, to_software_node(ref.fwnode), &nodes[0]); in pe_test_reference()
405 KUNIT_EXPECT_EQ(test, ref.nargs, 0U); in pe_test_reference()
410 KUNIT_EXPECT_NE(test, error, 0); in pe_test_reference()
414 KUNIT_ASSERT_EQ(test, error, 0); in pe_test_reference()
415 KUNIT_EXPECT_PTR_EQ(test, to_software_node(ref.fwnode), &nodes[1]); in pe_test_reference()
416 KUNIT_EXPECT_EQ(test, ref.nargs, 1U); in pe_test_reference()
417 KUNIT_EXPECT_EQ(test, ref.args[0], 1LLU); in pe_test_reference()
422 KUNIT_ASSERT_EQ(test, error, 0); in pe_test_reference()
423 KUNIT_EXPECT_PTR_EQ(test, to_software_node(ref.fwnode), &nodes[1]); in pe_test_reference()
424 KUNIT_EXPECT_EQ(test, ref.nargs, 3U); in pe_test_reference()
425 KUNIT_EXPECT_EQ(test, ref.args[0], 1LLU); in pe_test_reference()
426 KUNIT_EXPECT_EQ(test, ref.args[1], 2LLU); in pe_test_reference()
427 KUNIT_EXPECT_EQ(test, ref.args[2], 0LLU); in pe_test_reference()
432 KUNIT_EXPECT_NE(test, error, 0); in pe_test_reference()
437 KUNIT_ASSERT_EQ(test, error, 0); in pe_test_reference()
438 KUNIT_EXPECT_PTR_EQ(test, to_software_node(ref.fwnode), &nodes[0]); in pe_test_reference()
439 KUNIT_EXPECT_EQ(test, ref.nargs, 0U); in pe_test_reference()
444 KUNIT_ASSERT_EQ(test, error, 0); in pe_test_reference()
445 KUNIT_EXPECT_PTR_EQ(test, to_software_node(ref.fwnode), &nodes[1]); in pe_test_reference()
446 KUNIT_EXPECT_EQ(test, ref.nargs, 2U); in pe_test_reference()
447 KUNIT_EXPECT_EQ(test, ref.args[0], 3LLU); in pe_test_reference()
448 KUNIT_EXPECT_EQ(test, ref.args[1], 4LLU); in pe_test_reference()
453 KUNIT_EXPECT_NE(test, error, 0); in pe_test_reference()