]> xenbits.xensource.com Git - libvirt.git/commitdiff
virjsontest: use the test name in AddRemove test
authorJán Tomko <jtomko@redhat.com>
Fri, 1 Jun 2018 07:09:46 +0000 (09:09 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 4 Sep 2018 08:19:23 +0000 (10:19 +0200)
Instead of printing the whole JSON in error messages,
print just the test name.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
tests/virjsontest.c

index 6f2f7f56edbed4b166848a75fc87b25c8761d0b0..195d8279f0bcf950638de13572022101f853cf8e 100644 (file)
@@ -78,7 +78,7 @@ testJSONAddRemove(const void *data)
 
     json = virJSONValueFromString(info->doc);
     if (!json) {
-        VIR_TEST_VERBOSE("Fail to parse %s\n", info->doc);
+        VIR_TEST_VERBOSE("Fail to parse %s\n", info->name);
         ret = -1;
         goto cleanup;
     }
@@ -87,7 +87,7 @@ testJSONAddRemove(const void *data)
     case 1:
         if (!info->pass) {
             VIR_TEST_VERBOSE("should not remove from non-object %s\n",
-                             info->doc);
+                             info->name);
             goto cleanup;
         }
         break;
@@ -95,11 +95,11 @@ testJSONAddRemove(const void *data)
         if (!info->pass)
             ret = 0;
         else
-            VIR_TEST_VERBOSE("Fail to recognize non-object %s\n", info->doc);
+            VIR_TEST_VERBOSE("Fail to recognize non-object %s\n", info->name);
         goto cleanup;
     default:
         VIR_TEST_VERBOSE("unexpected result when removing from %s\n",
-                         info->doc);
+                         info->name);
         goto cleanup;
     }
     if (STRNEQ_NULLABLE(virJSONValueGetString(name), "sample")) {