Lines Matching defs:test

4  * For each test case checks the presence (or absence) of generated reports.
13 #include <kunit/test.h>
51 * KMSAN report and related to the test.
64 /* Check if a report related to the test exists. */
70 /* Reset observed.available, so that the test can trigger another report. */
165 static void test_uninit_kmalloc(struct kunit *test)
170 kunit_info(test, "uninitialized kmalloc test (UMR report)\n");
173 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
179 static void test_init_kmalloc(struct kunit *test)
184 kunit_info(test, "initialized kmalloc test (no reports)\n");
188 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
192 static void test_init_kzalloc(struct kunit *test)
197 kunit_info(test, "initialized kzalloc test (no reports)\n");
200 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
204 static void test_uninit_stack_var(struct kunit *test)
209 kunit_info(test, "uninitialized stack variable (UMR report)\n");
211 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
215 static void test_init_stack_var(struct kunit *test)
220 kunit_info(test, "initialized stack variable (no reports)\n");
222 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
246 static void test_params(struct kunit *test)
259 kunit_info(test,
262 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
274 static void test_uninit_multiple_params(struct kunit *test)
280 kunit_info(test, "uninitialized local passed to fn (UMR report)\n");
282 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
298 static void test_uninit_kmsan_check_memory(struct kunit *test)
304 test,
309 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
316 static void test_init_kmsan_vmap_vunmap(struct kunit *test)
323 kunit_info(test, "pages initialized via vmap (no reports)\n");
340 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
347 static void test_init_vmalloc(struct kunit *test)
353 kunit_info(test, "vmalloc buffer can be initialized (no reports)\n");
361 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
365 static void test_uaf(struct kunit *test)
371 kunit_info(test, "use-after-free in kmalloc-ed buffer (UMR report)\n");
378 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
385 static void test_percpu_propagate(struct kunit *test)
390 kunit_info(test,
396 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
403 static void test_printk(struct kunit *test)
416 kunit_info(test, "uninit local passed to pr_info() (UMR report)\n");
418 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
429 static void test_init_memcpy(struct kunit *test)
437 test,
441 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
448 static void test_memcpy_aligned_to_aligned(struct kunit *test)
455 test,
459 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
467 * aligned 4-byte values. This test case checks that KMSAN correctly reports an
470 static void test_memcpy_aligned_to_unaligned(struct kunit *test)
477 test,
483 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
486 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
511 static void test_memcpy_initialized_gap(struct kunit *test)
518 test,
532 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
535 KUNIT_EXPECT_FALSE(test, report_matches(&expect));
538 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
541 /* Generate test cases for memset16(), memset32(), memset64(). */
543 static void test_memset##size(struct kunit *test) \
548 kunit_info(test, \
552 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); \
567 static void test_long_origin_chain(struct kunit *test)
575 test,
584 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
596 static void test_stackdepot_roundtrip(struct kunit *test)
603 kunit_info(test, "testing stackdepot roundtrip (no reports)\n");
610 KUNIT_EXPECT_TRUE(test, src_nentries == dst_nentries);
614 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
643 /* ===== End test cases ===== */
645 static int test_init(struct kunit *test)
658 static void test_exit(struct kunit *test)