[server/tests PATCH 2/6] server/tests: fix produce_command for create surface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Earlier in this function, test->target_surface is set to 1, which
is the only allowed non-primary surface currently.

If surface parameters are given (and specifically data is checked)
they are being used, otherwise a default surface is used.

Earlier in this function, "command" is set to a non-NULL value.
Thus, the else part was unreachable code, which is fixed now.
---
 server/tests/test_display_base.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
index ad2c687..cf3990f 100644
--- a/server/tests/test_display_base.c
+++ b/server/tests/test_display_base.c
@@ -553,8 +553,10 @@ static void produce_command(Test *test)
 
         case SIMPLE_CREATE_SURFACE: {
             SimpleSurfaceCmd *update;
-            test->target_surface = MAX_SURFACE_NUM - 1;
-            if (command) {
+            if (command->create_surface.data) {
+                ASSERT(command->create_surface.surface_id > 0);
+                ASSERT(command->create_surface.surface_id < MAX_SURFACE_NUM);
+                ASSERT(command->create_surface.surface_id == 1);
                 update = create_surface(command->create_surface.surface_id,
                                         command->create_surface.format,
                                         command->create_surface.width,
-- 
1.7.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]