summaryrefslogtreecommitdiff
path: root/tests/gem_mmap_gtt.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-14 18:02:46 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-14 18:02:46 +0200
commitb3880d3a969656b78fe246e5ca4dd5a4a2c70ef5 (patch)
tree471f1d9f81ec5299615cf59cb1787afac09a5367 /tests/gem_mmap_gtt.c
parentc3dd8a8c85b3e1a4329282cbe82fd7f387cd2643 (diff)
tests: roll out igt_fixture
Also sprinkle igt_assert and igt_require over the setup code to clean up code while at it. To avoid gcc getting upset about unitialized variables just move them out of main as global data (where they always get initialized to 0) - gcc can't see through our igt_fixture and igt_subtest maze properly. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_mmap_gtt.c')
-rw-r--r--tests/gem_mmap_gtt.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index f2dca9ee..d692822a 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -152,16 +152,17 @@ run_without_prefault(int fd,
igt_enable_prefault();
}
+int fd;
+
int main(int argc, char **argv)
{
- int fd;
-
if (igt_run_in_simulation())
OBJECT_SIZE = 1 * 1024 * 1024;
igt_subtest_init(argc, argv);
- fd = drm_open_any();
+ igt_fixture
+ fd = drm_open_any();
igt_subtest("copy")
test_copy(fd);
@@ -178,7 +179,8 @@ int main(int argc, char **argv)
igt_subtest("write-gtt-no-prefault")
run_without_prefault(fd, test_write_gtt);
- close(fd);
+ igt_fixture
+ close(fd);
igt_exit();
}