From 3b8af02be94a510e385f44d58c35c86bb89424a6 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Mon, 12 Oct 2026 08:41:51 +0300 Subject: refactor: simplify public API and isolate native extensions Separate loop/timer and native interoperability APIs from the portable surface header. Unify dispatch, geometry queries, and timer callbacks; keep framebuffer bookkeeping and frame clocks private, and hide implementation symbols. Update backends, documentation, examples, and API/integration coverage. Verify exports, strict C/C++ installed consumers, and normal plus ASan/UBSan suites. --- tests/test_api.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/test_api.cpp (limited to 'tests/test_api.cpp') diff --git a/tests/test_api.cpp b/tests/test_api.cpp new file mode 100644 index 0000000..70c4ff7 --- /dev/null +++ b/tests/test_api.cpp @@ -0,0 +1,27 @@ +#include "yasl/native.h" +#include "yasl/loop.h" +#include +#include +#include + +int main() +{ + yasl_timing timing = yasl_surface_timing(nullptr); + assert(timing.source == YASL_TIMING_UNKNOWN); + assert(yasl_scale_to_device(10.0, 240) == 20); + yasl_geometry geometry = yasl_surface_geometry(nullptr); + assert(geometry.scale_120 == YASL_SCALE_UNIT); + assert(!yasl_display_get_native_handle(nullptr)); + assert(!yasl_surface_get_native_handle(nullptr)); + yasl_native_frame native{}; + assert(!yasl_surface_get_native_frame(nullptr, nullptr, &native)); + + yasl_loop *loop = yasl_loop_create(); + assert(loop); + assert(yasl_loop_step(loop, 0) >= 0); + yasl_loop_destroy(loop); + + yasl_input_event event{}; + assert(!yasl_surface_input_poll(nullptr, &event)); + return 0; +} -- cgit v1.2.3