[Spice-devel,11/18] server/tests: add test_get_width/test_get_height

Submitted by Yonit Halperin on May 2, 2012, 2:01 p.m.

Details

Message ID 1335967313-24747-11-git-send-email-yhalperi@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Yonit Halperin May 2, 2012, 2:01 p.m.
From: Alon Levy <alevy@redhat.com>

---
 server/tests/test_display_base.c |   16 ++++++++++++++++
 server/tests/test_display_base.h |    3 +++
 2 files changed, 19 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
index d060f3f..fd9a37e 100644
--- a/server/tests/test_display_base.c
+++ b/server/tests/test_display_base.c
@@ -47,6 +47,9 @@  static void test_spice_destroy_update(SimpleSpiceUpdate *update)
     free(update);
 }
 
+static uint32_t test_width;
+static uint32_t test_height;
+
 #define DEFAULT_WIDTH 640
 #define DEFAULT_HEIGHT 320
 
@@ -320,9 +323,22 @@  static void create_primary_surface(QXLWorker *worker, uint32_t width,
     surface.mem        = (uint64_t)&g_primary_surface;
     surface.group_id   = MEM_SLOT_GROUP_ID;
 
+    test_width = width;
+    test_height = height;
+
     qxl_worker->create_primary_surface(qxl_worker, 0, &surface);
 }
 
+uint32_t test_get_width(void)
+{
+    return test_width;
+}
+
+uint32_t test_get_height(void)
+{
+    return test_height;
+}
+
 QXLDevMemSlot slot = {
 .slot_group_id = MEM_SLOT_GROUP_ID,
 .slot_id = 0,
diff --git a/server/tests/test_display_base.h b/server/tests/test_display_base.h
index fa9fd18..6922d9b 100644
--- a/server/tests/test_display_base.h
+++ b/server/tests/test_display_base.h
@@ -36,6 +36,9 @@  void test_set_command_list(Command *command, int num_commands);
 void test_add_display_interface(SpiceServer *server);
 SpiceServer* test_init(SpiceCoreInterface* core);
 
+uint32_t test_get_width(void);
+uint32_t test_get_height(void);
+
 void spice_test_config_parse_args(int argc, char **argv);
 
 #endif /* __TEST_DISPLAY_BASE_H__ */