Lines Matching refs:expect

82 /* Information we expect in a report. */
101 typeof(observed.lines) expect;
112 cur = expect[0];
113 end = &expect[0][sizeof(expect[0]) - 1];
137 cur = strchr(expect[0], '+');
142 cur = expect[1];
143 end = &expect[1][sizeof(expect[1]) - 1];
173 ret = strstr(observed.lines[0], expect[0]) && strstr(observed.lines[1], expect[1]);
322 struct expect_report expect = {
341 expect.addr = buf - 1;
342 READ_ONCE(*expect.addr);
343 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
347 expect.addr = buf + size;
348 READ_ONCE(*expect.addr);
349 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
356 struct expect_report expect = {
365 expect.addr = buf - 1;
366 WRITE_ONCE(*expect.addr, 42);
367 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
374 struct expect_report expect = {
381 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY);
382 test_free(expect.addr);
383 READ_ONCE(*expect.addr);
384 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
406 struct expect_report expect = {
412 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY);
413 test_free(expect.addr);
414 test_free(expect.addr); /* Double-free. */
415 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
421 struct expect_report expect = {
429 expect.addr = buf + 1; /* Free on invalid address. */
430 test_free(expect.addr); /* Invalid address free. */
432 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
438 struct expect_report expect = {
449 expect.addr = buf + size;
450 WRITE_ONCE(*expect.addr, 42);
452 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
455 expect.addr = buf - 1;
456 WRITE_ONCE(*expect.addr, 42);
458 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
475 struct expect_report expect = {
499 expect.addr = buf + size + align;
500 READ_ONCE(*expect.addr);
501 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
509 struct expect_report expect = {
520 expect.addr = buf + size;
521 WRITE_ONCE(*expect.addr, READ_ONCE(*expect.addr) + 1);
524 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
574 struct expect_report expect = {
585 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY);
587 expect.addr[i] = i + 1;
588 test_free(expect.addr);
596 KUNIT_EXPECT_EQ(test, expect.addr[i], (char)0);
599 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
661 const struct expect_report expect = {
669 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
676 struct expect_report expect = {
685 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY);
686 *expect.addr = 42;
689 test_free(expect.addr);
690 KUNIT_EXPECT_EQ(test, *expect.addr, (char)42);
697 /* Above access to @expect.addr should not have generated a report! */
704 KUNIT_EXPECT_EQ(test, *expect.addr, (char)42);
705 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
712 const struct expect_report expect = {
718 char *buf = expect.addr;
744 READ_ONCE(*expect.addr); /* Ensure krealloc() actually freed earlier KFENCE object. */
745 KUNIT_ASSERT_TRUE(test, report_matches(&expect));