mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
tests: Reuse G_N_ELEMENTS instead of COUNT
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
e6cf0dd056
commit
ea58b27aff
@ -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)
|
||||
{
|
||||
|
||||
@ -21,8 +21,6 @@
|
||||
#include <spice.h>
|
||||
#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)
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user