From 05e54fefafbcec11d847b9f8127bcd4820a20625 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 25 Feb 2025 18:47:05 +0100 Subject: [PATCH] test: Fix xsync test The xsync test is relying on the values being changed even in the case of a BadMatch value. Typically, it updates the delta but does not update the test type comparison, so when passing a negative value, it generates a BadMatch. That's actually not correct, and that will fail with the new fixes that check the validity of the values prior to apply the changes. Fix the test by updating the test type as needed. Signed-off-by: Olivier Fourdan Part-of: --- test/sync/sync.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/sync/sync.c b/test/sync/sync.c index fcb2a4a52..955e283a9 100644 --- a/test/sync/sync.c +++ b/test/sync/sync.c @@ -260,9 +260,13 @@ test_change_alarm_delta(xcb_connection_t *c) xcb_sync_create_alarm(c, alarm, 0, NULL); for (int i = 0; i < ARRAY_SIZE(some_values); i++) { - uint32_t values[] = { some_values[i] >> 32, some_values[i] }; + uint32_t mask = XCB_SYNC_CA_TEST_TYPE | XCB_SYNC_CA_DELTA; + uint32_t test_type = (some_values[i] >= 0 ? + XCB_SYNC_TESTTYPE_POSITIVE_COMPARISON : + XCB_SYNC_TESTTYPE_NEGATIVE_COMPARISON); + uint32_t values[] = { test_type, some_values[i] >> 32, some_values[i] }; - xcb_sync_change_alarm(c, alarm, XCB_SYNC_CA_DELTA, values); + xcb_sync_change_alarm(c, alarm, mask, values); queries[i] = xcb_sync_query_alarm_unchecked(c, alarm); }