summaryrefslogtreecommitdiff
path: root/tests/cocoa/test_ownership.m
diff options
context:
space:
mode:
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 {