Lines Matching refs:expect

87 	typeof(observed.lines) expect;  in report_matches()  local
98 cur = expect[0]; in report_matches()
99 end = &expect[0][sizeof(expect[0]) - 1]; in report_matches()
123 cur = strchr(expect[0], '+'); in report_matches()
128 cur = expect[1]; in report_matches()
129 end = &expect[1][sizeof(expect[1]) - 1]; in report_matches()
156 ret = strstr(observed.lines[0], expect[0]) && strstr(observed.lines[1], expect[1]); in report_matches()
303 struct expect_report expect = { in test_out_of_bounds_read() local
322 expect.addr = buf - 1; in test_out_of_bounds_read()
323 READ_ONCE(*expect.addr); in test_out_of_bounds_read()
324 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_out_of_bounds_read()
328 expect.addr = buf + size; in test_out_of_bounds_read()
329 READ_ONCE(*expect.addr); in test_out_of_bounds_read()
330 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_out_of_bounds_read()
337 struct expect_report expect = { in test_out_of_bounds_write() local
346 expect.addr = buf - 1; in test_out_of_bounds_write()
347 WRITE_ONCE(*expect.addr, 42); in test_out_of_bounds_write()
348 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_out_of_bounds_write()
355 struct expect_report expect = { in test_use_after_free_read() local
362 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_use_after_free_read()
363 test_free(expect.addr); in test_use_after_free_read()
364 READ_ONCE(*expect.addr); in test_use_after_free_read()
365 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_use_after_free_read()
371 struct expect_report expect = { in test_double_free() local
377 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_double_free()
378 test_free(expect.addr); in test_double_free()
379 test_free(expect.addr); /* Double-free. */ in test_double_free()
380 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_double_free()
386 struct expect_report expect = { in test_invalid_addr_free() local
394 expect.addr = buf + 1; /* Free on invalid address. */ in test_invalid_addr_free()
395 test_free(expect.addr); /* Invalid address free. */ in test_invalid_addr_free()
397 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_invalid_addr_free()
403 struct expect_report expect = { in test_corruption() local
414 expect.addr = buf + size; in test_corruption()
415 WRITE_ONCE(*expect.addr, 42); in test_corruption()
417 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_corruption()
420 expect.addr = buf - 1; in test_corruption()
421 WRITE_ONCE(*expect.addr, 42); in test_corruption()
423 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_corruption()
440 struct expect_report expect = { in test_kmalloc_aligned_oob_read() local
464 expect.addr = buf + size + align; in test_kmalloc_aligned_oob_read()
465 READ_ONCE(*expect.addr); in test_kmalloc_aligned_oob_read()
466 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_kmalloc_aligned_oob_read()
474 struct expect_report expect = { in test_kmalloc_aligned_oob_write() local
485 expect.addr = buf + size; in test_kmalloc_aligned_oob_write()
486 WRITE_ONCE(*expect.addr, READ_ONCE(*expect.addr) + 1); in test_kmalloc_aligned_oob_write()
489 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_kmalloc_aligned_oob_write()
539 struct expect_report expect = { in test_init_on_free() local
551 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_init_on_free()
553 expect.addr[i] = i + 1; in test_init_on_free()
554 test_free(expect.addr); in test_init_on_free()
562 KUNIT_EXPECT_EQ(test, expect.addr[i], (char)0); in test_init_on_free()
565 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_init_on_free()
628 const struct expect_report expect = { in test_invalid_access() local
636 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_invalid_access()
643 struct expect_report expect = { in test_memcache_typesafe_by_rcu() local
652 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY); in test_memcache_typesafe_by_rcu()
653 *expect.addr = 42; in test_memcache_typesafe_by_rcu()
656 test_free(expect.addr); in test_memcache_typesafe_by_rcu()
657 KUNIT_EXPECT_EQ(test, *expect.addr, (char)42); in test_memcache_typesafe_by_rcu()
671 KUNIT_EXPECT_EQ(test, *expect.addr, (char)42); in test_memcache_typesafe_by_rcu()
672 KUNIT_EXPECT_TRUE(test, report_matches(&expect)); in test_memcache_typesafe_by_rcu()
679 const struct expect_report expect = { in test_krealloc() local
685 char *buf = expect.addr; in test_krealloc()
711 READ_ONCE(*expect.addr); /* Ensure krealloc() actually freed earlier KFENCE object. */ in test_krealloc()
712 KUNIT_ASSERT_TRUE(test, report_matches(&expect)); in test_krealloc()