summaryrefslogtreecommitdiff
path: root/tests/common/test_selection.c
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-11 23:51:43 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-11 23:51:43 +0300
commite813252e685d761235ad45e170d97c9375f51958 (patch)
treee57bae545c0eb22aac4119a890b8344ee7cd09d2 /tests/common/test_selection.c
parent608b49052178ea74f593c925cdeedf352aa1c357 (diff)
parent6eac0a5f2c552728efca420b1129fae7d4fea773 (diff)
Merge branch 'backend-selection' into main
- Implement runtime backend selection (Wayland, X11, Cocoa) - Add native X11 backend with clipboard, keyboard, mouse, and placement - Integrate multi-backend integration tests running under Weston and Xwayland - Retain zero-hole struct packing, branchless ALU/LUT primitives, and paced event loop
Diffstat (limited to 'tests/common/test_selection.c')
-rw-r--r--tests/common/test_selection.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/common/test_selection.c b/tests/common/test_selection.c
new file mode 100644
index 0000000..d1b3eb8
--- /dev/null
+++ b/tests/common/test_selection.c
@@ -0,0 +1,34 @@
+#define _POSIX_C_SOURCE 200809L
+#include "yasl/yasl.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+
+int main(void)
+{
+ struct yasl_display_spec spec = {.backend = (enum yasl_backend)999};
+ errno = 0;
+ assert(!yasl_display_open(NULL, &spec));
+ assert(errno == EINVAL);
+ assert(yasl_display_backend(NULL) == YASL_BACKEND_AUTO);
+#if !YASL_HAS_COCOA
+ spec.backend = YASL_BACKEND_COCOA;
+ errno = 0;
+ assert(!yasl_display_open(NULL, &spec));
+ assert(errno == ENOSYS);
+#endif
+#if !YASL_HAS_WAYLAND
+ spec.backend = YASL_BACKEND_WAYLAND;
+ errno = 0;
+ assert(!yasl_display_open(NULL, &spec));
+ assert(errno == ENOSYS);
+#endif
+#if !YASL_HAS_X11
+ spec.backend = YASL_BACKEND_X11;
+ errno = 0;
+ assert(!yasl_display_open(NULL, &spec));
+ assert(errno == ENOSYS);
+#endif
+ return 0;
+}