From 5ef6ca21ab9e1cf4f69254234d190a634b777d52 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Wed, 14 Oct 2026 09:38:31 +0300 Subject: Remove deprecated Cocoa OpenGL and private compatibility APIs --- tests/common/test_surface_integration.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'tests/common/test_surface_integration.c') diff --git a/tests/common/test_surface_integration.c b/tests/common/test_surface_integration.c index 2752208..7cc938a 100644 --- a/tests/common/test_surface_integration.c +++ b/tests/common/test_surface_integration.c @@ -1,6 +1,7 @@ #define _POSIX_C_SOURCE 200809L #include #include +#include #include "common/backend.h" #include #include @@ -8,6 +9,9 @@ #include #include #include +#if YASL_HAS_COCOA +void yasl_test_frame_tick(struct yasl_surface *surface); +#endif static void drain(void) { yasl_event e;int n=0; @@ -32,6 +36,15 @@ int main(int argc,char **argv) yasl_surface *s=yasl_surface_create("CPU contract",96,80,YASL_SURFACE_CPU); if(!s){const char *why;yasl_get_error(&why);fprintf(stderr,"surface: %s native=%d\n",why,yasl_get_native_error());return 1;} assert(yasl_surface_backend(s)==backend); + if(backend==YASL_BACKEND_COCOA) { + assert(!(yasl_surface_features(s)&YASL_CAP_OPENGL)); + assert(!yasl_gl_surface_create("unsupported GL",64,64,0,NULL,NULL)); + assert(yasl_get_error(NULL)==YASL_ERROR_UNSUPPORTED); + assert(!yasl_gl_make_current(NULL)); + assert(yasl_get_error(NULL)==YASL_ERROR_UNSUPPORTED); + assert(!yasl_gl_get_proc_address("glClear")); + assert(yasl_get_error(NULL)==YASL_ERROR_UNSUPPORTED); + } /* The first events report the window size, then ask for a frame. */ yasl_event e;int fw=0,fh=0;bool window=false; for(int i=0;i<1000;i++) { @@ -79,7 +92,12 @@ int main(int argc,char **argv) assert(yasl_wait_event(&e,0)==1&&e.type==YASL_EVENT_DROP&&e.drop.action==YASL_DROP_LEAVE); yasl_surface_set_refresh_callback(s,refresh,NULL); assert(yasl_cpu_present(s)); - drain();assert(refreshes>0); +#if YASL_HAS_COCOA + yasl_test_frame_tick(s); +#endif + uint64_t deadline=yasl_private_loop_now_ns()+3000000000ull; + while(!refreshes && yasl_private_loop_now_ns()=0); + assert(refreshes>0); yasl_surface_set_refresh_callback(s,NULL,NULL); yasl_surface_destroy(s); assert(!yasl_set_backend(backend)); -- cgit v1.2.3