mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-11 16:32:58 +00:00
tests/kms_fbc_crc: fix debugfs read
Commit47f6b1305ccompletely broke this test due to the fread() assertion. When we're reading the debugfs file we really don't care about how many bytes we read because the number is not constant and we just use strstr() later. Change the assertion to make it check for at least 1 byte read, just to make sure no one changes that again. Regression introduced by: commit47f6b1305cAuthor: Thomas Wood <thomas.wood@intel.com> Date: Wed Mar 25 16:42:57 2015 +0000 igt.cocci: check the return values of various functions Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
This commit is contained in:
+1
-1
@@ -197,7 +197,7 @@ static bool fbc_enabled(data_t *data)
|
||||
status = igt_debugfs_fopen("i915_fbc_status", "r");
|
||||
igt_assert(status);
|
||||
|
||||
igt_assert_eq(fread(str, sizeof(str) - 1, 1, status), 1);
|
||||
igt_assert(fread(str, 1, sizeof(str) - 1, status) > 0);
|
||||
fclose(status);
|
||||
return strstr(str, "FBC enabled") != NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user