tests: test trying to detach a resource we never attached.

Just makes sure we don't corrupt memory of do anything dumb
macos/master
Dave Airlie 10 years ago
parent e4e889dfa5
commit 0e19ae8014
  1. 25
      tests/test_virgl_init.c

@ -135,6 +135,30 @@ START_TEST(virgl_init_egl_create_ctx_create_bind_res)
}
END_TEST
START_TEST(virgl_init_egl_create_ctx_create_unbind_no_bind)
{
int ret;
struct virgl_renderer_resource_create_args res;
test_cbs.version = 1;
ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs);
ck_assert_int_eq(ret, 0);
ret = virgl_renderer_context_create(1, strlen("test1"), "test1");
ck_assert_int_eq(ret, 0);
testvirgl_init_simple_1d_resource(&res, 1);
ret = virgl_renderer_resource_create(&res, NULL, 0);
ck_assert_int_eq(ret, 0);
virgl_renderer_ctx_detach_resource(1, res.handle);
virgl_renderer_resource_unref(1);
virgl_renderer_context_destroy(1);
virgl_renderer_cleanup(&mystruct);
}
END_TEST
START_TEST(virgl_init_egl_create_ctx_create_bind_res_leak)
{
int ret;
@ -316,6 +340,7 @@ Suite *virgl_init_suite(void)
tcase_add_test(tc_core, virgl_init_egl_create_ctx);
tcase_add_test(tc_core, virgl_init_egl_create_ctx_leak);
tcase_add_test(tc_core, virgl_init_egl_create_ctx_create_bind_res);
tcase_add_test(tc_core, virgl_init_egl_create_ctx_create_unbind_no_bind);
tcase_add_test(tc_core, virgl_init_egl_create_ctx_create_bind_res_leak);
tcase_add_test(tc_core, virgl_init_egl_create_ctx_reset);
tcase_add_test(tc_core, virgl_init_get_caps_set0);

Loading…
Cancel
Save