From f7f37ee24ea8fbe8221c9a007562252ddab3647e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 4 Feb 2015 09:38:01 +1000 Subject: [PATCH] tests: add simple ctx init/fini handlers --- tests/testvirgl.c | 28 ++++++++++++++++++++++++++++ tests/testvirgl.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/tests/testvirgl.c b/tests/testvirgl.c index 77e99b9..cb910f3 100644 --- a/tests/testvirgl.c +++ b/tests/testvirgl.c @@ -43,3 +43,31 @@ void testvirgl_init_simple_1d_resource(struct virgl_renderer_resource_create_arg res->bind = PIPE_BIND_SAMPLER_VIEW; res->flags = 0; } + + +struct myinfo_struct { + uint32_t test; +}; + +static struct myinfo_struct mystruct; + +static struct virgl_renderer_callbacks test_cbs; + +int testvirgl_init_single_ctx(void) +{ + int ret; + + test_cbs.version = 1; + ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); + if (ret) + return ret; + ret = virgl_renderer_context_create(1, strlen("test1"), "test1"); + return ret; + +} + +void testvirgl_fini_single_ctx(void) +{ + virgl_renderer_context_destroy(1); + virgl_renderer_cleanup(&mystruct); +} diff --git a/tests/testvirgl.h b/tests/testvirgl.h index 60de354..aa75eb8 100644 --- a/tests/testvirgl.h +++ b/tests/testvirgl.h @@ -28,5 +28,7 @@ #include "virglrenderer.h" void testvirgl_init_simple_1d_resource(struct virgl_renderer_resource_create_args *args, int handle); +int testvirgl_init_single_ctx(void); +void testvirgl_fini_single_ctx(void); #endif