Thread (14 messages) 14 messages, 5 authors, 2021-03-18

Re: [igt-dev] [PATCH i-g-t 1/7] lib/drmtest: Use igt_assert_eq() for do_or_die()

From: Petri Latvala <hidden>
Date: 2021-03-18 09:32:54
Also in: nouveau

On Wed, Mar 17, 2021 at 06:49:43PM -0400, Lyude wrote:
From: Lyude Paul <lyude@redhat.com>

Noticed this while working on some nouveau tests, if we use igt_assert_eq()
here we'll output both the expected and returned value instead of just the
expected value.
igt_assert_eq stuffs x into an int so there's one difference.

Hmm, but generally do_or_die is used with ioctl() or something that
wraps it and it will be an int.

quoted hunk ↗ jump to hunk
Signed-off-by: Lyude Paul <lyude@redhat.com>
Cc: Martin Peres <redacted>
Cc: Ben Skeggs <redacted>
Cc: Jeremy Cline <redacted>
---
 lib/drmtest.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/drmtest.h b/lib/drmtest.h
index d393dbf1..789452ea 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -113,7 +113,7 @@ bool is_vc4_device(int fd);
  * that in any failure case the return value is non-zero and a precise error is
  * logged into errno. Uses igt_assert() internally.
A minor cosmetic change to this comment (igt_assert usage) is welcome.



Reviewed-by: Petri Latvala <redacted>

  */
-#define do_or_die(x) igt_assert((x) == 0)
+#define do_or_die(x) igt_assert_eq((x), 0)
 
 /**
  * do_ioctl:
-- 
2.29.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help