[Spice-devel] [server/tests PATCH 1/6] server/tests: test_display_base: set rect according to appropriate surface

Uri Lublin uril at redhat.com
Tue Jul 9 09:15:25 PDT 2013


When surface_id == 0, primary is used.
Otherwise (currently 1), secondary is used.

Also, remove unused test_width and test_height.
Since commit caea7699434c20dceef8fc79d21b8eeb663fbf53,
test->width and test->height are used.
---
 server/tests/test_display_base.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
index b4c93f3..ad2c687 100644
--- a/server/tests/test_display_base.c
+++ b/server/tests/test_display_base.c
@@ -48,9 +48,6 @@ 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
 
@@ -507,9 +504,9 @@ static void produce_command(Test *test)
         case SIMPLE_UPDATE: {
             QXLRect rect = {
                 .left = 0,
-                .right = (test->target_surface == 0 ? test_width : SURF_WIDTH),
+                .right = (test->target_surface == 0 ? test->primary_width : test->width),
                 .top = 0,
-                .bottom = (test->target_surface == 0 ? test_height : SURF_HEIGHT)
+                .bottom = (test->target_surface == 0 ? test->primary_height : test->height)
             };
             if (rect.right > 0 && rect.bottom > 0) {
                 qxl_worker->update_area(qxl_worker, test->target_surface, &rect, NULL, 0, 1);
-- 
1.7.1



More information about the Spice-devel mailing list