[PATCH] lxcxml2xmltest: Substitute 'inactive' variable with 'active'

Kristina Hanicova posted 1 patch 2 years, 9 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/8e5e501747857a5795dc5e11b71e29dc4ff78371.1626855670.git.khanicov@redhat.com
tests/lxcxml2xmltest.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
[PATCH] lxcxml2xmltest: Substitute 'inactive' variable with 'active'
Posted by Kristina Hanicova 2 years, 9 months ago
I removed negation from the name of a variable to make the code
more readable.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
---
 tests/lxcxml2xmltest.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c
index 00341ad695..69c333b9b5 100644
--- a/tests/lxcxml2xmltest.c
+++ b/tests/lxcxml2xmltest.c
@@ -21,7 +21,7 @@ static virLXCDriver *driver;
 struct testInfo {
     const char *name;
     int different;
-    bool inactive_only;
+    bool active_only;
     unsigned int parse_flags;
 };
 
@@ -40,7 +40,7 @@ testCompareXMLToXMLHelper(const void *data)
 
     ret = testCompareDomXML2XMLFiles(driver->caps, driver->xmlopt, xml_in,
                                      info->different ? xml_out : xml_in,
-                                     !info->inactive_only,
+                                     info->active_only,
                                      info->parse_flags,
                                      TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS);
     VIR_FREE(xml_in);
@@ -57,9 +57,9 @@ mymain(void)
     if (!(driver = testLXCDriverInit()))
         return EXIT_FAILURE;
 
-# define DO_TEST_FULL(name, is_different, inactive, parse_flags) \
+# define DO_TEST_FULL(name, is_different, active, parse_flags) \
     do { \
-        const struct testInfo info = {name, is_different, inactive, \
+        const struct testInfo info = {name, is_different, active, \
                                       parse_flags}; \
         if (virTestRun("LXC XML-2-XML " name, \
                        testCompareXMLToXMLHelper, &info) < 0) \
@@ -67,10 +67,10 @@ mymain(void)
     } while (0)
 
 # define DO_TEST(name) \
-    DO_TEST_FULL(name, 0, false, 0)
+    DO_TEST_FULL(name, 0, true, 0)
 
 # define DO_TEST_DIFFERENT(name) \
-    DO_TEST_FULL(name, 1, false, 0)
+    DO_TEST_FULL(name, 1, true, 0)
 
     /* Unset or set all envvars here that are copied in lxcdBuildCommandLine
      * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected
-- 
2.31.1

Re: [PATCH] lxcxml2xmltest: Substitute 'inactive' variable with 'active'
Posted by Kristina Hanicova 2 years, 8 months ago
On Wed, Jul 21, 2021 at 10:33 AM Kristina Hanicova <khanicov@redhat.com>
wrote:

> I removed negation from the name of a variable to make the code
> more readable.
>
> Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
> ---
>  tests/lxcxml2xmltest.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c
> index 00341ad695..69c333b9b5 100644
> --- a/tests/lxcxml2xmltest.c
> +++ b/tests/lxcxml2xmltest.c
> @@ -21,7 +21,7 @@ static virLXCDriver *driver;
>  struct testInfo {
>      const char *name;
>      int different;
> -    bool inactive_only;
> +    bool active_only;
>      unsigned int parse_flags;
>  };
>
> @@ -40,7 +40,7 @@ testCompareXMLToXMLHelper(const void *data)
>
>      ret = testCompareDomXML2XMLFiles(driver->caps, driver->xmlopt, xml_in,
>                                       info->different ? xml_out : xml_in,
> -                                     !info->inactive_only,
> +                                     info->active_only,
>                                       info->parse_flags,
>
> TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS);
>      VIR_FREE(xml_in);
> @@ -57,9 +57,9 @@ mymain(void)
>      if (!(driver = testLXCDriverInit()))
>          return EXIT_FAILURE;
>
> -# define DO_TEST_FULL(name, is_different, inactive, parse_flags) \
> +# define DO_TEST_FULL(name, is_different, active, parse_flags) \
>      do { \
> -        const struct testInfo info = {name, is_different, inactive, \
> +        const struct testInfo info = {name, is_different, active, \
>                                        parse_flags}; \
>          if (virTestRun("LXC XML-2-XML " name, \
>                         testCompareXMLToXMLHelper, &info) < 0) \
> @@ -67,10 +67,10 @@ mymain(void)
>      } while (0)
>
>  # define DO_TEST(name) \
> -    DO_TEST_FULL(name, 0, false, 0)
> +    DO_TEST_FULL(name, 0, true, 0)
>
>  # define DO_TEST_DIFFERENT(name) \
> -    DO_TEST_FULL(name, 1, false, 0)
> +    DO_TEST_FULL(name, 1, true, 0)
>
>      /* Unset or set all envvars here that are copied in
> lxcdBuildCommandLine
>       * using ADD_ENV_COPY, otherwise these tests may fail due to
> unexpected
> --
> 2.31.1
>
>
Polite ping
Re: [PATCH] lxcxml2xmltest: Substitute 'inactive' variable with 'active'
Posted by Michal Prívozník 2 years, 8 months ago
On 7/21/21 10:25 AM, Kristina Hanicova wrote:
> I removed negation from the name of a variable to make the code
> more readable.
> 
> Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
> ---
>  tests/lxcxml2xmltest.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal