diff mbox

[1/3] pm_rps: Add read back checking on sysfs writes

Message ID 1389999366-19715-2-git-send-email-jeff.mcgee@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

jeff.mcgee@intel.com Jan. 17, 2014, 10:56 p.m. UTC
From: Jeff McGee <jeff.mcgee@intel.com>

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 tests/pm_rps.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox

Patch

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;