The testFormat() function should have debug information for the
formatted address and what is expected. Since, virTestCompareToString()
does not produce any extra debug info, VIR_TEST_DEBUG should be used in
this test.

Signed-off-by: Julio Faracco <[email protected]>
---
 tests/sockettest.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/sockettest.c b/tests/sockettest.c
index b26503a0d4..810a49364a 100644
--- a/tests/sockettest.c
+++ b/tests/sockettest.c
@@ -43,12 +43,18 @@ static int testParse(virSocketAddr *addr, const char 
*addrstr, int family, bool
 static int testFormat(virSocketAddr *addr, const char *addrstr, bool pass)
 {
     g_autofree char *newaddrstr = NULL;
+    int rc;
 
     newaddrstr = virSocketAddrFormat(addr);
     if (!newaddrstr)
         return pass ? -1 : 0;
 
-    if (virTestCompareToString(newaddrstr, addrstr) < 0) {
+    rc = virTestCompareToString(newaddrstr, addrstr);
+
+    VIR_TEST_DEBUG("Addresses %s and %s %s", newaddrstr, addrstr,
+                   rc < 0 ? "doesn't match" : "matches");
+
+    if (rc < 0) {
         return pass ? -1 : 0;
     } else {
         return pass ? 0 : -1;
-- 
2.52.0

Reply via email to