[PATCH 8/9] tests: Don't wrap virTestDifference() arguments in NULLSTR()

Michal Privoznik mprivozn at redhat.com
Wed Nov 30 09:48:10 UTC 2022


The virTestDifference() is perfectly capable of handling NULL
arguments. There's no need to wrap arguments in NULLSTR().

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 tests/virnetdevbandwidthtest.c   | 4 +---
 tests/virnetdevopenvswitchtest.c | 8 ++------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c
index d5e4092fc3..fced657811 100644
--- a/tests/virnetdevbandwidthtest.c
+++ b/tests/virnetdevbandwidthtest.c
@@ -93,9 +93,7 @@ testVirNetDevBandwidthSet(const void *data)
     }
 
     if (STRNEQ_NULLABLE(exp_cmd, actual_cmd)) {
-        virTestDifference(stderr,
-                          NULLSTR(exp_cmd),
-                          NULLSTR(actual_cmd));
+        virTestDifference(stderr, exp_cmd, actual_cmd);
         return -1;
     }
 
diff --git a/tests/virnetdevopenvswitchtest.c b/tests/virnetdevopenvswitchtest.c
index 57860f4bc4..e5883eb076 100644
--- a/tests/virnetdevopenvswitchtest.c
+++ b/tests/virnetdevopenvswitchtest.c
@@ -176,9 +176,7 @@ testVirNetDevOpenvswitchInterfaceSetQos(const void *data)
     }
 
     if (STRNEQ_NULLABLE(info->exp_cmd, actual_cmd)) {
-        virTestDifference(stderr,
-                          NULLSTR(info->exp_cmd),
-                          NULLSTR(actual_cmd));
+        virTestDifference(stderr, info->exp_cmd, actual_cmd);
         return -1;
     }
 
@@ -207,9 +205,7 @@ testVirNetDevOpenvswitchInterfaceClearQos(const void *data)
     }
 
     if (STRNEQ_NULLABLE(info->exp_cmd, actual_cmd)) {
-        virTestDifference(stderr,
-                          NULLSTR(info->exp_cmd),
-                          NULLSTR(actual_cmd));
+        virTestDifference(stderr, info->exp_cmd, actual_cmd);
         return -1;
     }
 
-- 
2.37.4



More information about the libvir-list mailing list