|
|
@ -32,6 +32,7 @@ |
|
|
|
#include <virglrenderer.h> |
|
|
|
#include <virglrenderer.h> |
|
|
|
|
|
|
|
|
|
|
|
#include "testvirgl.h" |
|
|
|
#include "testvirgl.h" |
|
|
|
|
|
|
|
#include "virgl_hw.h" |
|
|
|
struct myinfo_struct { |
|
|
|
struct myinfo_struct { |
|
|
|
uint32_t test; |
|
|
|
uint32_t test; |
|
|
|
}; |
|
|
|
}; |
|
|
@ -178,6 +179,46 @@ START_TEST(virgl_init_egl_create_ctx_reset) |
|
|
|
} |
|
|
|
} |
|
|
|
END_TEST |
|
|
|
END_TEST |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
START_TEST(virgl_init_get_caps_set0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int ret; |
|
|
|
|
|
|
|
uint32_t max_ver, max_size; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_cbs.version = 1; |
|
|
|
|
|
|
|
ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); |
|
|
|
|
|
|
|
ck_assert_int_eq(ret, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virgl_renderer_get_cap_set(0, &max_ver, &max_size); |
|
|
|
|
|
|
|
ck_assert_int_eq(max_ver, 0); |
|
|
|
|
|
|
|
ck_assert_int_eq(max_size, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virgl_renderer_cleanup(&mystruct); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
END_TEST |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
START_TEST(virgl_init_get_caps_set1) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int ret; |
|
|
|
|
|
|
|
uint32_t max_ver, max_size; |
|
|
|
|
|
|
|
void *caps; |
|
|
|
|
|
|
|
test_cbs.version = 1; |
|
|
|
|
|
|
|
ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); |
|
|
|
|
|
|
|
ck_assert_int_eq(ret, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virgl_renderer_get_cap_set(1, &max_ver, &max_size); |
|
|
|
|
|
|
|
ck_assert_int_eq(max_ver, 1); |
|
|
|
|
|
|
|
ck_assert_int_ne(max_size, 0); |
|
|
|
|
|
|
|
ck_assert_int_eq(max_size, sizeof(struct virgl_caps_v1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
caps = malloc(max_size); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virgl_renderer_fill_caps(0, 0, caps); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
free(caps); |
|
|
|
|
|
|
|
virgl_renderer_cleanup(&mystruct); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
END_TEST |
|
|
|
|
|
|
|
|
|
|
|
Suite *virgl_init_suite(void) |
|
|
|
Suite *virgl_init_suite(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Suite *s; |
|
|
|
Suite *s; |
|
|
@ -195,6 +236,8 @@ Suite *virgl_init_suite(void) |
|
|
|
tcase_add_test(tc_core, virgl_init_egl_create_ctx_create_bind_res); |
|
|
|
tcase_add_test(tc_core, virgl_init_egl_create_ctx_create_bind_res); |
|
|
|
tcase_add_test(tc_core, virgl_init_egl_create_ctx_create_bind_res_leak); |
|
|
|
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_egl_create_ctx_reset); |
|
|
|
|
|
|
|
tcase_add_test(tc_core, virgl_init_get_caps_set0); |
|
|
|
|
|
|
|
tcase_add_test(tc_core, virgl_init_get_caps_set1); |
|
|
|
suite_add_tcase(s, tc_core); |
|
|
|
suite_add_tcase(s, tc_core); |
|
|
|
return s; |
|
|
|
return s; |
|
|
|
|
|
|
|
|
|
|
|