Lines Matching refs:test

99 	void (*run_case)(struct kunit *test);
174 int (*init)(struct kunit *test);
175 void (*exit)(struct kunit *test);
226 static inline void kunit_set_failure(struct kunit *test) in kunit_set_failure() argument
228 WRITE_ONCE(test->status, KUNIT_FAILURE); in kunit_set_failure()
233 void kunit_init_test(struct kunit *test, const char *name, char *log);
324 void *kunit_kmalloc_array(struct kunit *test, size_t n, size_t size, gfp_t gfp);
334 static inline void *kunit_kmalloc(struct kunit *test, size_t size, gfp_t gfp) in kunit_kmalloc() argument
336 return kunit_kmalloc_array(test, 1, size, gfp); in kunit_kmalloc()
344 void kunit_kfree(struct kunit *test, const void *ptr);
354 static inline void *kunit_kzalloc(struct kunit *test, size_t size, gfp_t gfp) in kunit_kzalloc() argument
356 return kunit_kmalloc(test, size, gfp | __GFP_ZERO); in kunit_kzalloc()
368 static inline void *kunit_kcalloc(struct kunit *test, size_t n, size_t size, gfp_t gfp) in kunit_kcalloc() argument
370 return kunit_kmalloc_array(test, n, size, gfp | __GFP_ZERO); in kunit_kcalloc()
373 void kunit_cleanup(struct kunit *test);
424 #define kunit_printk(lvl, test, fmt, ...) \ argument
425 kunit_log(lvl, test, KUNIT_SUBTEST_INDENT "# %s: " fmt, \
426 (test)->name, ##__VA_ARGS__)
437 #define kunit_info(test, fmt, ...) \ argument
438 kunit_printk(KERN_INFO, test, fmt, ##__VA_ARGS__)
448 #define kunit_warn(test, fmt, ...) \ argument
449 kunit_printk(KERN_WARNING, test, fmt, ##__VA_ARGS__)
459 #define kunit_err(test, fmt, ...) \ argument
460 kunit_printk(KERN_ERR, test, fmt, ##__VA_ARGS__)
470 #define KUNIT_SUCCEED(test) do {} while (0) argument
472 void kunit_do_failed_assertion(struct kunit *test,
479 #define _KUNIT_FAILED(test, assert_type, assert_class, assert_format, INITIALIZER, fmt, ...) do { \ argument
482 kunit_do_failed_assertion(test, \
492 #define KUNIT_FAIL_ASSERTION(test, assert_type, fmt, ...) \ argument
493 _KUNIT_FAILED(test, \
512 #define KUNIT_FAIL(test, fmt, ...) \ argument
513 KUNIT_FAIL_ASSERTION(test, \
518 #define KUNIT_UNARY_ASSERTION(test, \ argument
528 _KUNIT_FAILED(test, \
538 #define KUNIT_TRUE_MSG_ASSERTION(test, assert_type, condition, fmt, ...) \ argument
539 KUNIT_UNARY_ASSERTION(test, \
546 #define KUNIT_FALSE_MSG_ASSERTION(test, assert_type, condition, fmt, ...) \ argument
547 KUNIT_UNARY_ASSERTION(test, \
568 #define KUNIT_BASE_BINARY_ASSERTION(test, \ argument
589 _KUNIT_FAILED(test, \
600 #define KUNIT_BINARY_INT_ASSERTION(test, \ argument
607 KUNIT_BASE_BINARY_ASSERTION(test, \
615 #define KUNIT_BINARY_PTR_ASSERTION(test, \ argument
622 KUNIT_BASE_BINARY_ASSERTION(test, \
630 #define KUNIT_BINARY_STR_ASSERTION(test, \ argument
650 _KUNIT_FAILED(test, \
661 #define KUNIT_PTR_NOT_ERR_OR_NULL_MSG_ASSERTION(test, \ argument
672 _KUNIT_FAILED(test, \
692 #define KUNIT_EXPECT_TRUE(test, condition) \ argument
693 KUNIT_EXPECT_TRUE_MSG(test, condition, NULL)
695 #define KUNIT_EXPECT_TRUE_MSG(test, condition, fmt, ...) \ argument
696 KUNIT_TRUE_MSG_ASSERTION(test, \
711 #define KUNIT_EXPECT_FALSE(test, condition) \ argument
712 KUNIT_EXPECT_FALSE_MSG(test, condition, NULL)
714 #define KUNIT_EXPECT_FALSE_MSG(test, condition, fmt, ...) \ argument
715 KUNIT_FALSE_MSG_ASSERTION(test, \
732 #define KUNIT_EXPECT_EQ(test, left, right) \ argument
733 KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
735 #define KUNIT_EXPECT_EQ_MSG(test, left, right, fmt, ...) \ argument
736 KUNIT_BINARY_INT_ASSERTION(test, \
753 #define KUNIT_EXPECT_PTR_EQ(test, left, right) \ argument
754 KUNIT_EXPECT_PTR_EQ_MSG(test, left, right, NULL)
756 #define KUNIT_EXPECT_PTR_EQ_MSG(test, left, right, fmt, ...) \ argument
757 KUNIT_BINARY_PTR_ASSERTION(test, \
774 #define KUNIT_EXPECT_NE(test, left, right) \ argument
775 KUNIT_EXPECT_NE_MSG(test, left, right, NULL)
777 #define KUNIT_EXPECT_NE_MSG(test, left, right, fmt, ...) \ argument
778 KUNIT_BINARY_INT_ASSERTION(test, \
795 #define KUNIT_EXPECT_PTR_NE(test, left, right) \ argument
796 KUNIT_EXPECT_PTR_NE_MSG(test, left, right, NULL)
798 #define KUNIT_EXPECT_PTR_NE_MSG(test, left, right, fmt, ...) \ argument
799 KUNIT_BINARY_PTR_ASSERTION(test, \
816 #define KUNIT_EXPECT_LT(test, left, right) \ argument
817 KUNIT_EXPECT_LT_MSG(test, left, right, NULL)
819 #define KUNIT_EXPECT_LT_MSG(test, left, right, fmt, ...) \ argument
820 KUNIT_BINARY_INT_ASSERTION(test, \
837 #define KUNIT_EXPECT_LE(test, left, right) \ argument
838 KUNIT_EXPECT_LE_MSG(test, left, right, NULL)
840 #define KUNIT_EXPECT_LE_MSG(test, left, right, fmt, ...) \ argument
841 KUNIT_BINARY_INT_ASSERTION(test, \
858 #define KUNIT_EXPECT_GT(test, left, right) \ argument
859 KUNIT_EXPECT_GT_MSG(test, left, right, NULL)
861 #define KUNIT_EXPECT_GT_MSG(test, left, right, fmt, ...) \ argument
862 KUNIT_BINARY_INT_ASSERTION(test, \
879 #define KUNIT_EXPECT_GE(test, left, right) \ argument
880 KUNIT_EXPECT_GE_MSG(test, left, right, NULL)
882 #define KUNIT_EXPECT_GE_MSG(test, left, right, fmt, ...) \ argument
883 KUNIT_BINARY_INT_ASSERTION(test, \
900 #define KUNIT_EXPECT_STREQ(test, left, right) \ argument
901 KUNIT_EXPECT_STREQ_MSG(test, left, right, NULL)
903 #define KUNIT_EXPECT_STREQ_MSG(test, left, right, fmt, ...) \ argument
904 KUNIT_BINARY_STR_ASSERTION(test, \
921 #define KUNIT_EXPECT_STRNEQ(test, left, right) \ argument
922 KUNIT_EXPECT_STRNEQ_MSG(test, left, right, NULL)
924 #define KUNIT_EXPECT_STRNEQ_MSG(test, left, right, fmt, ...) \ argument
925 KUNIT_BINARY_STR_ASSERTION(test, \
940 #define KUNIT_EXPECT_NULL(test, ptr) \ argument
941 KUNIT_EXPECT_NULL_MSG(test, \
945 #define KUNIT_EXPECT_NULL_MSG(test, ptr, fmt, ...) \ argument
946 KUNIT_BINARY_PTR_ASSERTION(test, \
961 #define KUNIT_EXPECT_NOT_NULL(test, ptr) \ argument
962 KUNIT_EXPECT_NOT_NULL_MSG(test, \
966 #define KUNIT_EXPECT_NOT_NULL_MSG(test, ptr, fmt, ...) \ argument
967 KUNIT_BINARY_PTR_ASSERTION(test, \
983 #define KUNIT_EXPECT_NOT_ERR_OR_NULL(test, ptr) \ argument
984 KUNIT_EXPECT_NOT_ERR_OR_NULL_MSG(test, ptr, NULL)
986 #define KUNIT_EXPECT_NOT_ERR_OR_NULL_MSG(test, ptr, fmt, ...) \ argument
987 KUNIT_PTR_NOT_ERR_OR_NULL_MSG_ASSERTION(test, \
993 #define KUNIT_ASSERT_FAILURE(test, fmt, ...) \ argument
994 KUNIT_FAIL_ASSERTION(test, KUNIT_ASSERTION, fmt, ##__VA_ARGS__)
1007 #define KUNIT_ASSERT_TRUE(test, condition) \ argument
1008 KUNIT_ASSERT_TRUE_MSG(test, condition, NULL)
1010 #define KUNIT_ASSERT_TRUE_MSG(test, condition, fmt, ...) \ argument
1011 KUNIT_TRUE_MSG_ASSERTION(test, \
1026 #define KUNIT_ASSERT_FALSE(test, condition) \ argument
1027 KUNIT_ASSERT_FALSE_MSG(test, condition, NULL)
1029 #define KUNIT_ASSERT_FALSE_MSG(test, condition, fmt, ...) \ argument
1030 KUNIT_FALSE_MSG_ASSERTION(test, \
1046 #define KUNIT_ASSERT_EQ(test, left, right) \ argument
1047 KUNIT_ASSERT_EQ_MSG(test, left, right, NULL)
1049 #define KUNIT_ASSERT_EQ_MSG(test, left, right, fmt, ...) \ argument
1050 KUNIT_BINARY_INT_ASSERTION(test, \
1066 #define KUNIT_ASSERT_PTR_EQ(test, left, right) \ argument
1067 KUNIT_ASSERT_PTR_EQ_MSG(test, left, right, NULL)
1069 #define KUNIT_ASSERT_PTR_EQ_MSG(test, left, right, fmt, ...) \ argument
1070 KUNIT_BINARY_PTR_ASSERTION(test, \
1086 #define KUNIT_ASSERT_NE(test, left, right) \ argument
1087 KUNIT_ASSERT_NE_MSG(test, left, right, NULL)
1089 #define KUNIT_ASSERT_NE_MSG(test, left, right, fmt, ...) \ argument
1090 KUNIT_BINARY_INT_ASSERTION(test, \
1107 #define KUNIT_ASSERT_PTR_NE(test, left, right) \ argument
1108 KUNIT_ASSERT_PTR_NE_MSG(test, left, right, NULL)
1110 #define KUNIT_ASSERT_PTR_NE_MSG(test, left, right, fmt, ...) \ argument
1111 KUNIT_BINARY_PTR_ASSERTION(test, \
1127 #define KUNIT_ASSERT_LT(test, left, right) \ argument
1128 KUNIT_ASSERT_LT_MSG(test, left, right, NULL)
1130 #define KUNIT_ASSERT_LT_MSG(test, left, right, fmt, ...) \ argument
1131 KUNIT_BINARY_INT_ASSERTION(test, \
1147 #define KUNIT_ASSERT_LE(test, left, right) \ argument
1148 KUNIT_ASSERT_LE_MSG(test, left, right, NULL)
1150 #define KUNIT_ASSERT_LE_MSG(test, left, right, fmt, ...) \ argument
1151 KUNIT_BINARY_INT_ASSERTION(test, \
1168 #define KUNIT_ASSERT_GT(test, left, right) \ argument
1169 KUNIT_ASSERT_GT_MSG(test, left, right, NULL)
1171 #define KUNIT_ASSERT_GT_MSG(test, left, right, fmt, ...) \ argument
1172 KUNIT_BINARY_INT_ASSERTION(test, \
1189 #define KUNIT_ASSERT_GE(test, left, right) \ argument
1190 KUNIT_ASSERT_GE_MSG(test, left, right, NULL)
1192 #define KUNIT_ASSERT_GE_MSG(test, left, right, fmt, ...) \ argument
1193 KUNIT_BINARY_INT_ASSERTION(test, \
1209 #define KUNIT_ASSERT_STREQ(test, left, right) \ argument
1210 KUNIT_ASSERT_STREQ_MSG(test, left, right, NULL)
1212 #define KUNIT_ASSERT_STREQ_MSG(test, left, right, fmt, ...) \ argument
1213 KUNIT_BINARY_STR_ASSERTION(test, \
1230 #define KUNIT_ASSERT_STRNEQ(test, left, right) \ argument
1231 KUNIT_ASSERT_STRNEQ_MSG(test, left, right, NULL)
1233 #define KUNIT_ASSERT_STRNEQ_MSG(test, left, right, fmt, ...) \ argument
1234 KUNIT_BINARY_STR_ASSERTION(test, \
1249 #define KUNIT_ASSERT_NULL(test, ptr) \ argument
1250 KUNIT_ASSERT_NULL_MSG(test, \
1254 #define KUNIT_ASSERT_NULL_MSG(test, ptr, fmt, ...) \ argument
1255 KUNIT_BINARY_PTR_ASSERTION(test, \
1270 #define KUNIT_ASSERT_NOT_NULL(test, ptr) \ argument
1271 KUNIT_ASSERT_NOT_NULL_MSG(test, \
1275 #define KUNIT_ASSERT_NOT_NULL_MSG(test, ptr, fmt, ...) \ argument
1276 KUNIT_BINARY_PTR_ASSERTION(test, \
1292 #define KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr) \ argument
1293 KUNIT_ASSERT_NOT_ERR_OR_NULL_MSG(test, ptr, NULL)
1295 #define KUNIT_ASSERT_NOT_ERR_OR_NULL_MSG(test, ptr, fmt, ...) \ argument
1296 KUNIT_PTR_NOT_ERR_OR_NULL_MSG_ASSERTION(test, \