[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] tests: Fix message for IP parse/format failures



Confusing message is printed when a parse/format sockettest fails. E.g.
there's a test that parses/formats ::ffff and the format fails like that:
  38) Test format ::ffff family AF_UNSPEC                               ...
  Offset 2
  Expect [0.0.255.255]
  Actual [ffff]

It should be instead:
  38) Test format ::ffff family AF_UNSPEC                               ...
  Offset 2
  Expect [ffff]
  Actual [0.0.255.255]

Signed-off-by: Roman Bolshakov <r bolshakov yadro com>
---
 tests/sockettest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/sockettest.c b/tests/sockettest.c
index 0c6c79f2a9..859f02e51e 100644
--- a/tests/sockettest.c
+++ b/tests/sockettest.c
@@ -50,7 +50,7 @@ static int testFormat(virSocketAddr *addr, const char *addrstr, bool pass)
         return pass ? -1 : 0;
 
     if (STRNEQ(newaddrstr, addrstr)) {
-        virTestDifference(stderr, newaddrstr, addrstr);
+        virTestDifference(stderr, addrstr, newaddrstr);
         VIR_FREE(newaddrstr);
         return pass ? -1 : 0;
     } else {
-- 
2.22.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]