summaryrefslogtreecommitdiff
path: root/tests/test_api.cpp
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-12 08:41:51 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-12 08:41:51 +0300
commit3b8af02be94a510e385f44d58c35c86bb89424a6 (patch)
tree2573fb5ac41700d458109ee1cea4bfd875ecf1a2 /tests/test_api.cpp
parentf7fa0930cb46046f995fa1ab927aef62466e995e (diff)
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.
Diffstat (limited to 'tests/test_api.cpp')
-rw-r--r--tests/test_api.cpp27
1 files changed, 27 insertions, 0 deletions
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 <yasl/timing.h>
+#include <yasl/yasl.h>
+#include <cassert>
+
+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;
+}