summaryrefslogtreecommitdiff
path: root/tests/cocoa/test_ownership.m
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/cocoa/test_ownership.m
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/cocoa/test_ownership.m')
-rw-r--r--tests/cocoa/test_ownership.m4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/cocoa/test_ownership.m b/tests/cocoa/test_ownership.m
index aa75b1c..168a47b 100644
--- a/tests/cocoa/test_ownership.m
+++ b/tests/cocoa/test_ownership.m
@@ -1,3 +1,4 @@
+#include "yasl/native.h"
#import <AppKit/AppKit.h>
#include "yasl/yasl.h"
#include <assert.h>
@@ -11,6 +12,9 @@ int main(void)
struct yasl_surface_spec spec = {.title = "Ownership test", .size = {160, 100}};
struct yasl_surface *s = yasl_surface_create_toplevel(d, &spec);
assert(s);
+ assert(yasl_display_get_native_handle(d) == (void *)NSApp);
+ NSWindow *window = (NSWindow *)yasl_surface_get_native_handle(s);
+ assert([window isKindOfClass:[NSWindow class]] && window.contentView);
struct yasl_input_event event;
while (yasl_surface_input_poll(s, &event)) {}
@autoreleasepool {