Message ID | 1389999366-19715-2-git-send-email-jeff.mcgee@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/tests/pm_rps.c b/tests/pm_rps.c index 7c739b6..ec07dd2 100644 --- a/tests/pm_rps.c +++ b/tests/pm_rps.c @@ -68,15 +68,20 @@ static int readval(FILE *filp) static int do_writeval(FILE *filp, int val, int lerrno) { - int ret; + int ret, orig; + + orig = readval(filp); rewind(filp); ret = fprintf(filp, "%d", val); + if (lerrno) { /* Expecting specific error */ igt_assert(ret == EOF && errno == lerrno); + igt_assert(readval(filp) == orig); } else { /* Expecting no error */ igt_assert(ret != EOF); + igt_assert(readval(filp) == val); } return ret;