summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-08-27 14:22:09 +0300
committerAlon Levy <alevy@redhat.com>2012-09-02 13:36:49 +0300
commit12c4349de735ee9232292e08dfd1300c45e499f5 (patch)
treeafd649cabc7ca8e68a9eecc68e26189afba64305
parentcaea7699434c20dceef8fc79d21b8eeb663fbf53 (diff)
downloadspice-12c4349de735ee9232292e08dfd1300c45e499f5.tar.gz
spice-12c4349de735ee9232292e08dfd1300c45e499f5.tar.xz
spice-12c4349de735ee9232292e08dfd1300c45e499f5.zip
server/tests/test_two_servers
-rw-r--r--server/tests/Makefile.am10
-rw-r--r--server/tests/test_two_servers.c37
2 files changed, 47 insertions, 0 deletions
diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
index e77865c7..a49f3b3e 100644
--- a/server/tests/Makefile.am
+++ b/server/tests/Makefile.am
@@ -33,6 +33,7 @@ noinst_PROGRAMS = \
test_just_sockets_no_ssl \
test_playback \
test_display_resolution_changes \
+ test_two_servers \
$(NULL)
test_display_streaming_SOURCES = \
@@ -73,3 +74,12 @@ test_empty_success_SOURCES = \
test_fail_on_null_core_interface_SOURCES = \
test_fail_on_null_core_interface.c \
$(NULL)
+
+test_two_servers_SOURCES = \
+ $(COMMON_BASE) \
+ test_display_base.c \
+ test_display_base.h \
+ test_two_servers.c \
+ $(NULL)
+
+
diff --git a/server/tests/test_two_servers.c b/server/tests/test_two_servers.c
new file mode 100644
index 00000000..d2a97359
--- /dev/null
+++ b/server/tests/test_two_servers.c
@@ -0,0 +1,37 @@
+/**
+ * Test two servers on one main loop.
+ */
+
+#include <config.h>
+#include <stdlib.h>
+#include "test_display_base.h"
+
+SpiceCoreInterface *core;
+
+int simple_commands[] = {
+ //SIMPLE_CREATE_SURFACE,
+ //SIMPLE_DRAW,
+ //SIMPLE_DESTROY_SURFACE,
+ //PATH_PROGRESS,
+ SIMPLE_DRAW,
+ //SIMPLE_COPY_BITS,
+ SIMPLE_UPDATE,
+};
+
+int main(void)
+{
+ Test *t1;
+ Test *t2;
+
+ core = basic_event_loop_init();
+ t1 = test_new(core);
+ t2 = test_new(core);
+ //spice_server_set_image_compression(server, SPICE_IMAGE_COMPRESS_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));
+
+ basic_event_loop_mainloop();
+ return 0;
+}