[igt-dev] [PATCH i-g-t] tests/fbdev: Flip assertion for an unmet memchr()

Chris Wilson chris at chris-wilson.co.uk
Mon Nov 23 18:54:27 UTC 2020


The last unaligned test, looks for the target character in the tail of
the buffer, where it is not expected to be found. We should be asserting
that the memchr() returned NULL.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/fbdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/fbdev.c b/tests/fbdev.c
index 85d52b933..443a43dc1 100644
--- a/tests/fbdev.c
+++ b/tests/fbdev.c
@@ -140,7 +140,7 @@ static void framebuffer_tests(int fd)
 		pos = memchr(&buf[off + len],
 			     0x55,
 			     fix_info.smem_len - (off + len));
-		igt_assert_f(pos,
+		igt_assert_f(!pos,
 			     "found 0x55 at pos %zu, none expected\n",
 			     pos - buf);
 	}
@@ -197,7 +197,7 @@ static void framebuffer_tests(int fd)
 		pos = memchr(&map[off + len],
 			     0x55,
 			     fix_info.smem_len - (off + len));
-		igt_assert_f(pos,
+		igt_assert_f(!pos,
 			     "found 0x55 at pos %zu, none expected\n",
 			     pos - map);
 	}
-- 
2.29.2



More information about the igt-dev mailing list