diff mbox

[i-g-t] tests/drv_getparams: Skip instead of fail on EINVAL

Message ID 1427221857-26716-1-git-send-email-jeff.mcgee@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

jeff.mcgee@intel.com March 24, 2015, 6:30 p.m. UTC
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(-)

Comments

jeff.mcgee@intel.com March 31, 2015, 3:44 p.m. UTC | #1
On Tue, Mar 24, 2015 at 11:30:57AM -0700, jeff.mcgee@intel.com wrote:
> 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>
> ---

This is very simple. Can we merge it?
-Jeff

>  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
>
Daniel Vetter April 1, 2015, 6:08 a.m. UTC | #2
On Tue, Mar 31, 2015 at 08:44:26AM -0700, Jeff McGee wrote:
> On Tue, Mar 24, 2015 at 11:30:57AM -0700, jeff.mcgee@intel.com wrote:
> > 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>
> > ---
> 
> This is very simple. Can we merge it?

I did one week ago, simply forgot to send out the confirmation mail. My mo
for checking for merged patches is to use

$ git pull --rebase

and see what's left (or something similar). At least git is a lot better
at tracking than me ;-)
-Daniel
jeff.mcgee@intel.com April 1, 2015, 5:21 p.m. UTC | #3
On Wed, Apr 01, 2015 at 08:08:28AM +0200, Daniel Vetter wrote:
> On Tue, Mar 31, 2015 at 08:44:26AM -0700, Jeff McGee wrote:
> > On Tue, Mar 24, 2015 at 11:30:57AM -0700, jeff.mcgee@intel.com wrote:
> > > 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>
> > > ---
> > 
> > This is very simple. Can we merge it?
> 
> I did one week ago, simply forgot to send out the confirmation mail. My mo
> for checking for merged patches is to use
> 
> $ git pull --rebase
> 
> and see what's left (or something similar). At least git is a lot better
> at tracking than me ;-)
> -Daniel

Oops. Yeah, you've spoiled me with the confirmation mail. I'll double
check in the code from here on. Thanks
-Jeff
diff mbox

Patch

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 {
 		/*