diff options
author | Eric Anholt <eric@anholt.net> | 2008-07-28 11:24:00 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-07-28 11:29:16 -0700 |
commit | 1bdf35fe19c1aa02b301375b3cae7ad29adacef8 (patch) | |
tree | b6f812c710413b560ffd0da6e6218b99f12d0919 /tests/gem_readwrite.c | |
parent | f85fd1b42dc2d77266007c02144d4f4f524e4157 (diff) |
intel-gem: Fix regression tests.
Main fix is an oops that was triggered by the gtt pwrite path when we don't
have the gtt initialized. Also, settle on -EBADF for "bad object handle",
and -EINVAL for "reading/writing beyond object boundary".
Diffstat (limited to 'tests/gem_readwrite.c')
-rw-r--r-- | tests/gem_readwrite.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/gem_readwrite.c b/tests/gem_readwrite.c index 54b25ea3..bd1d232b 100644 --- a/tests/gem_readwrite.c +++ b/tests/gem_readwrite.c @@ -94,6 +94,7 @@ int main(int argc, char **argv) printf("Testing read beyond end of buffer.\n"); ret = do_read(fd, handle, buf, OBJECT_SIZE / 2, OBJECT_SIZE); + printf("%d %d\n", ret, errno); assert(ret == -1 && errno == EINVAL); printf("Testing full write of buffer\n"); @@ -120,6 +121,14 @@ int main(int argc, char **argv) assert(ret == 0); assert(memcmp(buf, expected + 512, 1024) == 0); + printf("Testing read of bad buffer handle\n"); + ret = do_read(fd, 1234, buf, 0, 1024); + assert(ret == -1 && errno == EBADF); + + printf("Testing write of bad buffer handle\n"); + ret = do_write(fd, 1234, buf, 0, 1024); + assert(ret == -1 && errno == EBADF); + close(fd); return 0; |