From 1ab3e5a123109704789c2768e11a4f9af515821d Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Wed, 14 Oct 2026 13:13:52 +0300 Subject: Redefine public and rendering APIs with explicit contracts --- tests/test_api.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'tests/test_api.cpp') diff --git a/tests/test_api.cpp b/tests/test_api.cpp index c0693eb..acfbbb8 100644 --- a/tests/test_api.cpp +++ b/tests/test_api.cpp @@ -19,8 +19,17 @@ int main() { yasl_event e{}; - e.pen.x=1.5;e.pen.pressure=0.25; - assert(e.pen.pressure==0.25); - assert(!yasl_surface_create("invalid",-1,10,0)); - yasl_shutdown();return 0; + e.pen.x = 1.5; + e.pen.pressure = 0.25; + assert(e.pen.pressure == 0.25); + yasl_surface_options options{}; + options.width = -1; + options.height = 10; + assert(!yasl_surface_create(&options) && errno == EINVAL); + yasl_gl_options gl = YASL_GL_OPTIONS_INIT; + assert(gl.major == 3 && gl.minor == 2 && gl.share == nullptr); + yasl_cpu_buffer buffer{}; + assert(yasl_cpu_acquire(nullptr, &buffer) == -ENODEV); + yasl_shutdown(); + return 0; } -- cgit v1.2.3