aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGert Wollny <gert.wollny@collabora.com>2023-07-24 13:11:22 +0200
committerMarge Bot <emma+marge@anholt.net>2024-04-11 20:18:55 +0000
commit3e17ee51f7b02ed0c7efc1f357f1b4b6876dbbe3 (patch)
tree9ffca53322819830c1da1e14ce39d7940d33b534
parent8dc53c1623f099480c72653b8a83cd2af8b6ff96 (diff)
downloadvirglrenderer-3e17ee51f7b02ed0c7efc1f357f1b4b6876dbbe3.tar.gz
tests: Don't use ck_assert when creating the context
Success of context creation is usually checked by the caller, so fix the one case where this is not done, and then remove the tests. With that we can use this context creation also outside the "check" environment, e.g. for fuzzing. Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1248>
-rw-r--r--tests/test_virgl_init.c3
-rw-r--r--tests/testvirgl.c9
2 files changed, 5 insertions, 7 deletions
diff --git a/tests/test_virgl_init.c b/tests/test_virgl_init.c
index a863a5b3..21a70545 100644
--- a/tests/test_virgl_init.c
+++ b/tests/test_virgl_init.c
@@ -176,7 +176,8 @@ END_TEST
START_TEST(virgl_init_egl_create_ctx_leak)
{
- testvirgl_init_single_ctx();
+ int ret = testvirgl_init_single_ctx();
+ ck_assert_int_eq(ret, 0);
/* don't destroy the context - leak it make sure cleanup catches it */
/*virgl_renderer_context_destroy(1);*/
diff --git a/tests/testvirgl.c b/tests/testvirgl.c
index aa2bf9ef..dda67d06 100644
--- a/tests/testvirgl.c
+++ b/tests/testvirgl.c
@@ -121,18 +121,15 @@ int testvirgl_init_single_ctx(void)
test_cbs.version = 1;
test_cbs.write_fence = testvirgl_write_fence;
ret = virgl_renderer_init(&mystruct, context_flags, &test_cbs);
- ck_assert_int_eq(ret, 0);
if (ret)
return ret;
- ret = virgl_renderer_context_create(1, strlen("test1"), "test1");
- ck_assert_int_eq(ret, 0);
- return ret;
-
+ return virgl_renderer_context_create(1, strlen("test1"), "test1");
}
void testvirgl_init_single_ctx_nr(void)
{
- testvirgl_init_single_ctx();
+ int ret = testvirgl_init_single_ctx();
+ ck_assert_int_eq(ret, 0);
}
void testvirgl_fini_single_ctx(void)