Lines Matching defs:test

9 #include <kunit/test.h>
21 kunit_skip(test, reason); \
259 KUNIT_EXPECT_EQ_MSG(test, _of, of, \
262 KUNIT_EXPECT_EQ_MSG(test, _r, r, \
267 KUNIT_EXPECT_EQ_MSG(test, _a_orig, _a_bump, "Unexpected " #op " macro side-effect!\n"); \
268 KUNIT_EXPECT_EQ_MSG(test, _b_orig, _b_bump, "Unexpected " #op " macro side-effect!\n"); \
272 static void do_test_ ## n(struct kunit *test, const struct test_ ## n *p) \
281 static void n ## _overflow_test(struct kunit *test) { \
291 do_test_ ## n(test, &n ## _tests[i]); \
292 kunit_info(test, "%zu %s arithmetic tests finished\n", \
343 KUNIT_EXPECT_EQ_MSG(test, __of, of, \
347 KUNIT_EXPECT_EQ_MSG(test, __d, __e, \
351 kunit_info(test, "got %lld\n", (s64)__d); \
353 kunit_info(test, "got %llu\n", (u64)__d); \
358 static void shift_sane_test(struct kunit *test)
404 kunit_info(test, "%d sane shift tests finished\n", count);
407 static void shift_overflow_test(struct kunit *test)
458 kunit_info(test, "%d overflow shift tests finished\n", count);
461 static void shift_truncate_test(struct kunit *test)
496 kunit_info(test, "%d truncate shift tests finished\n", count);
499 static void shift_nonsense_test(struct kunit *test)
533 * signed bit). So, for now, we will test this condition but
542 kunit_info(test, "%d nonsense shift tests finished\n", count);
563 static void test_ ## func (struct kunit *test, void *arg) \
569 /* Tiny allocation test. */ \
571 KUNIT_ASSERT_NOT_ERR_OR_NULL_MSG(test, ptr, \
575 /* Wrapped allocation test. */ \
578 KUNIT_ASSERT_NOT_ERR_OR_NULL_MSG(test, ptr, \
582 /* Saturated allocation test. */ \
586 KUNIT_FAIL(test, #func " missed saturation!\n"); \
609 static void overflow_allocation_test(struct kunit *test)
611 const char device_name[] = "overflow-test";
617 test_ ## alloc(test, dev); \
622 KUNIT_ASSERT_FALSE_MSG(test, IS_ERR(dev),
623 "Cannot register test device\n");
639 kunit_info(test, "%d allocation overflow tests finished\n", count);
649 static void overflow_size_helpers_test(struct kunit *test)
661 KUNIT_EXPECT_EQ(test, sizeof(ce_array), struct_size(obj, data, var));
665 KUNIT_EXPECT_EQ_MSG(test, _r, expected, \
735 kunit_info(test, "%d overflow size helper tests finished\n", count);
739 static void overflows_type_test(struct kunit *test)
746 KUNIT_EXPECT_EQ_MSG(test, __of, of, \
946 kunit_info(test, "%d overflows_type() tests finished\n", count);
951 static void same_type_test(struct kunit *test)
961 KUNIT_EXPECT_EQ(test, true, __same_type(t1, __t1h)); \
962 KUNIT_EXPECT_EQ(test, true, __same_type(t1, __t1l)); \
963 KUNIT_EXPECT_EQ(test, true, __same_type(__t1h, t1)); \
964 KUNIT_EXPECT_EQ(test, true, __same_type(__t1l, t1)); \
965 KUNIT_EXPECT_EQ(test, true, __same_type(t2, __t2h)); \
966 KUNIT_EXPECT_EQ(test, true, __same_type(t2, __t2l)); \
967 KUNIT_EXPECT_EQ(test, true, __same_type(__t2h, t2)); \
968 KUNIT_EXPECT_EQ(test, true, __same_type(__t2l, t2)); \
969 KUNIT_EXPECT_EQ(test, same, __same_type(t1, t2)); \
970 KUNIT_EXPECT_EQ(test, same, __same_type(t2, __t1h)); \
971 KUNIT_EXPECT_EQ(test, same, __same_type(t2, __t1l)); \
972 KUNIT_EXPECT_EQ(test, same, __same_type(__t1h, t2)); \
973 KUNIT_EXPECT_EQ(test, same, __same_type(__t1l, t2)); \
974 KUNIT_EXPECT_EQ(test, same, __same_type(t1, __t2h)); \
975 KUNIT_EXPECT_EQ(test, same, __same_type(t1, __t2l)); \
976 KUNIT_EXPECT_EQ(test, same, __same_type(__t2h, t1)); \
977 KUNIT_EXPECT_EQ(test, same, __same_type(__t2l, t1)); \
1011 KUNIT_EXPECT_EQ(test, var, 4);
1012 KUNIT_EXPECT_TRUE(test, __same_type(var++, int));
1013 KUNIT_EXPECT_EQ(test, var, 4);
1014 KUNIT_EXPECT_TRUE(test, __same_type(int, var++));
1015 KUNIT_EXPECT_EQ(test, var, 4);
1016 KUNIT_EXPECT_TRUE(test, __same_type(var++, var++));
1017 KUNIT_EXPECT_EQ(test, var, 4);
1019 kunit_info(test, "%d __same_type() tests finished\n", count);
1026 static void castable_to_type_test(struct kunit *test)
1032 KUNIT_EXPECT_EQ_MSG(test, __pass, pass, \
1110 kunit_info(test, "%d castable_to_type() tests finished\n", count);