summaryrefslogtreecommitdiffstats
path: root/server/tests/test_display_base.h
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-03-22 00:14:42 +0200
committerAlon Levy <alevy@redhat.com>2012-03-22 11:18:37 +0200
commita6f9797c79db969f0fe28ef30691d4c1b1002eac (patch)
tree4b21687916739880a3121c415fe731fba00f4e96 /server/tests/test_display_base.h
parentc36bf55971ec7422b83d31f23cb28afaf370c515 (diff)
downloadspice-a6f9797c79db969f0fe28ef30691d4c1b1002eac.tar.gz
spice-a6f9797c79db969f0fe28ef30691d4c1b1002eac.tar.xz
spice-a6f9797c79db969f0fe28ef30691d4c1b1002eac.zip
server/tests/test_display_base: add Command
add parameters to the commands used for display tests.
Diffstat (limited to 'server/tests/test_display_base.h')
-rw-r--r--server/tests/test_display_base.h36
1 files changed, 26 insertions, 10 deletions
diff --git a/server/tests/test_display_base.h b/server/tests/test_display_base.h
index 0ed41cb8..fa9fd182 100644
--- a/server/tests/test_display_base.h
+++ b/server/tests/test_display_base.h
@@ -6,20 +6,36 @@
#define COUNT(x) ((sizeof(x)/sizeof(x[0])))
-void test_set_simple_command_list(int* commands, int num_commands);
-void test_add_display_interface(SpiceServer *server);
-SpiceServer* test_init(SpiceCoreInterface* core);
-
-void spice_test_config_parse_args(int argc, char **argv);
-
-// simple queue for commands
-enum {
+/*
+ * simple queue for commands.
+ * each command can have up to two parameters (grow as needed)
+ *
+ * TODO: switch to gtk main loop. Then add gobject-introspection. then
+ * write tests in python/guile/whatever.
+ */
+typedef enum {
PATH_PROGRESS,
SIMPLE_CREATE_SURFACE,
SIMPLE_DRAW,
SIMPLE_COPY_BITS,
SIMPLE_DESTROY_SURFACE,
SIMPLE_UPDATE,
-};
+ DESTROY_PRIMARY,
+ CREATE_PRIMARY,
+} CommandType;
+typedef struct Command {
+ CommandType command;
+ uint64_t arg1;
+ uint64_t arg2;
+ void (*cb)(void *cb_opaque, uint64_t *arg1, uint64_t *arg2);
+ void *cb_opaque;
+} Command;
+
+void test_set_simple_command_list(int *command, int num_commands);
+void test_set_command_list(Command *command, int num_commands);
+void test_add_display_interface(SpiceServer *server);
+SpiceServer* test_init(SpiceCoreInterface* core);
+
+void spice_test_config_parse_args(int argc, char **argv);
-#endif // __TEST_DISPLAY_BASE_H__
+#endif /* __TEST_DISPLAY_BASE_H__ */