summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-14 14:22:39 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-14 14:22:52 +0300
commitf277e6540b4183010b859f9e8e91941c14cf592f (patch)
tree5af7d47ff497d6534ec355471614830894b91dd5 /tests
parent2408acfac3acd22dc207d41daed82294de2f3275 (diff)
Require presses in X11 and integration tests
Integration tests now expect ESTALE from move, resize, window menu, drag and popups when nothing presses a button, and the X11 input test expects the same from the window menu and move. Resolving the previous commit's merge also made the direct SHM path check the window's own visual (possibly 32-bit ARGB) and dropped the held-button check from place_under_pointer, which yasl.h never asked for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/common/test_surface_integration.c12
-rw-r--r--tests/x11/test_input.c7
2 files changed, 13 insertions, 6 deletions
diff --git a/tests/common/test_surface_integration.c b/tests/common/test_surface_integration.c
index 887f254..1dca7c8 100644
--- a/tests/common/test_surface_integration.c
+++ b/tests/common/test_surface_integration.c
@@ -274,10 +274,12 @@ int main(int argc, char **argv)
assert(double_click >= 1 && double_click <= 10000);
assert(yasl_drag_cancel() == 0);
- /* Without a pointer press these may fail with an errno; they must simply return. */
- assert(yasl_surface_begin_move_resize(s, 0) <= 0);
- assert(yasl_surface_show_window_menu(s, 1, 1) <= 0);
- assert(yasl_drag_start(s, NULL) <= 0);
+ /* Nothing presses a button here, so calls that need a press report ESTALE. */
+ int no_press[] = {yasl_surface_begin_move_resize(s, 0),
+ yasl_surface_begin_move_resize(s, YASL_EDGE_BOTTOM | YASL_EDGE_RIGHT),
+ yasl_surface_show_window_menu(s, 1, 1), yasl_drag_start(s, NULL)};
+ for (size_t i = 0; i < sizeof(no_press) / sizeof(no_press[0]); i++)
+ assert(no_press[i] == -ESTALE || no_press[i] == -ENOTSUP);
drain();
/* A popup needs an input grab to open; if it opens, its parent owns it. */
@@ -288,7 +290,7 @@ int main(int argc, char **argv)
yasl_surface *popup = yasl_popup_create(s, &popup_options);
uintptr_t popup_id = (uintptr_t)popup;
if (!popup) {
- assert(errno != 0);
+ assert(errno == ESTALE);
} else {
assert(listed(display, popup_id));
assert(yasl_popup_reposition(popup, &popup_options) <= 0);
diff --git a/tests/x11/test_input.c b/tests/x11/test_input.c
index f82dc82..aa534ca 100644
--- a/tests/x11/test_input.c
+++ b/tests/x11/test_input.c
@@ -389,7 +389,12 @@ int main(void)
assert(yasl_private_surface_ime_preedit(surface) == NULL);
int begin = -1, end = -1;
assert(!yasl_private_surface_ime_preedit_cursor(surface, &begin, &end));
- assert(yasl_private_surface_show_window_menu(surface, (struct yasl_private_vector2i){50, 50}));
+ /* The window menu, move and resize need a button held; nothing presses one here. */
+ errno = 0;
+ assert(!yasl_private_surface_show_window_menu(surface, (struct yasl_private_vector2i){50, 50}) &&
+ errno == ESTALE);
+ errno = 0;
+ assert(!yasl_private_surface_start_interactive_move(surface) && errno == ESTALE);
yasl_private_surface_destroy(surface);
yasl_private_display_close(base);