diff options
author | Michel Thierry <michel.thierry@intel.com> | 2017-02-23 07:27:36 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-02-23 07:29:40 +0000 |
commit | d204f2d5df6d51dcfaf5e64e5a9876de753907e8 (patch) | |
tree | 84368631de98038a120a9f39c23ed3e42e55ae5d /tests/drv_hangman.c | |
parent | 5d037bd140eca13e1b71b9eaea80cea766b85965 (diff) |
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>
Diffstat (limited to 'tests/drv_hangman.c')
-rw-r--r-- | tests/drv_hangman.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c index bc20e70b..51bdbdaa 100644 --- a/tests/drv_hangman.c +++ b/tests/drv_hangman.c @@ -58,7 +58,7 @@ static void assert_entry(const char *s, bool expect) 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); |