[libvirt PATCH 11/19] tests: sockettest: move declarations

Ján Tomko jtomko at redhat.com
Mon Aug 3 16:56:48 UTC 2020


Declare the structs: at the beginning of the block.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 tests/sockettest.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/sockettest.c b/tests/sockettest.c
index a3c27421fc..3183ca523f 100644
--- a/tests/sockettest.c
+++ b/tests/sockettest.c
@@ -277,11 +277,11 @@ mymain(void)
     do { \
         virSocketAddr addr; \
         struct testParseData data = { &addr, addrstr, family, pass }; \
-        memset(&addr, 0, sizeof(addr)); \
-        if (virTestRun("Test parse " addrstr " family " #family, \
-                       testParseHelper, &data) < 0) \
-            ret = -1; \
         struct testFormatData data2 = { &addr, addrstr, pass }; \
+        memset(&addr, 0, sizeof(addr)); \
+        if (virTestRun("Test parse " addrstr " family " #family, \
+                       testParseHelper, &data) < 0) \
+            ret = -1; \
         if (virTestRun("Test format " addrstr " family " #family, \
                        testFormatHelper, &data2) < 0) \
             ret = -1; \
@@ -291,11 +291,11 @@ mymain(void)
     do { \
         virSocketAddr addr; \
         struct testParseData data = { &addr, addrstr, family, true}; \
-        memset(&addr, 0, sizeof(addr)); \
-        if (virTestRun("Test parse " addrstr " family " #family, \
-                       testParseHelper, &data) < 0) \
-            ret = -1; \
         struct testFormatData data2 = { &addr, addrformated, pass }; \
+        memset(&addr, 0, sizeof(addr)); \
+        if (virTestRun("Test parse " addrstr " family " #family, \
+                       testParseHelper, &data) < 0) \
+            ret = -1; \
         if (virTestRun("Test format " addrstr " family " #family, \
                        testFormatHelper, &data2) < 0) \
             ret = -1; \
-- 
2.26.2




More information about the libvir-list mailing list