gem_lut_handle: Make the error checking explicit for LUT handling

What this test is interested in is the handling of the LUT for very
large arrays, irrespective of whether such batch are actually
executable. So adjust the pass/fail checks to be explicit in the error
they are looking for, so that we do not conflate memory/aperture
pressure as a failure in the LUT API.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65391
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-06-05 11:10:04 +01:00
parent 2e1c11546a
commit f1e9e300fa

View File

@ -171,7 +171,9 @@ static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsign
return ret;
}
#define fail(x) assert(x == -1 && errno == ENOENT)
#define _fail(x) ((x) == -1 && errno == ENOENT)
#define fail(x) assert(_fail(x))
#define pass(x) assert(!_fail(x))
int main(int argc, char **argv)
{
@ -194,15 +196,15 @@ int main(int argc, char **argv)
fail(exec(fd, handle, USE_LUT | BROKEN));
for (i = 2; i <= 65536; i *= 2) {
do_or_die(many_exec(fd, handle, i-1, i-1, NORMAL));
do_or_die(many_exec(fd, handle, i-1, i, NORMAL));
do_or_die(many_exec(fd, handle, i-1, i+1, NORMAL));
do_or_die(many_exec(fd, handle, i, i-1, NORMAL));
do_or_die(many_exec(fd, handle, i, i, NORMAL));
do_or_die(many_exec(fd, handle, i, i+1, NORMAL));
do_or_die(many_exec(fd, handle, i+1, i-1, NORMAL));
do_or_die(many_exec(fd, handle, i+1, i, NORMAL));
do_or_die(many_exec(fd, handle, i+1, i+1, NORMAL));
pass(many_exec(fd, handle, i-1, i-1, NORMAL));
pass(many_exec(fd, handle, i-1, i, NORMAL));
pass(many_exec(fd, handle, i-1, i+1, NORMAL));
pass(many_exec(fd, handle, i, i-1, NORMAL));
pass(many_exec(fd, handle, i, i, NORMAL));
pass(many_exec(fd, handle, i, i+1, NORMAL));
pass(many_exec(fd, handle, i+1, i-1, NORMAL));
pass(many_exec(fd, handle, i+1, i, NORMAL));
pass(many_exec(fd, handle, i+1, i+1, NORMAL));
fail(many_exec(fd, handle, i-1, i-1, NORMAL | BROKEN));
fail(many_exec(fd, handle, i-1, i, NORMAL | BROKEN));
@ -214,15 +216,15 @@ int main(int argc, char **argv)
fail(many_exec(fd, handle, i+1, i, NORMAL | BROKEN));
fail(many_exec(fd, handle, i+1, i+1, NORMAL | BROKEN));
do_or_die(many_exec(fd, handle, i-1, i-1, USE_LUT));
do_or_die(many_exec(fd, handle, i-1, i, USE_LUT));
do_or_die(many_exec(fd, handle, i-1, i+1, USE_LUT));
do_or_die(many_exec(fd, handle, i, i-1, USE_LUT));
do_or_die(many_exec(fd, handle, i, i, USE_LUT));
do_or_die(many_exec(fd, handle, i, i+1, USE_LUT));
do_or_die(many_exec(fd, handle, i+1, i-1, USE_LUT));
do_or_die(many_exec(fd, handle, i+1, i, USE_LUT));
do_or_die(many_exec(fd, handle, i+1, i+1, USE_LUT));
pass(many_exec(fd, handle, i-1, i-1, USE_LUT));
pass(many_exec(fd, handle, i-1, i, USE_LUT));
pass(many_exec(fd, handle, i-1, i+1, USE_LUT));
pass(many_exec(fd, handle, i, i-1, USE_LUT));
pass(many_exec(fd, handle, i, i, USE_LUT));
pass(many_exec(fd, handle, i, i+1, USE_LUT));
pass(many_exec(fd, handle, i+1, i-1, USE_LUT));
pass(many_exec(fd, handle, i+1, i, USE_LUT));
pass(many_exec(fd, handle, i+1, i+1, USE_LUT));
fail(many_exec(fd, handle, i-1, i-1, USE_LUT | BROKEN));
fail(many_exec(fd, handle, i-1, i, USE_LUT | BROKEN));