summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@linux.intel.com>2013-02-05 12:26:49 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-02-05 12:02:37 +0100
commitb8e5965e8fb1820f5709a4762e04af5b183b0a2c (patch)
tree8c18047c085d1ef30530ba9f1c29d488d7d548ba /tests
parentf5c3e5811e2d29ee0c00dc4fc49ab776f247203f (diff)
tests/gem_ctx_exec: properly test destroy_ctx ioctl
Call context destroy with proper ioctl number and add test to verify that we can't post batchbuffers with destroyed context. Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_ctx_exec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/gem_ctx_exec.c b/tests/gem_ctx_exec.c
index 423f1eec..b0362cce 100644
--- a/tests/gem_ctx_exec.c
+++ b/tests/gem_ctx_exec.c
@@ -57,7 +57,7 @@ struct local_drm_i915_gem_context_destroy {
};
#define CONTEXT_CREATE_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2d, struct local_drm_i915_gem_context_create)
-#define CONTEXT_DESTROY_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x23, struct local_drm_i915_gem_context_destroy)
+#define CONTEXT_DESTROY_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2e, struct local_drm_i915_gem_context_destroy)
static uint32_t context_create(int fd)
{
@@ -135,5 +135,7 @@ int main(int argc, char *argv[])
assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0);
context_destroy(fd, ctx_id);
+ assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) < 0);
+
exit(EXIT_SUCCESS);
}