Lines Matching refs:expect
100 typeof(observed.lines) expect; in report_matches()
111 cur = expect[0]; in report_matches()
112 end = &expect[0][sizeof(expect[0]) - 1]; in report_matches()
136 cur = strchr(expect[0], '+'); in report_matches()
141 cur = expect[1]; in report_matches()
142 end = &expect[1][sizeof(expect[1]) - 1]; in report_matches()
172 ret = strstr(observed.lines[0], expect[0]) && strstr(observed.lines[1], expect[1]); in report_matches()
320 struct expect_report expect = { in test_out_of_bounds_read() local
339 expect.addr = buf - 1; in test_out_of_bounds_read()
340 READ_ONCE(*expect.addr); in test_out_of_bounds_read()
341 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_out_of_bounds_read()
345 expect.addr = buf + size; in test_out_of_bounds_read()
346 READ_ONCE(*expect.addr); in test_out_of_bounds_read()
347 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_out_of_bounds_read()
354 struct expect_report expect = { in test_out_of_bounds_write() local
363 expect.addr = buf - 1; in test_out_of_bounds_write()
364 WRITE_ONCE(*expect.addr, 42); in test_out_of_bounds_write()
365 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_out_of_bounds_write()
372 struct expect_report expect = { in test_use_after_free_read() local
379 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_use_after_free_read()
380 test_free(expect.addr); in test_use_after_free_read()
381 READ_ONCE(*expect.addr); in test_use_after_free_read()
382 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_use_after_free_read()
388 struct expect_report expect = { in test_double_free() local
394 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_double_free()
395 test_free(expect.addr); in test_double_free()
396 test_free(expect.addr); /* Double-free. */ in test_double_free()
397 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_double_free()
403 struct expect_report expect = { in test_invalid_addr_free() local
411 expect.addr = buf + 1; /* Free on invalid address. */ in test_invalid_addr_free()
412 test_free(expect.addr); /* Invalid address free. */ in test_invalid_addr_free()
414 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_invalid_addr_free()
420 struct expect_report expect = { in test_corruption() local
431 expect.addr = buf + size; in test_corruption()
432 WRITE_ONCE(*expect.addr, 42); in test_corruption()
434 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_corruption()
437 expect.addr = buf - 1; in test_corruption()
438 WRITE_ONCE(*expect.addr, 42); in test_corruption()
440 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_corruption()
457 struct expect_report expect = { in test_kmalloc_aligned_oob_read() local
481 expect.addr = buf + size + align; in test_kmalloc_aligned_oob_read()
482 READ_ONCE(*expect.addr); in test_kmalloc_aligned_oob_read()
483 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_kmalloc_aligned_oob_read()
491 struct expect_report expect = { in test_kmalloc_aligned_oob_write() local
502 expect.addr = buf + size; in test_kmalloc_aligned_oob_write()
503 WRITE_ONCE(*expect.addr, READ_ONCE(*expect.addr) + 1); in test_kmalloc_aligned_oob_write()
506 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_kmalloc_aligned_oob_write()
556 struct expect_report expect = { in test_init_on_free() local
567 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_init_on_free()
569 expect.addr[i] = i + 1; in test_init_on_free()
570 test_free(expect.addr); in test_init_on_free()
578 KUNIT_EXPECT_EQ(test, expect.addr[i], (char)0); in test_init_on_free()
581 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_init_on_free()
642 const struct expect_report expect = { in test_invalid_access() local
650 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_invalid_access()
657 struct expect_report expect = { in test_memcache_typesafe_by_rcu() local
666 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_memcache_typesafe_by_rcu()
667 *expect.addr = 42; in test_memcache_typesafe_by_rcu()
670 test_free(expect.addr); in test_memcache_typesafe_by_rcu()
671 KUNIT_EXPECT_EQ(test, *expect.addr, (char)42); in test_memcache_typesafe_by_rcu()
685 KUNIT_EXPECT_EQ(test, *expect.addr, (char)42); in test_memcache_typesafe_by_rcu()
686 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_memcache_typesafe_by_rcu()
693 const struct expect_report expect = { in test_krealloc() local
699 char *buf = expect.addr; in test_krealloc()
725 READ_ONCE(*expect.addr); /* Ensure krealloc() actually freed earlier KFENCE object. */ in test_krealloc()
726 KUNIT_ASSERT_TRUE(test, report_matches(&expect)); in test_krealloc()