Lines Matching refs:expect

100 	typeof(observed.lines) expect;  in report_matches()  local
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()
321 struct expect_report expect = { in test_out_of_bounds_read() local
340 expect.addr = buf - 1; in test_out_of_bounds_read()
341 READ_ONCE(*expect.addr); in test_out_of_bounds_read()
342 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_out_of_bounds_read()
346 expect.addr = buf + size; in test_out_of_bounds_read()
347 READ_ONCE(*expect.addr); in test_out_of_bounds_read()
348 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_out_of_bounds_read()
355 struct expect_report expect = { in test_out_of_bounds_write() local
364 expect.addr = buf - 1; in test_out_of_bounds_write()
365 WRITE_ONCE(*expect.addr, 42); in test_out_of_bounds_write()
366 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_out_of_bounds_write()
373 struct expect_report expect = { in test_use_after_free_read() local
380 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_use_after_free_read()
381 test_free(expect.addr); in test_use_after_free_read()
382 READ_ONCE(*expect.addr); in test_use_after_free_read()
383 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_use_after_free_read()
389 struct expect_report expect = { in test_double_free() local
395 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_double_free()
396 test_free(expect.addr); in test_double_free()
397 test_free(expect.addr); /* Double-free. */ in test_double_free()
398 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_double_free()
404 struct expect_report expect = { in test_invalid_addr_free() local
412 expect.addr = buf + 1; /* Free on invalid address. */ in test_invalid_addr_free()
413 test_free(expect.addr); /* Invalid address free. */ in test_invalid_addr_free()
415 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_invalid_addr_free()
421 struct expect_report expect = { in test_corruption() local
432 expect.addr = buf + size; in test_corruption()
433 WRITE_ONCE(*expect.addr, 42); in test_corruption()
435 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_corruption()
438 expect.addr = buf - 1; in test_corruption()
439 WRITE_ONCE(*expect.addr, 42); in test_corruption()
441 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_corruption()
458 struct expect_report expect = { in test_kmalloc_aligned_oob_read() local
482 expect.addr = buf + size + align; in test_kmalloc_aligned_oob_read()
483 READ_ONCE(*expect.addr); in test_kmalloc_aligned_oob_read()
484 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_kmalloc_aligned_oob_read()
492 struct expect_report expect = { in test_kmalloc_aligned_oob_write() local
503 expect.addr = buf + size; in test_kmalloc_aligned_oob_write()
504 WRITE_ONCE(*expect.addr, READ_ONCE(*expect.addr) + 1); in test_kmalloc_aligned_oob_write()
507 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_kmalloc_aligned_oob_write()
557 struct expect_report expect = { in test_init_on_free() local
568 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_init_on_free()
570 expect.addr[i] = i + 1; in test_init_on_free()
571 test_free(expect.addr); in test_init_on_free()
579 KUNIT_EXPECT_EQ(test, expect.addr[i], (char)0); in test_init_on_free()
582 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_init_on_free()
644 const struct expect_report expect = { in test_invalid_access() local
652 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_invalid_access()
659 struct expect_report expect = { in test_memcache_typesafe_by_rcu() local
668 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_memcache_typesafe_by_rcu()
669 *expect.addr = 42; in test_memcache_typesafe_by_rcu()
672 test_free(expect.addr); in test_memcache_typesafe_by_rcu()
673 KUNIT_EXPECT_EQ(test, *expect.addr, (char)42); in test_memcache_typesafe_by_rcu()
687 KUNIT_EXPECT_EQ(test, *expect.addr, (char)42); in test_memcache_typesafe_by_rcu()
688 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_memcache_typesafe_by_rcu()
695 const struct expect_report expect = { in test_krealloc() local
701 char *buf = expect.addr; in test_krealloc()
727 READ_ONCE(*expect.addr); /* Ensure krealloc() actually freed earlier KFENCE object. */ in test_krealloc()
728 KUNIT_ASSERT_TRUE(test, report_matches(&expect)); in test_krealloc()