[Intel-gfx] [PATCH i-g-t 2/4] gem_create: Test huge object creation as a basic test

Tvrtko Ursulin tursulin at ursulin.net
Thu Mar 30 16:58:07 UTC 2017


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

It is hard to imagine a more basic test than this one.

Also removed the skip on simulation since I don't know why
would that be needed here.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 tests/gem_create.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/gem_create.c b/tests/gem_create.c
index de7b82094545..f687b7b40be4 100644
--- a/tests/gem_create.c
+++ b/tests/gem_create.c
@@ -44,6 +44,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <getopt.h>
+#include <limits.h>
 
 #include <drm.h>
 
@@ -95,10 +96,13 @@ static void invalid_flag_test(int fd)
 
 static void invalid_size_test(int fd)
 {
-	int handle;
+	uint32_t handle;
 
 	handle = __gem_create(fd, 0);
 	igt_assert(!handle);
+
+	handle = __gem_create(fd, INT_MAX * 4096UL + 1);
+	igt_assert(!handle);
 }
 
 /*
@@ -146,8 +150,6 @@ igt_main
 {
 	int fd = -1;
 
-	igt_skip_on_simulation();
-
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 	}
@@ -155,7 +157,7 @@ igt_main
 	igt_subtest("stolen-invalid-flag")
 		invalid_flag_test(fd);
 
-	igt_subtest("create-invalid-size")
+	igt_subtest("basic-create-invalid-size")
 		invalid_size_test(fd);
 
 	igt_subtest("create-valid-nonaligned")
-- 
2.9.3



More information about the Intel-gfx mailing list