core: Improve phrasing for test requirements

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-07-25 14:28:51 +01:00
parent 72b1263649
commit e0dffbdeda
2 changed files with 7 additions and 4 deletions

View File

@ -648,12 +648,12 @@ void __igt_skip_check(const char *file, const int line,
va_end(args);
igt_skip("Test requirement not met in function %s, file %s:%i:\n"
"Test requirement: (%s)\n%s"
"Test requirement: %s\n%s"
"%s",
func, file, line, check, buf, err_str ?: "");
} else {
igt_skip("Test requirement not met in function %s, file %s:%i:\n"
"Test requirement: (%s)\n"
"Test requirement: %s\n"
"%s",
func, file, line, check, err_str ?: "");
}

View File

@ -307,7 +307,10 @@ void igt_exit(void) __attribute__((noreturn));
* skipping. This is useful to streamline the skip logic since it allows for a more flat
* code control flow, similar to igt_assert()
*/
#define igt_require(expr) igt_skip_on(!(expr))
#define igt_require(expr) \
do { if (!(expr)) \
__igt_skip_check(__FILE__, __LINE__, __func__, #expr , NULL); \
} while (0)
/**
* igt_skip_on:
@ -321,7 +324,7 @@ void igt_exit(void) __attribute__((noreturn));
*/
#define igt_skip_on(expr) \
do { if ((expr)) \
__igt_skip_check(__FILE__, __LINE__, __func__, #expr , NULL); \
__igt_skip_check(__FILE__, __LINE__, __func__, "!(" #expr ")" , NULL); \
} while (0)
/**