summaryrefslogtreecommitdiffstats
path: root/server/tests/test_display_base.h
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-08-23 12:32:09 +0300
committerAlon Levy <alevy@redhat.com>2012-09-02 13:36:41 +0300
commitcaea7699434c20dceef8fc79d21b8eeb663fbf53 (patch)
treec52b0657f022b6895e140169b960b8554b88d79f /server/tests/test_display_base.h
parent897aaa7be51ab0b44436340cf6beedae03544199 (diff)
downloadspice-caea7699434c20dceef8fc79d21b8eeb663fbf53.tar.gz
spice-caea7699434c20dceef8fc79d21b8eeb663fbf53.tar.xz
spice-caea7699434c20dceef8fc79d21b8eeb663fbf53.zip
server/tests: introduce Test struct
Diffstat (limited to 'server/tests/test_display_base.h')
-rw-r--r--server/tests/test_display_base.h48
1 files changed, 43 insertions, 5 deletions
diff --git a/server/tests/test_display_base.h b/server/tests/test_display_base.h
index b2221a2c..db97b8cd 100644
--- a/server/tests/test_display_base.h
+++ b/server/tests/test_display_base.h
@@ -51,10 +51,11 @@ typedef struct CommandSleep {
} CommandSleep;
typedef struct Command Command;
+typedef struct Test Test;
struct Command {
CommandType command;
- void (*cb)(Command *command);
+ void (*cb)(Test *test, Command *command);
void *cb_opaque;
union {
CommandCreatePrimary create_primary;
@@ -64,10 +65,47 @@ struct 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);
+#define MAX_HEIGHT 2048
+#define MAX_WIDTH 2048
+
+#define SURF_WIDTH 320
+#define SURF_HEIGHT 240
+
+struct Test {
+ SpiceCoreInterface *core;
+ SpiceServer *server;
+
+ QXLInstance qxl_instance;
+ QXLWorker *qxl_worker;
+
+ uint8_t primary_surface[MAX_HEIGHT * MAX_WIDTH * 4];
+ int primary_height;
+ int primary_width;
+
+ SpiceTimer *wakeup_timer;
+ int wakeup_ms;
+
+ int cursor_notify;
+
+ uint8_t secondary_surface[SURF_WIDTH * SURF_HEIGHT * 4];
+ int has_secondary;
+
+ // Current mode (set by create_primary)
+ int width;
+ int height;
+
+ // qxl scripted rendering commands and io
+ Command *commands;
+ int num_commands;
+ int cmd_index;
+
+ int target_surface;
+};
+
+void test_set_simple_command_list(Test *test, int *command, int num_commands);
+void test_set_command_list(Test *test, Command *command, int num_commands);
+void test_add_display_interface(Test *test);
+Test* test_new(SpiceCoreInterface* core);
uint32_t test_get_width(void);
uint32_t test_get_height(void);