diff options
author | Alon Levy <alevy@redhat.com> | 2012-08-23 12:32:09 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2012-09-02 13:36:41 +0300 |
commit | caea7699434c20dceef8fc79d21b8eeb663fbf53 (patch) | |
tree | c52b0657f022b6895e140169b960b8554b88d79f /server/tests/test_display_resolution_changes.c | |
parent | 897aaa7be51ab0b44436340cf6beedae03544199 (diff) | |
download | spice-caea7699434c20dceef8fc79d21b8eeb663fbf53.tar.gz spice-caea7699434c20dceef8fc79d21b8eeb663fbf53.tar.xz spice-caea7699434c20dceef8fc79d21b8eeb663fbf53.zip |
server/tests: introduce Test struct
Diffstat (limited to 'server/tests/test_display_resolution_changes.c')
-rw-r--r-- | server/tests/test_display_resolution_changes.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/server/tests/test_display_resolution_changes.c b/server/tests/test_display_resolution_changes.c index 4a66a755..4767ea9e 100644 --- a/server/tests/test_display_resolution_changes.c +++ b/server/tests/test_display_resolution_changes.c @@ -7,8 +7,6 @@ #include <stdlib.h> #include "test_display_base.h" -SpiceServer *server; -SpiceCoreInterface *core; SpiceTimer *ping_timer; void show_channels(SpiceServer *server); @@ -17,13 +15,14 @@ int ping_ms = 100; void pinger(void *opaque) { + Test *test = opaque; // show_channels is not thread safe - fails if disconnections / connections occur //show_channels(server); - core->timer_start(ping_timer, ping_ms); + test->core->timer_start(ping_timer, ping_ms); } -void set_primary_params(Command *command) +void set_primary_params(Test *test, Command *command) { #if 0 static int toggle = 0; @@ -51,13 +50,16 @@ static Command commands[] = { int main(void) { + SpiceCoreInterface *core; + Test *test; + core = basic_event_loop_init(); - server = test_init(core); + test = test_new(core); //spice_server_set_image_compression(server, SPICE_IMAGE_COMPRESS_OFF); - test_add_display_interface(server); - test_set_command_list(commands, COUNT(commands)); + test_add_display_interface(test); + test_set_command_list(test, commands, COUNT(commands)); - ping_timer = core->timer_add(pinger, NULL); + ping_timer = core->timer_add(pinger, test); core->timer_start(ping_timer, ping_ms); basic_event_loop_mainloop(); |