igt/drv_hangman: Fix checking of strcasecmp against expectation
Comparing strcasecmp against a bool promotes the bool into an integer
and not force strcasecmp to be a bool. Since strcasecmp can return
negative or positive values for error (not a boolean!) we need to
convert into a boolean before comparing against our expectation.
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c
index bc20e70..51bdbda 100644
--- a/tests/drv_hangman.c
+++ b/tests/drv_hangman.c
@@ -58,7 +58,7 @@
error = igt_sysfs_get(sysfs, "error");
igt_assert(error);
- igt_assert_f(strcasecmp(error, s) != expect,
+ igt_assert_f(!!strcasecmp(error, s) != expect,
"contents of error: '%s' (expected %s '%s')\n",
error, expect ? "": "not", s);