]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: virtnettlscontexttest: Use virGetLastErrorMessage()
authorCole Robinson <crobinso@redhat.com>
Fri, 18 Mar 2016 20:58:02 +0000 (16:58 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 28 Mar 2016 17:27:47 +0000 (13:27 -0400)
Use virGetLastErrorMessage() rather than open code it

tests/virnettlscontexttest.c

index a3e24a3535bd7cc0f56df58d92c51ab9db579bbe..d33b896327a3ce9d558da94248ecdf61378f82f8 100644 (file)
@@ -90,13 +90,12 @@ static int testTLSContextInit(const void *opaque)
             goto cleanup;
         }
     } else {
-        virErrorPtr err = virGetLastError();
         if (!data->expectFail) {
             VIR_WARN("Unexpected failure %s against %s",
                      data->cacrt, data->crt);
             goto cleanup;
         }
-        VIR_DEBUG("Got error %s", err ? err->message : "<unknown>");
+        VIR_DEBUG("Got error %s", virGetLastErrorMessage());
     }
 
     ret = 0;