Lines Matching refs:expect
81 /* Information we expect in a report. */
100 typeof(observed.lines) expect;
111 cur = expect[0];
112 end = &expect[0][sizeof(expect[0]) - 1];
136 cur = strchr(expect[0], '+');
141 cur = expect[1];
142 end = &expect[1][sizeof(expect[1]) - 1];
172 ret = strstr(observed.lines[0], expect[0]) && strstr(observed.lines[1], expect[1]);
321 struct expect_report expect = {
340 expect.addr = buf - 1;
341 READ_ONCE(*expect.addr);
342 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
346 expect.addr = buf + size;
347 READ_ONCE(*expect.addr);
348 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
355 struct expect_report expect = {
364 expect.addr = buf - 1;
365 WRITE_ONCE(*expect.addr, 42);
366 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
373 struct expect_report expect = {
380 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY);
381 test_free(expect.addr);
382 READ_ONCE(*expect.addr);
383 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
389 struct expect_report expect = {
395 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY);
396 test_free(expect.addr);
397 test_free(expect.addr); /* Double-free. */
398 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
404 struct expect_report expect = {
412 expect.addr = buf + 1; /* Free on invalid address. */
413 test_free(expect.addr); /* Invalid address free. */
415 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
421 struct expect_report expect = {
432 expect.addr = buf + size;
433 WRITE_ONCE(*expect.addr, 42);
435 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
438 expect.addr = buf - 1;
439 WRITE_ONCE(*expect.addr, 42);
441 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
458 struct expect_report expect = {
482 expect.addr = buf + size + align;
483 READ_ONCE(*expect.addr);
484 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
492 struct expect_report expect = {
503 expect.addr = buf + size;
504 WRITE_ONCE(*expect.addr, READ_ONCE(*expect.addr) + 1);
507 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
557 struct expect_report expect = {
568 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY);
570 expect.addr[i] = i + 1;
571 test_free(expect.addr);
579 KUNIT_EXPECT_EQ(test, expect.addr[i], (char)0);
582 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
644 const struct expect_report expect = {
652 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
659 struct expect_report expect = {
668 expect.addr = test_alloc(test, size, GFP_KERNEL, ALLOCATE_ANY);
669 *expect.addr = 42;
672 test_free(expect.addr);
673 KUNIT_EXPECT_EQ(test, *expect.addr, (char)42);
680 /* Above access to @expect.addr should not have generated a report! */
687 KUNIT_EXPECT_EQ(test, *expect.addr, (char)42);
688 KUNIT_EXPECT_TRUE(test, report_matches(&expect));
695 const struct expect_report expect = {
701 char *buf = expect.addr;
727 READ_ONCE(*expect.addr); /* Ensure krealloc() actually freed earlier KFENCE object. */
728 KUNIT_ASSERT_TRUE(test, report_matches(&expect));