[Spice-commits] server/tests

Frediano Ziglio fziglio at kemper.freedesktop.org
Fri Jun 23 09:11:27 UTC 2017


 server/tests/test-display-base.c |   10 ++++++----
 server/tests/test-leaks.c        |   10 ++++++----
 server/tests/test-playback.c     |   10 ++++++----
 server/tests/test-vdagent.c      |   10 ++++++----
 4 files changed, 24 insertions(+), 16 deletions(-)

New commits:
commit 7254169f7fc356388f4b8d7e3c2dd5e762525c05
Author: Michal Privoznik <mprivozn at redhat.com>
Date:   Thu Jun 22 16:58:57 2017 +0200

    tests: Initialize all members of SpiceBaseInterface struct
    
    When compiling, -Werror=missing-field-initializers is enabled.
    However, some gcc versions (like Gentoo 4.9.4 one) fail to see
    that all the members of the SpiceBaseInterface struct are
    initialized:
    
    test-display-base.c:844:5: error: missing initializer for field
    'description' of 'SpiceBaseInterface'
    [-Werror=missing-field-initializers] .base.description   = "test
    spice virtual channel char device",
    
    The solution is to initialize .base member as a structure at once
    instead of multiple times per each member.
    
    Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/tests/test-display-base.c b/server/tests/test-display-base.c
index 636c505c..88638bde 100644
--- a/server/tests/test-display-base.c
+++ b/server/tests/test-display-base.c
@@ -840,10 +840,12 @@ static void vmc_state(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
 
 
 static SpiceCharDeviceInterface vdagent_sif = {
-    .base.type          = SPICE_INTERFACE_CHAR_DEVICE,
-    .base.description   = "test spice virtual channel char device",
-    .base.major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
-    .base.minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
+    .base = {
+        .type          = SPICE_INTERFACE_CHAR_DEVICE,
+        .description   = "test spice virtual channel char device",
+        .major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
+        .minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
+    },
     .state              = vmc_state,
     .write              = vmc_write,
     .read               = vmc_read,
diff --git a/server/tests/test-leaks.c b/server/tests/test-leaks.c
index 4985a1e3..74ab2afd 100644
--- a/server/tests/test-leaks.c
+++ b/server/tests/test-leaks.c
@@ -88,10 +88,12 @@ static void vmc_state(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
 }
 
 static SpiceCharDeviceInterface vmc_interface = {
-    .base.type          = SPICE_INTERFACE_CHAR_DEVICE,
-    .base.description   = "test spice virtual channel char device",
-    .base.major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
-    .base.minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
+    .base = {
+        .type          = SPICE_INTERFACE_CHAR_DEVICE,
+        .description   = "test spice virtual channel char device",
+        .major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
+        .minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
+    },
     .state              = vmc_state,
     .write              = vmc_write,
     .read               = vmc_read,
diff --git a/server/tests/test-playback.c b/server/tests/test-playback.c
index bad11a00..9e53e322 100644
--- a/server/tests/test-playback.c
+++ b/server/tests/test-playback.c
@@ -37,10 +37,12 @@
 SpicePlaybackInstance playback_instance;
 
 static const SpicePlaybackInterface playback_sif = {
-    .base.type          = SPICE_INTERFACE_PLAYBACK,
-    .base.description   = "test playback",
-    .base.major_version = SPICE_INTERFACE_PLAYBACK_MAJOR,
-    .base.minor_version = SPICE_INTERFACE_PLAYBACK_MINOR,
+    .base = {
+        .type          = SPICE_INTERFACE_PLAYBACK,
+        .description   = "test playback",
+        .major_version = SPICE_INTERFACE_PLAYBACK_MAJOR,
+        .minor_version = SPICE_INTERFACE_PLAYBACK_MINOR,
+    }
 };
 
 uint32_t *frame;
diff --git a/server/tests/test-vdagent.c b/server/tests/test-vdagent.c
index e1d8b82c..232e9824 100644
--- a/server/tests/test-vdagent.c
+++ b/server/tests/test-vdagent.c
@@ -94,10 +94,12 @@ static void vmc_state(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
 }
 
 static SpiceCharDeviceInterface vmc_interface = {
-    .base.type          = SPICE_INTERFACE_CHAR_DEVICE,
-    .base.description   = "test spice virtual channel char device",
-    .base.major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
-    .base.minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
+    .base = {
+        .type          = SPICE_INTERFACE_CHAR_DEVICE,
+        .description   = "test spice virtual channel char device",
+        .major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
+        .minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
+    },
     .state              = vmc_state,
     .write              = vmc_write,
     .read               = vmc_read,


More information about the Spice-commits mailing list