public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: jeff.mcgee@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] tests/drv_getparams: Skip instead of fail on EINVAL
Date: Tue, 24 Mar 2015 11:30:57 -0700	[thread overview]
Message-ID: <1427221857-26716-1-git-send-email-jeff.mcgee@intel.com> (raw)

From: Jeff McGee <jeff.mcgee@intel.com>

Avoid failing on older kernels where the GETPARAM interfaces
don't exist.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89669
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 tests/drv_getparams.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/tests/drv_getparams.c b/tests/drv_getparams.c
index f383662..1861fb8 100644
--- a/tests/drv_getparams.c
+++ b/tests/drv_getparams.c
@@ -77,6 +77,7 @@ subslice_total(void)
 	int ret;
 
 	ret = getparam(LOCAL_I915_PARAM_SUBSLICE_TOTAL, (int*)&subslice_total);
+	igt_skip_on_f(ret == -EINVAL, "Interface not supported by kernel\n");
 
 	if (ret) {
 		/*
@@ -93,9 +94,7 @@ subslice_total(void)
 		 * fail them if we are here.
 		*/
 		} else {
-			igt_assert_neq(ret, EINVAL); /* request not recognized? */
-			igt_assert_neq(ret, ENODEV); /* device not supported? */
-			igt_assert_eq(ret, 0); /* other error? */
+			igt_assert_eq(ret, 0);
 		}
 	} else {
 		/*
@@ -115,6 +114,7 @@ eu_total(void)
 	int ret;
 
 	ret = getparam(LOCAL_I915_PARAM_EU_TOTAL, (int*)&eu_total);
+	igt_skip_on_f(ret == -EINVAL, "Interface not supported by kernel\n");
 
 	if (ret) {
 		/*
@@ -131,9 +131,7 @@ eu_total(void)
 		 * fail them if we are here.
 		*/
 		} else {
-			igt_assert_neq(ret, EINVAL); /* request not recognized? */
-			igt_assert_neq(ret, ENODEV); /* device not supported? */
-			igt_assert_eq(ret, 0); /* other error? */
+			igt_assert_eq(ret, 0);
 		}
 	} else {
 		/*
-- 
2.3.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2015-03-24 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 18:30 jeff.mcgee [this message]
2015-03-31 15:44 ` [PATCH i-g-t] tests/drv_getparams: Skip instead of fail on EINVAL Jeff McGee
2015-04-01  6:08   ` Daniel Vetter
2015-04-01 17:21     ` Jeff McGee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427221857-26716-1-git-send-email-jeff.mcgee@intel.com \
    --to=jeff.mcgee@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox