diff --git a/server/tests/test-display-base.c b/server/tests/test-display-base.c index 88638bde..3a8d592e 100644 --- a/server/tests/test-display-base.c +++ b/server/tests/test-display-base.c @@ -468,7 +468,7 @@ int commands_end = 0; int commands_start = 0; struct QXLCommandExt* commands[1024]; -#define COMMANDS_SIZE COUNT(commands) +#define COMMANDS_SIZE G_N_ELEMENTS(commands) static void push_command(QXLCommandExt *ext) { diff --git a/server/tests/test-display-base.h b/server/tests/test-display-base.h index bdf7a11c..f4231359 100644 --- a/server/tests/test-display-base.h +++ b/server/tests/test-display-base.h @@ -21,8 +21,6 @@ #include #include "basic-event-loop.h" -#define COUNT(x) ((sizeof(x)/sizeof(x[0]))) - /* * simple queue for commands. * each command can have up to two parameters (grow as needed) diff --git a/server/tests/test-display-no-ssl.c b/server/tests/test-display-no-ssl.c index f4a5bea4..01d1d03e 100644 --- a/server/tests/test-display-no-ssl.c +++ b/server/tests/test-display-no-ssl.c @@ -61,7 +61,7 @@ int main(void) //spice_server_set_image_compression(server, SPICE_IMAGE_COMPRESSION_OFF); test_add_display_interface(test); test_add_agent_interface(test->server); - test_set_simple_command_list(test, simple_commands, COUNT(simple_commands)); + test_set_simple_command_list(test, simple_commands, G_N_ELEMENTS(simple_commands)); ping_timer = core->timer_add(pinger, NULL); core->timer_start(ping_timer, ping_ms); diff --git a/server/tests/test-display-resolution-changes.c b/server/tests/test-display-resolution-changes.c index c0aa38ff..2619a1ca 100644 --- a/server/tests/test-display-resolution-changes.c +++ b/server/tests/test-display-resolution-changes.c @@ -75,7 +75,7 @@ int main(void) test = test_new(core); //spice_server_set_image_compression(server, SPICE_IMAGE_COMPRESSION_OFF); test_add_display_interface(test); - test_set_command_list(test, commands, COUNT(commands)); + test_set_command_list(test, commands, G_N_ELEMENTS(commands)); ping_timer = core->timer_add(pinger, test); core->timer_start(ping_timer, ping_ms); diff --git a/server/tests/test-display-width-stride.c b/server/tests/test-display-width-stride.c index 10a55b8c..6bf54f1d 100644 --- a/server/tests/test-display-width-stride.c +++ b/server/tests/test-display-width-stride.c @@ -98,7 +98,7 @@ static Command commands[] = { static void on_client_connected(Test *test) { - test_set_command_list(test, commands, COUNT(commands)); + test_set_command_list(test, commands, G_N_ELEMENTS(commands)); } int main(void) diff --git a/server/tests/test-two-servers.c b/server/tests/test-two-servers.c index 4cf451a4..23cd7acd 100644 --- a/server/tests/test-two-servers.c +++ b/server/tests/test-two-servers.c @@ -46,8 +46,8 @@ int main(void) //spice_server_set_image_compression(server, SPICE_IMAGE_COMPRESSION_OFF); test_add_display_interface(t1); test_add_display_interface(t2); - test_set_simple_command_list(t1, simple_commands, COUNT(simple_commands)); - test_set_simple_command_list(t2, simple_commands, COUNT(simple_commands)); + test_set_simple_command_list(t1, simple_commands, G_N_ELEMENTS(simple_commands)); + test_set_simple_command_list(t2, simple_commands, G_N_ELEMENTS(simple_commands)); basic_event_loop_mainloop(); return 0;