[libvirt] [PATCH v2 1/4] tests: Reorder DO_TEST_CAPS_*() macros

Andrea Bolognani posted 4 patches 6 years, 7 months ago
[libvirt] [PATCH v2 1/4] tests: Reorder DO_TEST_CAPS_*() macros
Posted by Andrea Bolognani 6 years, 7 months ago
Make sure the order is consistent between xml2argv and xml2xml,
and make room for more macros that are going to be introduced
shortly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 tests/qemuxml2argvtest.c | 13 ++++++-------
 tests/qemuxml2xmltest.c  | 29 ++++++++++++++---------------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 91ca35d469..f4603d36c2 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -712,21 +712,21 @@ mymain(void)
                      ARG_CAPS_VER, ver, \
                      __VA_ARGS__)
 
-# define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \
-    DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END)
-
-# define DO_TEST_CAPS_VER(name, ver) \
-    DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
-
 # define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \
     DO_TEST_CAPS_INTERNAL(name, arch, "latest", __VA_ARGS__)
 
 # define DO_TEST_CAPS_ARCH_LATEST(name, arch) \
     DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ARG_END)
 
+# define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \
+    DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END)
+
 # define DO_TEST_CAPS_LATEST(name) \
     DO_TEST_CAPS_ARCH_LATEST(name, "x86_64")
 
+# define DO_TEST_CAPS_VER(name, ver) \
+    DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
+
 # define DO_TEST_CAPS_LATEST_FAILURE(name) \
     DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", \
                                   ARG_FLAGS, FLAG_EXPECT_FAILURE)
@@ -735,7 +735,6 @@ mymain(void)
     DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", \
                                   ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
 
-
 # define DO_TEST_FULL(name, ...) \
     DO_TEST_INTERNAL(name, "", \
                      __VA_ARGS__, QEMU_CAPS_LAST)
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index a64b17ac28..b60a013ac0 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -207,36 +207,35 @@ mymain(void)
         testQemuInfoClear(&info); \
     } while (0)
 
-# define NONE QEMU_CAPS_LAST
-
-# define DO_TEST_FULL(name, when, ...) \
-    DO_TEST_INTERNAL(name, "", when, __VA_ARGS__)
-
-# define DO_TEST(name, ...) \
-    DO_TEST_FULL(name, WHEN_BOTH, \
-                 ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST)
-
 # define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \
     DO_TEST_INTERNAL(name, "." arch "-" ver, WHEN_BOTH, \
                      ARG_CAPS_ARCH, arch, \
                      ARG_CAPS_VER, ver, \
                      __VA_ARGS__)
 
-# define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \
-    DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END)
-
-# define DO_TEST_CAPS_VER(name, ver) \
-    DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
-
 # define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \
     DO_TEST_CAPS_INTERNAL(name, arch, "latest", __VA_ARGS__)
 
 # define DO_TEST_CAPS_ARCH_LATEST(name, arch) \
     DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ARG_END)
 
+# define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \
+    DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END)
+
 # define DO_TEST_CAPS_LATEST(name) \
     DO_TEST_CAPS_ARCH_LATEST(name, "x86_64")
 
+# define DO_TEST_CAPS_VER(name, ver) \
+    DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
+
+# define DO_TEST_FULL(name, when, ...) \
+    DO_TEST_INTERNAL(name, "", when, __VA_ARGS__)
+
+# define DO_TEST(name, ...) \
+    DO_TEST_FULL(name, WHEN_BOTH, \
+                 ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST)
+
+# define NONE QEMU_CAPS_LAST
 
     /* Unset or set all envvars here that are copied in qemudBuildCommandLine
      * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 1/4] tests: Reorder DO_TEST_CAPS_*() macros
Posted by Ján Tomko 6 years, 7 months ago
On Tue, Jul 02, 2019 at 05:50:39PM +0200, Andrea Bolognani wrote:
>Make sure the order is consistent between xml2argv and xml2xml,
>and make room for more macros that are going to be introduced
>shortly.
>
>Signed-off-by: Andrea Bolognani <abologna@redhat.com>
>---
> tests/qemuxml2argvtest.c | 13 ++++++-------
> tests/qemuxml2xmltest.c  | 29 ++++++++++++++---------------
> 2 files changed, 20 insertions(+), 22 deletions(-)
>
>diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
>index 91ca35d469..f4603d36c2 100644
>--- a/tests/qemuxml2argvtest.c
>+++ b/tests/qemuxml2argvtest.c
>@@ -712,21 +712,21 @@ mymain(void)
>                      ARG_CAPS_VER, ver, \
>                      __VA_ARGS__)
>
>-# define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \
>-    DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END)
>-
>-# define DO_TEST_CAPS_VER(name, ver) \
>-    DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
>-
> # define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \
>     DO_TEST_CAPS_INTERNAL(name, arch, "latest", __VA_ARGS__)
>
> # define DO_TEST_CAPS_ARCH_LATEST(name, arch) \
>     DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ARG_END)
>
>+# define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \
>+    DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END)
>+
> # define DO_TEST_CAPS_LATEST(name) \
>     DO_TEST_CAPS_ARCH_LATEST(name, "x86_64")
>
>+# define DO_TEST_CAPS_VER(name, ver) \
>+    DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
>+
> # define DO_TEST_CAPS_LATEST_FAILURE(name) \
>     DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", \
>                                   ARG_FLAGS, FLAG_EXPECT_FAILURE)
>@@ -735,7 +735,6 @@ mymain(void)
>     DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", \
>                                   ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
>
>-
> # define DO_TEST_FULL(name, ...) \
>     DO_TEST_INTERNAL(name, "", \
>                      __VA_ARGS__, QEMU_CAPS_LAST)

Unrelated whitespace change.

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 1/4] tests: Reorder DO_TEST_CAPS_*() macros
Posted by Andrea Bolognani 6 years, 7 months ago
On Wed, 2019-07-03 at 08:22 +0200, Ján Tomko wrote:
> On Tue, Jul 02, 2019 at 05:50:39PM +0200, Andrea Bolognani wrote:
> > @@ -735,7 +735,6 @@ mymain(void)
> >     DO_TEST_CAPS_ARCH_LATEST_FULL(name, "x86_64", \
> >                                   ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR)
> > 
> > -
> > # define DO_TEST_FULL(name, ...) \
> >     DO_TEST_INTERNAL(name, "", \
> >                      __VA_ARGS__, QEMU_CAPS_LAST)
> 
> Unrelated whitespace change.

It's not unrelated: xml2xml didn't have that empty line because it's
pointless for it to be there, and as part of the unification process
it's been removed from xml2argv as well.

What was wrong is me re-introducing it in commit 3/4 O:-) So I got
rid of that before pushing.

Thank you for the review!

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list