test: sync: don't use VLA
The array size is fixed anyways, so we can use a symbol instead of variable. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1819>
This commit is contained in:
parent
f894801fa2
commit
b4f0c1abd5
|
@ -124,19 +124,19 @@ test_set_counter(xcb_connection_t *c)
|
|||
static void
|
||||
test_change_counter_basic(xcb_connection_t *c)
|
||||
{
|
||||
int iterations = 4;
|
||||
xcb_sync_query_counter_cookie_t queries[iterations];
|
||||
#define T1_ITERATIONS 4
|
||||
xcb_sync_query_counter_cookie_t queries[T1_ITERATIONS];
|
||||
|
||||
xcb_sync_counter_t counter = xcb_generate_id(c);
|
||||
xcb_sync_create_counter(c, counter, sync_value(0));
|
||||
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
for (int i = 0; i < T1_ITERATIONS; i++) {
|
||||
xcb_sync_change_counter(c, counter, sync_value(i));
|
||||
queries[i] = xcb_sync_query_counter_unchecked(c, counter);
|
||||
}
|
||||
|
||||
int64_t expected_value = 0;
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
for (int i = 0; i < T1_ITERATIONS; i++) {
|
||||
expected_value += i;
|
||||
int64_t value = counter_value(c, queries[i]);
|
||||
|
||||
|
@ -154,9 +154,9 @@ test_change_counter_basic(xcb_connection_t *c)
|
|||
static void
|
||||
test_change_counter_overflow(xcb_connection_t *c)
|
||||
{
|
||||
int iterations = 4;
|
||||
xcb_sync_query_counter_cookie_t queries[iterations];
|
||||
xcb_void_cookie_t changes[iterations];
|
||||
#define T2_ITERATIONS 4
|
||||
xcb_sync_query_counter_cookie_t queries[T2_ITERATIONS];
|
||||
xcb_void_cookie_t changes[T2_ITERATIONS];
|
||||
static const struct {
|
||||
int64_t a, b;
|
||||
} overflow_args[] = {
|
||||
|
|
Loading…
Reference in New Issue