[libvirt] [PATCH 00/19] Drop virt prefix from tests

Replacig virt prefix with vir prefix in tests. It was suggested on wikipage: http://wiki.libvirt.org/page/BiteSizedTasks#Rename_test_suite_routines_from_... Tomáš Ryšavý (19): tests: Rename virtTestRun to virTestRun. tests: Rename virtTestDifference to virTestDifference. tests: Rename virtTestLoadFile to virTestLoadFile. tests: Rename virtTestCompareToFile to virTestCompareToFile. tests: Rename virtTestDifferenceFull to virTestDifferenceFull. tests: Rename virtTestClearCommandPath to virTestClearCommandPath. tests: Rename virtTest00MActive to virTest00MActive. tests: Rename virtTestCounterReset to virTestCounterReset. tests: Rename virtTestLogContentAndReset to virTestLogContentAndReset. tests: Rename virtTestUseTerminalColors to virTestUseTerminalColors. tests: Rename virtTestQuiesceLibvirtErrors to virTestQuiesceLibvirtErrors. tests: Rename virtTestDifferenceFullNoRegenerate. tests: Rename virtTestDifferenceFullInternal to virTestDifferenceFullInternal. tests: Rename virtTestCaptureProgramExecChild to virTestCaptureProgramExecChild. tests: Rename virtTestDifferenceBin to virTestDifferenceBin. tests: Rename virtTestCaptureProgramOutput to virTestCaptureProgramOutput. tests: Rename virtTestCounterNext to virTestCounterNext. tests: Rename virtTestErrorFuncQuiet to virTestErrorFuncQuiet. tests: Rename virtTestMain to virTestMain. tests/bhyvexml2argvtest.c | 8 ++--- tests/bhyvexml2xmltest.c | 2 +- tests/commandtest.c | 18 +++++----- tests/cputest.c | 8 ++--- tests/domaincapstest.c | 6 ++-- tests/domainconftest.c | 2 +- tests/domainsnapshotxml2xmltest.c | 8 ++--- tests/esxutilstest.c | 10 +++--- tests/eventtest.c | 2 +- tests/fchosttest.c | 10 +++--- tests/fdstreamtest.c | 8 ++--- tests/genericxml2xmltest.c | 2 +- tests/interfacexml2xmltest.c | 6 ++-- tests/jsontest.c | 8 ++--- tests/libvirtdconftest.c | 2 +- tests/lxcconf2xmltest.c | 6 ++-- tests/lxcxml2xmltest.c | 2 +- tests/metadatatest.c | 10 +++--- tests/networkxml2conftest.c | 6 ++-- tests/networkxml2firewalltest.c | 6 ++-- tests/networkxml2xmltest.c | 4 +-- tests/networkxml2xmlupdatetest.c | 6 ++-- tests/nodedevxml2xmltest.c | 6 ++-- tests/nodeinfotest.c | 8 ++--- tests/nsstest.c | 2 +- tests/nwfilterebiptablestest.c | 42 +++++++++++----------- tests/nwfilterxml2firewalltest.c | 6 ++-- tests/nwfilterxml2xmltest.c | 4 +-- tests/objecteventtest.c | 18 +++++----- tests/openvzutilstest.c | 6 ++-- tests/qemuagenttest.c | 2 +- tests/qemuargv2xmltest.c | 10 +++--- tests/qemucapabilitiestest.c | 6 ++-- tests/qemucaps2xmltest.c | 6 ++-- tests/qemucommandutiltest.c | 4 +-- tests/qemuhelptest.c | 6 ++-- tests/qemuhotplugtest.c | 10 +++--- tests/qemumonitorjsontest.c | 14 ++++---- tests/qemumonitortest.c | 6 ++-- tests/qemuxml2argvtest.c | 64 ++++++++++++++++----------------- tests/qemuxml2xmltest.c | 14 ++++---- tests/scsihosttest.c | 4 +-- tests/secretxml2xmltest.c | 4 +-- tests/securityselinuxlabeltest.c | 2 +- tests/securityselinuxtest.c | 26 +++++++------- tests/sexpr2xmltest.c | 6 ++-- tests/sockettest.c | 66 +++++++++++++++++----------------- tests/storagebackendsheepdogtest.c | 4 +-- tests/storagepoolxml2xmltest.c | 4 +-- tests/storagevolxml2argvtest.c | 4 +-- tests/storagevolxml2xmltest.c | 4 +-- tests/sysinfotest.c | 4 +-- tests/testutils.c | 74 +++++++++++++++++++------------------- tests/testutils.h | 68 +++++++++++++++++------------------ tests/utiltest.c | 6 ++-- tests/vboxsnapshotxmltest.c | 10 +++--- tests/viralloctest.c | 14 ++++---- tests/viratomictest.c | 4 +-- tests/virauthconfigtest.c | 16 ++++----- tests/virbitmaptest.c | 26 +++++++------- tests/virbuftest.c | 16 ++++----- tests/vircaps2xmltest.c | 4 +-- tests/vircapstest.c | 8 ++--- tests/vircgrouptest.c | 36 +++++++++---------- tests/vircryptotest.c | 4 +-- tests/virdbustest.c | 20 +++++------ tests/virdrivermoduletest.c | 8 ++--- tests/virendiantest.c | 4 +-- tests/virfiletest.c | 6 ++-- tests/virfirewalltest.c | 36 +++++++++---------- tests/virhashtest.c | 2 +- tests/virhostdevtest.c | 2 +- tests/viridentitytest.c | 12 +++---- tests/viriscsitest.c | 6 ++-- tests/virkeycodetest.c | 4 +-- tests/virkeyfiletest.c | 2 +- tests/virkmodtest.c | 6 ++-- tests/virlockspacetest.c | 14 ++++---- tests/virlogtest.c | 2 +- tests/virnetdaemontest.c | 4 +-- tests/virnetdevbandwidthtest.c | 4 +-- tests/virnetdevtest.c | 2 +- tests/virnetmessagetest.c | 16 ++++----- tests/virnetserverclienttest.c | 2 +- tests/virnetsockettest.c | 32 ++++++++--------- tests/virnettlscontexttest.c | 2 +- tests/virnettlssessiontest.c | 58 +++++++++++++++--------------- tests/virpcitest.c | 6 ++-- tests/virpolkittest.c | 12 +++---- tests/virportallocatortest.c | 8 ++--- tests/virrandomtest.c | 2 +- tests/virrotatingfiletest.c | 26 +++++++------- tests/virscsitest.c | 4 +-- tests/virshtest.c | 38 ++++++++++---------- tests/virstoragetest.c | 12 +++---- tests/virstringtest.c | 62 ++++++++++++++++---------------- tests/virsystemdtest.c | 52 +++++++++++++-------------- tests/virtimetest.c | 52 +++++++++++++-------------- tests/virtypedparamtest.c | 8 ++--- tests/viruritest.c | 24 ++++++------- tests/virusbtest.c | 14 ++++---- tests/vmwarevertest.c | 4 +-- tests/vmx2xmltest.c | 6 ++-- tests/xencapstest.c | 24 ++++++------- tests/xlconfigtest.c | 10 +++--- tests/xmconfigtest.c | 10 +++--- tests/xml2sexprtest.c | 4 +-- tests/xml2vmxtest.c | 4 +-- 108 files changed, 707 insertions(+), 707 deletions(-) -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/testutils.c | 2 +- tests/testutils.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index 934fce5..2dbac99 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -840,7 +840,7 @@ virTestSetEnvPath(void) #define TEST_MOCK (abs_builddir "/.libs/virtestmock.so") -int virtTestMain(int argc, +int virTestMain(int argc, char **argv, const char *lib, int (*func)(void)) diff --git a/tests/testutils.h b/tests/testutils.h index 2b718a1..8c01157 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -100,7 +100,7 @@ void virTestQuiesceLibvirtErrors(bool always); void virTestCounterReset(const char *prefix); const char *virTestCounterNext(void); -int virtTestMain(int argc, +int virTestMain(int argc, char **argv, const char *lib, int (*func)(void)); @@ -108,7 +108,7 @@ int virtTestMain(int argc, /* Setup, then call func() */ # define VIRT_TEST_MAIN(func) \ int main(int argc, char **argv) { \ - return virtTestMain(argc, argv, NULL, func); \ + return virTestMain(argc, argv, NULL, func); \ } # define VIRT_TEST_PRELOAD(lib) \ @@ -133,7 +133,7 @@ int virtTestMain(int argc, # define VIRT_TEST_MAIN_PRELOAD(func, lib) \ int main(int argc, char **argv) { \ - return virtTestMain(argc, argv, lib, func); \ + return virTestMain(argc, argv, lib, func); \ } virCapsPtr virTestGenericCapsInit(void); -- 2.5.0

This function doesn't follow our convention of naming functions. --- tests/bhyvexml2argvtest.c | 2 +- tests/bhyvexml2xmltest.c | 2 +- tests/commandtest.c | 2 +- tests/cputest.c | 2 +- tests/domaincapstest.c | 4 +-- tests/domainconftest.c | 2 +- tests/domainsnapshotxml2xmltest.c | 2 +- tests/esxutilstest.c | 2 +- tests/eventtest.c | 2 +- tests/fchosttest.c | 10 +++--- tests/fdstreamtest.c | 8 ++--- tests/genericxml2xmltest.c | 2 +- tests/interfacexml2xmltest.c | 2 +- tests/jsontest.c | 2 +- tests/libvirtdconftest.c | 2 +- tests/lxcconf2xmltest.c | 2 +- tests/lxcxml2xmltest.c | 2 +- tests/metadatatest.c | 8 ++--- tests/networkxml2conftest.c | 4 +-- tests/networkxml2firewalltest.c | 2 +- tests/networkxml2xmltest.c | 2 +- tests/networkxml2xmlupdatetest.c | 2 +- tests/nodedevxml2xmltest.c | 2 +- tests/nodeinfotest.c | 4 +-- tests/nsstest.c | 2 +- tests/nwfilterebiptablestest.c | 14 ++++----- tests/nwfilterxml2firewalltest.c | 2 +- tests/nwfilterxml2xmltest.c | 2 +- tests/objecteventtest.c | 16 +++++----- tests/openvzutilstest.c | 2 +- tests/qemuagenttest.c | 2 +- tests/qemuargv2xmltest.c | 2 +- tests/qemucapabilitiestest.c | 2 +- tests/qemucaps2xmltest.c | 2 +- tests/qemucommandutiltest.c | 2 +- tests/qemuhelptest.c | 2 +- tests/qemuhotplugtest.c | 2 +- tests/qemumonitorjsontest.c | 10 +++--- tests/qemumonitortest.c | 2 +- tests/qemuxml2argvtest.c | 54 ++++++++++++++++----------------- tests/qemuxml2xmltest.c | 8 ++--- tests/scsihosttest.c | 4 +-- tests/secretxml2xmltest.c | 2 +- tests/securityselinuxlabeltest.c | 2 +- tests/securityselinuxtest.c | 26 ++++++++-------- tests/sexpr2xmltest.c | 2 +- tests/sockettest.c | 62 +++++++++++++++++++------------------- tests/storagebackendsheepdogtest.c | 4 +-- tests/storagepoolxml2xmltest.c | 2 +- tests/storagevolxml2argvtest.c | 2 +- tests/storagevolxml2xmltest.c | 2 +- tests/sysinfotest.c | 2 +- tests/testutils.c | 2 +- tests/testutils.h | 2 +- tests/utiltest.c | 2 +- tests/vboxsnapshotxmltest.c | 4 +-- tests/viralloctest.c | 14 ++++----- tests/viratomictest.c | 4 +-- tests/virauthconfigtest.c | 16 +++++----- tests/virbitmaptest.c | 24 +++++++-------- tests/virbuftest.c | 6 ++-- tests/vircaps2xmltest.c | 2 +- tests/vircapstest.c | 8 ++--- tests/vircgrouptest.c | 34 ++++++++++----------- tests/vircryptotest.c | 4 +-- tests/virdbustest.c | 20 ++++++------ tests/virdrivermoduletest.c | 8 ++--- tests/virendiantest.c | 4 +-- tests/virfiletest.c | 4 +-- tests/virfirewalltest.c | 8 ++--- tests/virhashtest.c | 2 +- tests/virhostdevtest.c | 2 +- tests/viridentitytest.c | 12 ++++---- tests/viriscsitest.c | 6 ++-- tests/virkeycodetest.c | 4 +-- tests/virkeyfiletest.c | 2 +- tests/virkmodtest.c | 4 +-- tests/virlockspacetest.c | 14 ++++----- tests/virlogtest.c | 2 +- tests/virnetdaemontest.c | 2 +- tests/virnetdevbandwidthtest.c | 2 +- tests/virnetdevtest.c | 2 +- tests/virnetmessagetest.c | 10 +++--- tests/virnetserverclienttest.c | 2 +- tests/virnetsockettest.c | 30 +++++++++--------- tests/virnettlscontexttest.c | 2 +- tests/virnettlssessiontest.c | 58 +++++++++++++++++------------------ tests/virpcitest.c | 6 ++-- tests/virpolkittest.c | 12 ++++---- tests/virportallocatortest.c | 8 ++--- tests/virrandomtest.c | 2 +- tests/virrotatingfiletest.c | 26 ++++++++-------- tests/virscsitest.c | 4 +-- tests/virshtest.c | 34 ++++++++++----------- tests/virstoragetest.c | 8 ++--- tests/virstringtest.c | 62 +++++++++++++++++++------------------- tests/virsystemdtest.c | 52 ++++++++++++++++---------------- tests/virtimetest.c | 52 ++++++++++++++++---------------- tests/virtypedparamtest.c | 8 ++--- tests/viruritest.c | 18 +++++------ tests/virusbtest.c | 14 ++++----- tests/vmwarevertest.c | 2 +- tests/vmx2xmltest.c | 2 +- tests/xencapstest.c | 22 +++++++------- tests/xlconfigtest.c | 4 +-- tests/xmconfigtest.c | 4 +-- tests/xml2sexprtest.c | 2 +- tests/xml2vmxtest.c | 2 +- 108 files changed, 488 insertions(+), 488 deletions(-) diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index e46c05b..68d35db 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -136,7 +136,7 @@ mymain(void) static struct testInfo info = { \ name, (flags) \ }; \ - if (virtTestRun("BHYVE XML-2-ARGV " name, \ + if (virTestRun("BHYVE XML-2-ARGV " name, \ testCompareXMLToArgvHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c index c8c6c6e..756d5d2 100644 --- a/tests/bhyvexml2xmltest.c +++ b/tests/bhyvexml2xmltest.c @@ -55,7 +55,7 @@ mymain(void) # define DO_TEST_FULL(name, is_different) \ do { \ const struct testInfo info = {name, is_different}; \ - if (virtTestRun("BHYVE XML-2-XML " name, \ + if (virTestRun("BHYVE XML-2-XML " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/commandtest.c b/tests/commandtest.c index 6430e20..d685b1c 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -1186,7 +1186,7 @@ mymain(void) environ = (char **)newenv; # define DO_TEST(NAME) \ - if (virtTestRun("Command Exec " #NAME " test", \ + if (virTestRun("Command Exec " #NAME " test", \ NAME, NULL) < 0) \ ret = -1 diff --git a/tests/cputest.c b/tests/cputest.c index 431b587..0890985 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -479,7 +479,7 @@ cpuTestRun(const char *name, const struct data *data) tmp = virtTestLogContentAndReset(); VIR_FREE(tmp); - if (virtTestRun(label, cpuTest[data->api], data) < 0) { + if (virTestRun(label, cpuTest[data->api], data) < 0) { if (virTestGetDebug()) { char *log; if ((log = virtTestLogContentAndReset()) && diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 3436197..3f5ed52 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -250,7 +250,7 @@ mymain(void) .type = Type, \ .capsType = CapsType, \ }; \ - if (virtTestRun(Name, test_virDomainCapsFormat, &data) < 0) \ + if (virTestRun(Name, test_virDomainCapsFormat, &data) < 0) \ ret = -1; \ } while (0) @@ -274,7 +274,7 @@ mymain(void) .capsName = CapsName, \ .capsOpaque = cfg, \ }; \ - if (virtTestRun(name, test_virDomainCapsFormat, &data) < 0) \ + if (virTestRun(name, test_virDomainCapsFormat, &data) < 0) \ ret = -1; \ VIR_FREE(name); \ } while (0) diff --git a/tests/domainconftest.c b/tests/domainconftest.c index 53c40c1..7d119bb 100644 --- a/tests/domainconftest.c +++ b/tests/domainconftest.c @@ -97,7 +97,7 @@ mymain(void) .path = fspath, \ .expectEntry = expect, \ }; \ - if (virtTestRun("Get FS " fspath, testGetFilesystem, &data) < 0) \ + if (virTestRun("Get FS " fspath, testGetFilesystem, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c index 714d64f..21fb298 100644 --- a/tests/domainsnapshotxml2xmltest.c +++ b/tests/domainsnapshotxml2xmltest.c @@ -175,7 +175,7 @@ mymain(void) const struct testInfo info = {abs_srcdir "/" inpath "/" name ".xml", \ abs_srcdir "/" outpath "/" name ".xml", \ uuid, internal, redefine}; \ - if (virtTestRun("SNAPSHOT XML-2-XML " prefix " " name, \ + if (virTestRun("SNAPSHOT XML-2-XML " prefix " " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/esxutilstest.c b/tests/esxutilstest.c index 44bdc84..f36a415 100644 --- a/tests/esxutilstest.c +++ b/tests/esxutilstest.c @@ -249,7 +249,7 @@ mymain(void) # define DO_TEST(_name) \ do { \ - if (virtTestRun("VMware "#_name, test##_name, \ + if (virTestRun("VMware "#_name, test##_name, \ NULL) < 0) { \ result = -1; \ } \ diff --git a/tests/eventtest.c b/tests/eventtest.c index c4be606..4b62f34 100644 --- a/tests/eventtest.c +++ b/tests/eventtest.c @@ -92,7 +92,7 @@ testEventReport(const char *name, bool failed, const char *msg, ...) data.failed = failed; data.msg = str; - ignore_value(virtTestRun(name, testEventResultCallback, &data)); + ignore_value(virTestRun(name, testEventResultCallback, &data)); va_end(vargs); VIR_FREE(str); diff --git a/tests/fchosttest.c b/tests/fchosttest.c index 87b3a2a..e9b89a7 100644 --- a/tests/fchosttest.c +++ b/tests/fchosttest.c @@ -169,15 +169,15 @@ mymain(void) goto cleanup; } - if (virtTestRun("test1", test1, NULL) < 0) + if (virTestRun("test1", test1, NULL) < 0) ret = -1; - if (virtTestRun("test2", test2, NULL) < 0) + if (virTestRun("test2", test2, NULL) < 0) ret = -1; - if (virtTestRun("test3", test3, NULL) < 0) + if (virTestRun("test3", test3, NULL) < 0) ret = -1; - if (virtTestRun("test4", test4, NULL) < 0) + if (virTestRun("test4", test4, NULL) < 0) ret = -1; - if (virtTestRun("test5", test5, NULL) < 0) + if (virTestRun("test5", test5, NULL) < 0) ret = -1; cleanup: diff --git a/tests/fdstreamtest.c b/tests/fdstreamtest.c index 56ba5d9..625fd56 100644 --- a/tests/fdstreamtest.c +++ b/tests/fdstreamtest.c @@ -327,13 +327,13 @@ mymain(void) abort(); } - if (virtTestRun("Stream read blocking ", testFDStreamReadBlock, scratchdir) < 0) + if (virTestRun("Stream read blocking ", testFDStreamReadBlock, scratchdir) < 0) ret = -1; - if (virtTestRun("Stream read non-blocking ", testFDStreamReadNonblock, scratchdir) < 0) + if (virTestRun("Stream read non-blocking ", testFDStreamReadNonblock, scratchdir) < 0) ret = -1; - if (virtTestRun("Stream write blocking ", testFDStreamWriteBlock, scratchdir) < 0) + if (virTestRun("Stream write blocking ", testFDStreamWriteBlock, scratchdir) < 0) ret = -1; - if (virtTestRun("Stream write non-blocking ", testFDStreamWriteNonblock, scratchdir) < 0) + if (virTestRun("Stream write non-blocking ", testFDStreamWriteNonblock, scratchdir) < 0) ret = -1; if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL) diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index 70ecd2d..e091a3a 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -64,7 +64,7 @@ mymain(void) do { \ const struct testInfo info = {name, is_different, inactive, \ expectResult}; \ - if (virtTestRun("GENERIC XML-2-XML " name, \ + if (virTestRun("GENERIC XML-2-XML " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/interfacexml2xmltest.c b/tests/interfacexml2xmltest.c index ba34746..073ff7a 100644 --- a/tests/interfacexml2xmltest.c +++ b/tests/interfacexml2xmltest.c @@ -70,7 +70,7 @@ mymain(void) int ret = 0; #define DO_TEST(name) \ - if (virtTestRun("Interface XML-2-XML " name, \ + if (virTestRun("Interface XML-2-XML " name, \ testCompareXMLToXMLHelper, (name)) < 0) \ ret = -1 diff --git a/tests/jsontest.c b/tests/jsontest.c index 223f867..2a6fcde 100644 --- a/tests/jsontest.c +++ b/tests/jsontest.c @@ -319,7 +319,7 @@ mymain(void) #define DO_TEST_FULL(name, cmd, doc, expect, pass) \ do { \ struct testInfo info = { doc, expect, pass }; \ - if (virtTestRun(name, testJSON ## cmd, &info) < 0) \ + if (virTestRun(name, testJSON ## cmd, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/libvirtdconftest.c b/tests/libvirtdconftest.c index daa2b90..b5ad168 100644 --- a/tests/libvirtdconftest.c +++ b/tests/libvirtdconftest.c @@ -231,7 +231,7 @@ mymain(void) STRPREFIX(filedata + params[i], "keepalive_required") || STRPREFIX(filedata + params[i], "admin_keepalive_required")) continue; - if (virtTestRun("Test corruption", testCorrupt, &data) < 0) + if (virTestRun("Test corruption", testCorrupt, &data) < 0) ret = -1; } diff --git a/tests/lxcconf2xmltest.c b/tests/lxcconf2xmltest.c index 7a0893e..17994ec 100644 --- a/tests/lxcconf2xmltest.c +++ b/tests/lxcconf2xmltest.c @@ -101,7 +101,7 @@ mymain(void) # define DO_TEST(name, expectError) \ do { \ const struct testInfo info = { name, expectError }; \ - if (virtTestRun("LXC Native-2-XML " name, \ + if (virTestRun("LXC Native-2-XML " name, \ testCompareXMLToConfigHelper, \ &info) < 0) \ ret = EXIT_FAILURE; \ diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c index 001aa8d..23d4075 100644 --- a/tests/lxcxml2xmltest.c +++ b/tests/lxcxml2xmltest.c @@ -70,7 +70,7 @@ mymain(void) do { \ const struct testInfo info = {name, is_different, inactive, \ parse_flags}; \ - if (virtTestRun("LXC XML-2-XML " name, \ + if (virTestRun("LXC XML-2-XML " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/metadatatest.c b/tests/metadatatest.c index a8d8f10..acaf7a7 100644 --- a/tests/metadatatest.c +++ b/tests/metadatatest.c @@ -256,7 +256,7 @@ testTextMetadata(const void *data) test.data = DATA; \ test.fail = FAIL; \ \ - if (virtTestRun("text metadata: " #TYPE " " INDEX " ", \ + if (virTestRun("text metadata: " #TYPE " " INDEX " ", \ testTextMetadata, &test) < 0) \ ret = EXIT_FAILURE; \ } while (0) @@ -281,11 +281,11 @@ mymain(void) virtTestQuiesceLibvirtErrors(false); - if (virtTestRun("Assign metadata ", testAssignMetadata, &test) < 0) + if (virTestRun("Assign metadata ", testAssignMetadata, &test) < 0) ret = EXIT_FAILURE; - if (virtTestRun("Rewrite Metadata ", testRewriteMetadata, &test) < 0) + if (virTestRun("Rewrite Metadata ", testRewriteMetadata, &test) < 0) ret = EXIT_FAILURE; - if (virtTestRun("Erase metadata ", testEraseMetadata, &test) < 0) + if (virTestRun("Erase metadata ", testEraseMetadata, &test) < 0) ret = EXIT_FAILURE; TEST_TITLE("1", "qwert"); diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index a5f2711..79853e4 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -104,8 +104,8 @@ mymain(void) static testInfo info; \ \ info.name = xname; \ - info.caps = xcaps; \ - if (virtTestRun("Network XML-2-Conf " xname, \ + info.caps = xcaps; \ + if (virTestRun("Network XML-2-Conf " xname, \ testCompareXMLToConfHelper, &info) < 0) { \ ret = -1; \ } \ diff --git a/tests/networkxml2firewalltest.c b/tests/networkxml2firewalltest.c index 0f38180..15e6bbe 100644 --- a/tests/networkxml2firewalltest.c +++ b/tests/networkxml2firewalltest.c @@ -123,7 +123,7 @@ mymain(void) static struct testInfo info = { \ name, \ }; \ - if (virtTestRun("Network XML-2-iptables " name, \ + if (virTestRun("Network XML-2-iptables " name, \ testCompareXMLToIPTablesHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index c069f3d..ac9d4be 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -112,7 +112,7 @@ mymain(void) #define DO_TEST_FULL(name, flags, expectResult) \ do { \ const struct testInfo info = {name, flags, expectResult}; \ - if (virtTestRun("Network XML-2-XML " name, \ + if (virTestRun("Network XML-2-XML " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/networkxml2xmlupdatetest.c b/tests/networkxml2xmlupdatetest.c index 0241378..d2a093f 100644 --- a/tests/networkxml2xmlupdatetest.c +++ b/tests/networkxml2xmlupdatetest.c @@ -118,7 +118,7 @@ mymain(void) const struct testInfo info = {name, updatexml, netxml, outxml, \ command, section, flags, \ parentIndex, expectFailure}; \ - if (virtTestRun("Network XML-2-XML " name, \ + if (virTestRun("Network XML-2-XML " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c index 0ed06fd..09f9341 100644 --- a/tests/nodedevxml2xmltest.c +++ b/tests/nodedevxml2xmltest.c @@ -70,7 +70,7 @@ mymain(void) int ret = 0; #define DO_TEST(name) \ - if (virtTestRun("Node device XML-2-XML " name, \ + if (virTestRun("Node device XML-2-XML " name, \ testCompareXMLToXMLHelper, (name)) < 0) \ ret = -1 diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index 03500fb..bfce0bd 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -245,13 +245,13 @@ mymain(void) return EXIT_FAILURE; for (i = 0; i < ARRAY_CARDINALITY(nodeData); i++) - if (virtTestRun(nodeData[i].testName, linuxTestNodeInfo, &nodeData[i]) != 0) + if (virTestRun(nodeData[i].testName, linuxTestNodeInfo, &nodeData[i]) != 0) ret = -1; # define DO_TEST_CPU_STATS(name, ncpus) \ do { \ static struct nodeCPUStatsData data = { name, ncpus }; \ - if (virtTestRun("CPU stats " name, linuxTestNodeCPUStats, &data) < 0) \ + if (virTestRun("CPU stats " name, linuxTestNodeCPUStats, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/nsstest.c b/tests/nsstest.c index 63c7162..8648c4a 100644 --- a/tests/nsstest.c +++ b/tests/nsstest.c @@ -180,7 +180,7 @@ mymain(void) struct testNSSData data = { \ .hostname = name, .ipAddr = addr, .af = family, \ }; \ - if (virtTestRun(name, testGetHostByName, &data) < 0) \ + if (virTestRun(name, testGetHostByName, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/nwfilterebiptablestest.c b/tests/nwfilterebiptablestest.c index 6bd6aad..475e844 100644 --- a/tests/nwfilterebiptablestest.c +++ b/tests/nwfilterebiptablestest.c @@ -530,37 +530,37 @@ mymain(void) goto cleanup; } - if (virtTestRun("ebiptablesAllTeardown", + if (virTestRun("ebiptablesAllTeardown", testNWFilterEBIPTablesAllTeardown, NULL) < 0) ret = -1; - if (virtTestRun("ebiptablesTearOldRules", + if (virTestRun("ebiptablesTearOldRules", testNWFilterEBIPTablesTearOldRules, NULL) < 0) ret = -1; - if (virtTestRun("ebiptablesRemoveBasicRules", + if (virTestRun("ebiptablesRemoveBasicRules", testNWFilterEBIPTablesRemoveBasicRules, NULL) < 0) ret = -1; - if (virtTestRun("ebiptablesTearNewRules", + if (virTestRun("ebiptablesTearNewRules", testNWFilterEBIPTablesTearNewRules, NULL) < 0) ret = -1; - if (virtTestRun("ebiptablesApplyBasicRules", + if (virTestRun("ebiptablesApplyBasicRules", testNWFilterEBIPTablesApplyBasicRules, NULL) < 0) ret = -1; - if (virtTestRun("ebiptablesApplyDHCPOnlyRules", + if (virTestRun("ebiptablesApplyDHCPOnlyRules", testNWFilterEBIPTablesApplyDHCPOnlyRules, NULL) < 0) ret = -1; - if (virtTestRun("ebiptablesApplyDropAllRules", + if (virTestRun("ebiptablesApplyDropAllRules", testNWFilterEBIPTablesApplyDropAllRules, NULL) < 0) ret = -1; diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewalltest.c index 3398989..33d8c83 100644 --- a/tests/nwfilterxml2firewalltest.c +++ b/tests/nwfilterxml2firewalltest.c @@ -460,7 +460,7 @@ mymain(void) static struct testInfo info = { \ name, \ }; \ - if (virtTestRun("NWFilter XML-2-firewall " name, \ + if (virTestRun("NWFilter XML-2-firewall " name, \ testCompareXMLToIPTablesHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/nwfilterxml2xmltest.c b/tests/nwfilterxml2xmltest.c index 361a9a2..b395bb0 100644 --- a/tests/nwfilterxml2xmltest.c +++ b/tests/nwfilterxml2xmltest.c @@ -92,7 +92,7 @@ mymain(void) .name = NAME, \ .expect_warning = EXPECT_WARN, \ }; \ - if (virtTestRun("NWFilter XML-2-XML " NAME, \ + if (virTestRun("NWFilter XML-2-XML " NAME, \ testCompareXMLToXMLHelper, (&tp)) < 0) \ ret = -1; \ } while (0) diff --git a/tests/objecteventtest.c b/tests/objecteventtest.c index 95fbfec..1c200e8 100644 --- a/tests/objecteventtest.c +++ b/tests/objecteventtest.c @@ -549,31 +549,31 @@ mymain(void) virtTestQuiesceLibvirtErrors(false); /* Domain event tests */ - if (virtTestRun("Domain createXML start event (old API)", + if (virTestRun("Domain createXML start event (old API)", testDomainCreateXMLOld, &test) < 0) ret = EXIT_FAILURE; - if (virtTestRun("Domain createXML start event (new API)", + if (virTestRun("Domain createXML start event (new API)", testDomainCreateXMLNew, &test) < 0) ret = EXIT_FAILURE; - if (virtTestRun("Domain createXML start event (both API)", + if (virTestRun("Domain createXML start event (both API)", testDomainCreateXMLMixed, &test) < 0) ret = EXIT_FAILURE; - if (virtTestRun("Domain (un)define events", testDomainDefine, &test) < 0) + if (virTestRun("Domain (un)define events", testDomainDefine, &test) < 0) ret = EXIT_FAILURE; - if (virtTestRun("Domain start stop events", testDomainStartStopEvent, &test) < 0) + if (virTestRun("Domain start stop events", testDomainStartStopEvent, &test) < 0) ret = EXIT_FAILURE; /* Network event tests */ /* Tests requiring the test network not to be set up*/ - if (virtTestRun("Network createXML start event ", testNetworkCreateXML, &test) < 0) + if (virTestRun("Network createXML start event ", testNetworkCreateXML, &test) < 0) ret = EXIT_FAILURE; - if (virtTestRun("Network (un)define events", testNetworkDefine, &test) < 0) + if (virTestRun("Network (un)define events", testNetworkDefine, &test) < 0) ret = EXIT_FAILURE; /* Define a test network */ if (!(test.net = virNetworkDefineXML(test.conn, networkDef))) ret = EXIT_FAILURE; - if (virtTestRun("Network start stop events ", testNetworkStartStopEvent, &test) < 0) + if (virTestRun("Network start stop events ", testNetworkStartStopEvent, &test) < 0) ret = EXIT_FAILURE; /* Cleanup */ diff --git a/tests/openvzutilstest.c b/tests/openvzutilstest.c index d747165..fc5bee0 100644 --- a/tests/openvzutilstest.c +++ b/tests/openvzutilstest.c @@ -143,7 +143,7 @@ mymain(void) # define DO_TEST(_name) \ do { \ - if (virtTestRun("OpenVZ "#_name, test##_name, \ + if (virTestRun("OpenVZ "#_name, test##_name, \ NULL) < 0) { \ result = -1; \ } \ diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index bd66fcb..60dafd9 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -923,7 +923,7 @@ mymain(void) virEventRegisterDefaultImpl(); #define DO_TEST(name) \ - if (virtTestRun(# name, testQemuAgent ## name, driver.xmlopt) < 0) \ + if (virTestRun(# name, testQemuAgent ## name, driver.xmlopt) < 0) \ ret = -1 DO_TEST(FSFreeze); diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index 0fe6b9b..5e761d6 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -158,7 +158,7 @@ mymain(void) # define DO_TEST_FULL(name, flags) \ do { \ const struct testInfo info = { name, (flags) }; \ - if (virtTestRun("QEMU ARGV-2-XML " name, \ + if (virTestRun("QEMU ARGV-2-XML " name, \ testCompareXMLToArgvHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 058ad8c..0cee801 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -156,7 +156,7 @@ mymain(void) do { \ data.archName = arch; \ data.base = name; \ - if (virtTestRun(name "(" arch ")", testQemuCaps, &data) < 0) \ + if (virTestRun(name "(" arch ")", testQemuCaps, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 7adde24..39d79a1 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -178,7 +178,7 @@ mymain(void) #define DO_TEST_FULL(name, guest) \ data.base = name; \ data.guestarch = guest; \ - if (virtTestRun(name, testQemuCapsXML, &data) < 0) \ + if (virTestRun(name, testQemuCapsXML, &data) < 0) \ ret = -1 #define DO_TEST(name) DO_TEST_FULL(name, VIR_ARCH_I686) diff --git a/tests/qemucommandutiltest.c b/tests/qemucommandutiltest.c index bd457f8..4eba3f4 100644 --- a/tests/qemucommandutiltest.c +++ b/tests/qemucommandutiltest.c @@ -87,7 +87,7 @@ mymain(void) do { \ data1.props = PROPS; \ data1.expectprops = EXPECT; \ - if (virtTestRun(virtTestCounterNext(), \ + if (virTestRun(virtTestCounterNext(), \ testQemuCommandBuildObjectFromJSON, \ &data1) < 0) \ ret = -1; \ diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index e159b6e..8746410 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -140,7 +140,7 @@ mymain(void) if (!(info.flags = virQEMUCapsNew())) \ return EXIT_FAILURE; \ virQEMUCapsSetList(info.flags, __VA_ARGS__, QEMU_CAPS_LAST); \ - if (virtTestRun("QEMU Help String Parsing " name, \ + if (virTestRun("QEMU Help String Parsing " name, \ testHelpStrParsing, &info) < 0) \ ret = -1; \ virObjectUnref(info.flags); \ diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 689adc3..3961328 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -379,7 +379,7 @@ mymain(void) data.mon = my_mon; \ data.keep = kep; \ data.deviceDeletedEvent = event; \ - if (virtTestRun(name, testQemuHotplug, &data) < 0) \ + if (virTestRun(name, testQemuHotplug, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 87b1a8f..7d56941 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2336,26 +2336,26 @@ mymain(void) virEventRegisterDefaultImpl(); #define DO_TEST(name) \ - if (virtTestRun(# name, testQemuMonitorJSON ## name, driver.xmlopt) < 0) \ + if (virTestRun(# name, testQemuMonitorJSON ## name, driver.xmlopt) < 0) \ ret = -1 -#define DO_TEST_SIMPLE(CMD, FNC, ...) \ +#define DO_TEST_SIMPLE(CMD, FNC, ...) \ simpleFunc = (testQemuMonitorJSONSimpleFuncData) {.cmd = CMD, .func = FNC, \ .xmlopt = driver.xmlopt, __VA_ARGS__ }; \ - if (virtTestRun(# FNC, testQemuMonitorJSONSimpleFunc, &simpleFunc) < 0) \ + if (virTestRun(# FNC, testQemuMonitorJSONSimpleFunc, &simpleFunc) < 0) \ ret = -1 #define DO_TEST_GEN(name, ...) \ simpleFunc = (testQemuMonitorJSONSimpleFuncData) {.xmlopt = driver.xmlopt, \ __VA_ARGS__ }; \ - if (virtTestRun(# name, testQemuMonitorJSON ## name, &simpleFunc) < 0) \ + if (virTestRun(# name, testQemuMonitorJSON ## name, &simpleFunc) < 0) \ ret = -1 #define DO_TEST_CPU_DATA(name) \ do { \ struct testCPUData data = { name, driver.xmlopt }; \ const char *label = "GetCPUData(" name ")"; \ - if (virtTestRun(label, testQemuMonitorJSONGetCPUData, &data) < 0) \ + if (virTestRun(label, testQemuMonitorJSONGetCPUData, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/qemumonitortest.c b/tests/qemumonitortest.c index 324021a..a1c44f7 100644 --- a/tests/qemumonitortest.c +++ b/tests/qemumonitortest.c @@ -176,7 +176,7 @@ mymain(void) # define DO_TEST(_name) \ do { \ - if (virtTestRun("qemu monitor "#_name, test##_name, \ + if (virTestRun("qemu monitor "#_name, test##_name, \ driver.xmlopt) < 0) { \ result = -1; \ } \ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 7bf9300..cb7eefa 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -521,42 +521,42 @@ mymain(void) if (VIR_STRDUP_QUIET(driver.config->spicePassword, "123456") < 0) return EXIT_FAILURE; -# define DO_TEST_FULL(name, migrateFrom, migrateFd, flags, \ - parseFlags, gic, ...) \ - do { \ - static struct testInfo info = { \ - name, NULL, migrateFrom, migrateFd, (flags), parseFlags \ - }; \ - if (testPrepareExtraFlags(&info, skipLegacyCPUs, gic) < 0) \ - return EXIT_FAILURE; \ +# define DO_TEST_FULL(name, migrateFrom, migrateFd, flags, \ + parseFlags, gic, ...) \ + do { \ + static struct testInfo info = { \ + name, NULL, migrateFrom, migrateFd, (flags), parseFlags \ + }; \ + if (testPrepareExtraFlags(&info, skipLegacyCPUs, gic) < 0) \ + return EXIT_FAILURE; \ virQEMUCapsSetList(info.extraFlags, __VA_ARGS__, QEMU_CAPS_LAST);\ - if (virtTestRun("QEMU XML-2-ARGV " name, \ - testCompareXMLToArgvHelper, &info) < 0) \ - ret = -1; \ - virObjectUnref(info.extraFlags); \ + if (virTestRun("QEMU XML-2-ARGV " name, \ + testCompareXMLToArgvHelper, &info) < 0) \ + ret = -1; \ + virObjectUnref(info.extraFlags); \ } while (0) -# define DO_TEST(name, ...) \ +# define DO_TEST(name, ...) \ DO_TEST_FULL(name, NULL, -1, 0, 0, GIC_NONE, __VA_ARGS__) -# define DO_TEST_GIC(name, gic, ...) \ +# define DO_TEST_GIC(name, gic, ...) \ DO_TEST_FULL(name, NULL, -1, 0, 0, gic, __VA_ARGS__) -# define DO_TEST_FAILURE(name, ...) \ - DO_TEST_FULL(name, NULL, -1, FLAG_EXPECT_FAILURE, \ +# define DO_TEST_FAILURE(name, ...) \ + DO_TEST_FULL(name, NULL, -1, FLAG_EXPECT_FAILURE, \ 0, GIC_NONE, __VA_ARGS__) -# define DO_TEST_PARSE_ERROR(name, ...) \ - DO_TEST_FULL(name, NULL, -1, \ - FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ +# define DO_TEST_PARSE_ERROR(name, ...) \ + DO_TEST_FULL(name, NULL, -1, \ + FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ 0, GIC_NONE, __VA_ARGS__) -# define DO_TEST_PARSE_FLAGS_ERROR(name, parseFlags, ...) \ - DO_TEST_FULL(name, NULL, -1, \ - FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ +# define DO_TEST_PARSE_FLAGS_ERROR(name, parseFlags, ...) \ + DO_TEST_FULL(name, NULL, -1, \ + FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \ parseFlags, GIC_NONE, __VA_ARGS__) -# define DO_TEST_LINUX(name, ...) \ +# define DO_TEST_LINUX(name, ...) \ DO_TEST_LINUX_FULL(name, NULL, -1, 0, 0, GIC_NONE, __VA_ARGS__) # ifdef __linux__ @@ -565,12 +565,12 @@ mymain(void) * cooperation is expected (e.g. we need a fixed time, * predictable NUMA topology and so on). On non-Linux * platforms the macro just consume its argument. */ -# define DO_TEST_LINUX_FULL(name, ...) \ +# define DO_TEST_LINUX_FULL(name, ...) \ DO_TEST_FULL(name, __VA_ARGS__) # else /* __linux__ */ -# define DO_TEST_LINUX_FULL(name, ...) \ - do { \ - const char *tmp ATTRIBUTE_UNUSED = name; \ +# define DO_TEST_LINUX_FULL(name, ...) \ + do { \ + const char *tmp ATTRIBUTE_UNUSED = name; \ } while (0) # endif /* __linux__ */ diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index c85cd60..5f3a0b3 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -272,23 +272,23 @@ mymain(void) # define DO_TEST_FULL(name, when, gic, ...) \ do { \ if (testInfoSet(&info, name, when, gic) < 0) { \ - VIR_TEST_DEBUG("Failed to generate test data for '%s'", name); \ + VIR_TEST_DEBUG("Failed to generate test data for '%s'", name); \ return -1; \ } \ virQEMUCapsSetList(info.qemuCaps, __VA_ARGS__, QEMU_CAPS_LAST); \ \ if (info.outInactiveName) { \ - if (virtTestRun("QEMU XML-2-XML-inactive " name, \ + if (virTestRun("QEMU XML-2-XML-inactive " name, \ testXML2XMLInactive, &info) < 0) \ ret = -1; \ } \ \ if (info.outActiveName) { \ - if (virtTestRun("QEMU XML-2-XML-active " name, \ + if (virTestRun("QEMU XML-2-XML-active " name, \ testXML2XMLActive, &info) < 0) \ ret = -1; \ \ - if (virtTestRun("QEMU XML-2-XML-status " name, \ + if (virTestRun("QEMU XML-2-XML-status " name, \ testCompareStatusXMLToXMLFiles, &info) < 0) \ ret = -1; \ } \ diff --git a/tests/scsihosttest.c b/tests/scsihosttest.c index ab3b0ae..8339de8 100644 --- a/tests/scsihosttest.c +++ b/tests/scsihosttest.c @@ -280,13 +280,13 @@ mymain(void) } VIR_DEBUG("Reading from '%s'", scsihost_class_path); - if (virtTestRun("testVirReadSCSIUniqueId", + if (virTestRun("testVirReadSCSIUniqueId", testVirReadSCSIUniqueId, NULL) < 0) { ret = -1; goto cleanup; } - if (virtTestRun("testVirFindSCSIHostByPCI", + if (virTestRun("testVirFindSCSIHostByPCI", testVirFindSCSIHostByPCI, NULL) < 0) { ret = -1; goto cleanup; diff --git a/tests/secretxml2xmltest.c b/tests/secretxml2xmltest.c index b4c9386..16c0f79 100644 --- a/tests/secretxml2xmltest.c +++ b/tests/secretxml2xmltest.c @@ -71,7 +71,7 @@ mymain(void) #define DO_TEST(name) \ do { \ const struct testInfo info = {name, false}; \ - if (virtTestRun("Secret XML->XML " name, \ + if (virTestRun("Secret XML->XML " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c index c82b3f2..7d5544b 100644 --- a/tests/securityselinuxlabeltest.c +++ b/tests/securityselinuxlabeltest.c @@ -367,7 +367,7 @@ mymain(void) return EXIT_FAILURE; #define DO_TEST_LABELING(name) \ - if (virtTestRun("Labelling " # name, testSELinuxLabeling, name) < 0) \ + if (virTestRun("Labelling " # name, testSELinuxLabeling, name) < 0) \ ret = -1; setcon((security_context_t)"system_r:system_u:libvirtd_t:s0:c0.c1023"); diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c index 3423e66..aba1e8e 100644 --- a/tests/securityselinuxtest.c +++ b/tests/securityselinuxtest.c @@ -279,19 +279,19 @@ mymain(void) return EXIT_FAILURE; } -#define DO_TEST_GEN_LABEL(desc, pidcon, \ - dynamic, label, baselabel, \ - user, role, imageRole, \ - type, imageType, \ - sensMin, sensMax, catMin, catMax) \ - do { \ - struct testSELinuxGenLabelData data = { \ - mgr, pidcon, dynamic, label, baselabel, \ - user, role, imageRole, type, imageType, \ - sensMin, sensMax, catMin, catMax \ - }; \ - if (virtTestRun("GenLabel " # desc, testSELinuxGenLabel, &data) < 0) \ - ret = -1; \ +#define DO_TEST_GEN_LABEL(desc, pidcon, \ + dynamic, label, baselabel, \ + user, role, imageRole, \ + type, imageType, \ + sensMin, sensMax, catMin, catMax) \ + do { \ + struct testSELinuxGenLabelData data = { \ + mgr, pidcon, dynamic, label, baselabel, \ + user, role, imageRole, type, imageType, \ + sensMin, sensMax, catMin, catMax \ + }; \ + if (virTestRun("GenLabel " # desc, testSELinuxGenLabel, &data) < 0) \ + ret = -1; \ } while (0) DO_TEST_GEN_LABEL("dynamic unconfined, s0, c0.c1023", diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index a4b0452..a488c60 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -125,7 +125,7 @@ mymain(void) do { \ struct testInfo info = { in, out }; \ virResetLastError(); \ - if (virtTestRun("Xen SEXPR-2-XML " in " -> " out, \ + if (virTestRun("Xen SEXPR-2-XML " in " -> " out, \ testCompareHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/sockettest.c b/tests/sockettest.c index 8f46218..34cdb7c 100644 --- a/tests/sockettest.c +++ b/tests/sockettest.c @@ -279,35 +279,35 @@ mymain(void) virSocketAddr addr; \ struct testParseData data = { &addr, addrstr, family, pass }; \ memset(&addr, 0, sizeof(addr)); \ - if (virtTestRun("Test parse " addrstr " family " #family, \ + if (virTestRun("Test parse " addrstr " family " #family, \ testParseHelper, &data) < 0) \ ret = -1; \ struct testFormatData data2 = { &addr, addrstr, pass }; \ - if (virtTestRun("Test format " addrstr " family " #family, \ + if (virTestRun("Test format " addrstr " family " #family, \ testFormatHelper, &data2) < 0) \ ret = -1; \ } while (0) #define DO_TEST_PARSE_AND_CHECK_FORMAT(addrstr, addrformated, family, pass) \ - do { \ - virSocketAddr addr; \ - struct testParseData data = { &addr, addrstr, family, true}; \ - memset(&addr, 0, sizeof(addr)); \ - if (virtTestRun("Test parse " addrstr " family " #family, \ - testParseHelper, &data) < 0) \ - ret = -1; \ - struct testFormatData data2 = { &addr, addrformated, pass }; \ - if (virtTestRun("Test format " addrstr " family " #family, \ - testFormatHelper, &data2) < 0) \ - ret = -1; \ + do { \ + virSocketAddr addr; \ + struct testParseData data = { &addr, addrstr, family, true}; \ + memset(&addr, 0, sizeof(addr)); \ + if (virTestRun("Test parse " addrstr " family " #family, \ + testParseHelper, &data) < 0) \ + ret = -1; \ + struct testFormatData data2 = { &addr, addrformated, pass }; \ + if (virTestRun("Test format " addrstr " family " #family, \ + testFormatHelper, &data2) < 0) \ + ret = -1; \ } while (0) #define DO_TEST_RANGE(saddr, eaddr, netaddr, prefix, size, pass) \ do { \ struct testRangeData data \ = { saddr, eaddr, netaddr, prefix, size, pass }; \ - if (virtTestRun("Test range " saddr " -> " eaddr "(" netaddr \ - "/" #prefix") size " #size, \ + if (virTestRun("Test range " saddr " -> " eaddr "(" netaddr \ + "/" #prefix") size " #size, \ testRangeHelper, &data) < 0) \ ret = -1; \ } while (0) @@ -316,31 +316,31 @@ mymain(void) do { \ struct testRangeData data \ = { saddr, eaddr, NULL, 0, size, pass }; \ - if (virtTestRun("Test range " saddr " -> " eaddr "size " #size, \ + if (virTestRun("Test range " saddr " -> " eaddr "size " #size, \ testRangeHelper, &data) < 0) \ ret = -1; \ } while (0) -#define DO_TEST_NETMASK(addr1, addr2, netmask, pass) \ - do { \ - struct testNetmaskData data = { addr1, addr2, netmask, pass }; \ - if (virtTestRun("Test netmask " addr1 " + " addr2 " in " netmask, \ - testNetmaskHelper, &data) < 0) \ - ret = -1; \ +#define DO_TEST_NETMASK(addr1, addr2, netmask, pass) \ + do { \ + struct testNetmaskData data = { addr1, addr2, netmask, pass }; \ + if (virTestRun("Test netmask " addr1 " + " addr2 " in " netmask, \ + testNetmaskHelper, &data) < 0) \ + ret = -1; \ } while (0) -#define DO_TEST_MASK_NETWORK(addr1, prefix, network) \ - do { \ - struct testMaskNetworkData data = { addr1, prefix, network }; \ - if (virtTestRun("Test mask network " addr1 " / " #prefix " == " network, \ - testMaskNetworkHelper, &data) < 0) \ - ret = -1; \ +#define DO_TEST_MASK_NETWORK(addr1, prefix, network) \ + do { \ + struct testMaskNetworkData data = { addr1, prefix, network }; \ + if (virTestRun("Test mask network " addr1 " / " #prefix " == " network, \ + testMaskNetworkHelper, &data) < 0) \ + ret = -1; \ } while (0) #define DO_TEST_WILDCARD(addr, pass) \ do { \ struct testWildcardData data = { addr, pass}; \ - if (virtTestRun("Test wildcard " addr, \ + if (virTestRun("Test wildcard " addr, \ testWildcardHelper, &data) < 0) \ ret = -1; \ } while (0) @@ -348,7 +348,7 @@ mymain(void) #define DO_TEST_NUMERIC_FAMILY(addr, pass) \ do { \ struct testNumericData data = { addr, pass }; \ - if (virtTestRun("Test Numeric Family" addr, \ + if (virTestRun("Test Numeric Family" addr, \ testNumericHelper, &data) < 0) \ ret = -1; \ } while (0) @@ -356,7 +356,7 @@ mymain(void) #define DO_TEST_LOCALHOST(addr, pass) \ do { \ struct testIsLocalhostData data = { addr, pass }; \ - if (virtTestRun("Test localhost " addr, \ + if (virTestRun("Test localhost " addr, \ testIsLocalhostHelper, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/storagebackendsheepdogtest.c b/tests/storagebackendsheepdogtest.c index 2b0f4db..5cbd15b 100644 --- a/tests/storagebackendsheepdogtest.c +++ b/tests/storagebackendsheepdogtest.c @@ -191,7 +191,7 @@ mymain(void) .data = collie, \ .poolxml = poolxml, \ }; \ - if (virtTestRun("node_info_parser", test_node_info_parser, \ + if (virTestRun("node_info_parser", test_node_info_parser, \ &data) < 0) \ ret = -1; \ } while (0) @@ -209,7 +209,7 @@ mymain(void) .poolxml = poolxml, \ .volxml = volxml, \ }; \ - if (virtTestRun("vdi_list_parser", test_vdi_list_parser, \ + if (virTestRun("vdi_list_parser", test_vdi_list_parser, \ &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index b432b85..6501e32 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -69,7 +69,7 @@ mymain(void) int ret = 0; #define DO_TEST(name) \ - if (virtTestRun("Storage Pool XML-2-XML " name, \ + if (virTestRun("Storage Pool XML-2-XML " name, \ testCompareXMLToXMLHelper, (name)) < 0) \ ret = -1 diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index 393123b..b44df09 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -187,7 +187,7 @@ mymain(void) do { \ struct testInfo info = { shouldFail, pool, vol, inputpool, inputvol, \ cmdline, flags, imgformat, parseflags }; \ - if (virtTestRun("Storage Vol XML-2-argv " cmdline, \ + if (virTestRun("Storage Vol XML-2-argv " cmdline, \ testCompareXMLToArgvHelper, &info) < 0) \ ret = -1; \ } \ diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c index 148d1e6..580b70a 100644 --- a/tests/storagevolxml2xmltest.c +++ b/tests/storagevolxml2xmltest.c @@ -89,7 +89,7 @@ mymain(void) #define DO_TEST_FULL(pool, name, flags) \ do { \ struct testInfo info = { pool, name, flags }; \ - if (virtTestRun("Storage Vol XML-2-XML " name, \ + if (virTestRun("Storage Vol XML-2-XML " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } \ diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index 74e5f71..596f61f 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -112,7 +112,7 @@ sysinfotest_run(const char *test, goto error; } - if (virtTestRun(test, testSysinfo, &testdata) < 0) + if (virTestRun(test, testSysinfo, &testdata) < 0) goto error; ret = EXIT_SUCCESS; diff --git a/tests/testutils.c b/tests/testutils.c index f4fbad2..23e8b13 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -152,7 +152,7 @@ virTestShowTrace(void) * returns: -1 = error, 0 = success */ int -virtTestRun(const char *title, +virTestRun(const char *title, int (*body)(const void *data), const void *data) { int ret = 0; diff --git a/tests/testutils.h b/tests/testutils.h index c892902..1b912c9 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -48,7 +48,7 @@ extern char *progname; bool virtTestOOMActive(void); -int virtTestRun(const char *title, +int virTestRun(const char *title, int (*body)(const void *data), const void *data); int virtTestLoadFile(const char *file, char **buf); diff --git a/tests/utiltest.c b/tests/utiltest.c index a8f9060..178c29e 100644 --- a/tests/utiltest.c +++ b/tests/utiltest.c @@ -267,7 +267,7 @@ mymain(void) #define DO_TEST(_name) \ do { \ - if (virtTestRun("Util "#_name, test##_name, \ + if (virTestRun("Util "#_name, test##_name, \ NULL) < 0) { \ result = -1; \ } \ diff --git a/tests/vboxsnapshotxmltest.c b/tests/vboxsnapshotxmltest.c index 4ee7537..24f537d 100644 --- a/tests/vboxsnapshotxmltest.c +++ b/tests/vboxsnapshotxmltest.c @@ -135,8 +135,8 @@ mymain(void) } # define DO_TEST(name) \ - if (virtTestRun("VBox Snapshot XML-2-XML " name, \ - testCompareXMLToXMLHelper, (name)) < 0) \ + if (virTestRun("VBox Snapshot XML-2-XML " name, \ + testCompareXMLToXMLHelper, (name)) < 0) \ ret = -1 DO_TEST("2disks-nosnap"); diff --git a/tests/viralloctest.c b/tests/viralloctest.c index dd54f81..82c3311 100644 --- a/tests/viralloctest.c +++ b/tests/viralloctest.c @@ -423,19 +423,19 @@ mymain(void) { int ret = 0; - if (virtTestRun("alloc scalar", testAllocScalar, NULL) < 0) + if (virTestRun("alloc scalar", testAllocScalar, NULL) < 0) ret = -1; - if (virtTestRun("alloc array", testAllocArray, NULL) < 0) + if (virTestRun("alloc array", testAllocArray, NULL) < 0) ret = -1; - if (virtTestRun("realloc array", testReallocArray, NULL) < 0) + if (virTestRun("realloc array", testReallocArray, NULL) < 0) ret = -1; - if (virtTestRun("expand array", testExpandArray, NULL) < 0) + if (virTestRun("expand array", testExpandArray, NULL) < 0) ret = -1; - if (virtTestRun("resize array", testResizeArray, NULL) < 0) + if (virTestRun("resize array", testResizeArray, NULL) < 0) ret = -1; - if (virtTestRun("insert array", testInsertArray, NULL) < 0) + if (virTestRun("insert array", testInsertArray, NULL) < 0) ret = -1; - if (virtTestRun("dispose tests", testDispose, NULL) < 0) + if (virTestRun("dispose tests", testDispose, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/viratomictest.c b/tests/viratomictest.c index 49dd388..634f5ab 100644 --- a/tests/viratomictest.c +++ b/tests/viratomictest.c @@ -167,9 +167,9 @@ mymain(void) if (virThreadInitialize() < 0) return -1; - if (virtTestRun("types", testTypes, NULL) < 0) + if (virTestRun("types", testTypes, NULL) < 0) ret = -1; - if (virtTestRun("threads", testThreads, NULL) < 0) + if (virTestRun("threads", testThreads, NULL) < 0) ret = -1; return ret; diff --git a/tests/virauthconfigtest.c b/tests/virauthconfigtest.c index 4c380b9..6879a29 100644 --- a/tests/virauthconfigtest.c +++ b/tests/virauthconfigtest.c @@ -92,14 +92,14 @@ mymain(void) signal(SIGPIPE, SIG_IGN); -#define TEST_LOOKUP(config, hostname, service, credname, expect) \ - do { \ - const struct ConfigLookupData data = { \ - config, hostname, service, credname, expect \ - }; \ - if (virtTestRun("Test Lookup " hostname "-" service "-" credname, \ - testAuthLookup, &data) < 0) \ - ret = -1; \ +#define TEST_LOOKUP(config, hostname, service, credname, expect) \ + do { \ + const struct ConfigLookupData data = { \ + config, hostname, service, credname, expect \ + }; \ + if (virTestRun("Test Lookup " hostname "-" service "-" credname, \ + testAuthLookup, &data) < 0) \ + ret = -1; \ } while (0) const char *confdata = diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index a030a92..a59065b 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -645,7 +645,7 @@ test12(const void *opaque ATTRIBUTE_UNUSED) testBinaryOpData.a = A; \ testBinaryOpData.b = B; \ testBinaryOpData.res = RES; \ - if (virtTestRun(virtTestCounterNext(), FUNC, &testBinaryOpData) < 0) \ + if (virTestRun(virtTestCounterNext(), FUNC, &testBinaryOpData) < 0) \ ret = -1; static int @@ -654,25 +654,25 @@ mymain(void) struct testBinaryOpData testBinaryOpData; int ret = 0; - if (virtTestRun("test1", test1, NULL) < 0) + if (virTestRun("test1", test1, NULL) < 0) ret = -1; - if (virtTestRun("test2", test2, NULL) < 0) + if (virTestRun("test2", test2, NULL) < 0) ret = -1; - if (virtTestRun("test3", test3, NULL) < 0) + if (virTestRun("test3", test3, NULL) < 0) ret = -1; - if (virtTestRun("test4", test4, NULL) < 0) + if (virTestRun("test4", test4, NULL) < 0) ret = -1; - if (virtTestRun("test5", test5, NULL) < 0) + if (virTestRun("test5", test5, NULL) < 0) ret = -1; - if (virtTestRun("test6", test6, NULL) < 0) + if (virTestRun("test6", test6, NULL) < 0) ret = -1; - if (virtTestRun("test7", test7, NULL) < 0) + if (virTestRun("test7", test7, NULL) < 0) ret = -1; - if (virtTestRun("test8", test8, NULL) < 0) + if (virTestRun("test8", test8, NULL) < 0) ret = -1; - if (virtTestRun("test9", test9, NULL) < 0) + if (virTestRun("test9", test9, NULL) < 0) ret = -1; - if (virtTestRun("test10", test10, NULL) < 0) + if (virTestRun("test10", test10, NULL) < 0) ret = -1; virtTestCounterReset("test11-"); @@ -684,7 +684,7 @@ mymain(void) TESTBINARYOP("0-3", "0,^0", "0-3", test11); TESTBINARYOP("0,2", "1,3", "0,2", test11); - if (virtTestRun("test12", test12, NULL) < 0) + if (virTestRun("test12", test12, NULL) < 0) ret = -1; return ret; diff --git a/tests/virbuftest.c b/tests/virbuftest.c index 1c48ee0..1e4ce18 100644 --- a/tests/virbuftest.c +++ b/tests/virbuftest.c @@ -384,7 +384,7 @@ mymain(void) #define DO_TEST(msg, cb, data) \ do { \ struct testInfo info = { data }; \ - if (virtTestRun("Buf: " msg, cb, &info) < 0) \ + if (virTestRun("Buf: " msg, cb, &info) < 0) \ ret = -1; \ } while (0) @@ -397,7 +397,7 @@ mymain(void) #define DO_TEST_ADD_STR(DATA, EXPECT) \ do { \ struct testBufAddStrData info = { DATA, EXPECT }; \ - if (virtTestRun("Buf: AddStr", testBufAddStr, &info) < 0) \ + if (virTestRun("Buf: AddStr", testBufAddStr, &info) < 0) \ ret = -1; \ } while (0) @@ -409,7 +409,7 @@ mymain(void) #define DO_TEST_ESCAPE(data, expect) \ do { \ struct testBufAddStrData info = { data, expect }; \ - if (virtTestRun("Buf: EscapeStr", testBufEscapeStr, &info) < 0) \ + if (virTestRun("Buf: EscapeStr", testBufEscapeStr, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c index be2bad5..16c26e6 100644 --- a/tests/vircaps2xmltest.c +++ b/tests/vircaps2xmltest.c @@ -143,7 +143,7 @@ mymain(void) struct virCapabilitiesFormatData data = {filename, max_cells, \ max_cpus_in_cell, \ max_mem_in_cell}; \ - if (virtTestRun(filename, test_virCapabilitiesFormat, &data) < 0) \ + if (virTestRun(filename, test_virCapabilitiesFormat, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/vircapstest.c b/tests/vircapstest.c index acb0c03..94469e1 100644 --- a/tests/vircapstest.c +++ b/tests/vircapstest.c @@ -323,21 +323,21 @@ mymain(void) { int ret = 0; - if (virtTestRun("virCapabilitiesGetCpusForNodemask", + if (virTestRun("virCapabilitiesGetCpusForNodemask", test_virCapabilitiesGetCpusForNodemask, NULL) < 0) ret = -1; #ifdef WITH_QEMU - if (virtTestRun("virCapsDomainDataLookupQEMU", + if (virTestRun("virCapsDomainDataLookupQEMU", test_virCapsDomainDataLookupQEMU, NULL) < 0) ret = -1; #endif #ifdef WITH_XEN - if (virtTestRun("virCapsDomainDataLookupXen", + if (virTestRun("virCapsDomainDataLookupXen", test_virCapsDomainDataLookupXen, NULL) < 0) ret = -1; #endif #ifdef WITH_LXC - if (virtTestRun("virCapsDomainDataLookupLXC", + if (virTestRun("virCapsDomainDataLookupLXC", test_virCapsDomainDataLookupLXC, NULL) < 0) ret = -1; #endif /* WITH_LXC */ diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index 322f6cb..aa3f448 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -869,7 +869,7 @@ mymain(void) # define DETECT_MOUNTS(file) \ do { \ - if (virtTestRun("Detect cgroup mounts for " file, \ + if (virTestRun("Detect cgroup mounts for " file, \ testCgroupDetectMounts, \ file) < 0) \ ret = -1; \ @@ -886,53 +886,53 @@ mymain(void) DETECT_MOUNTS("all-in-one"); DETECT_MOUNTS("no-cgroups"); - if (virtTestRun("New cgroup for self", testCgroupNewForSelf, NULL) < 0) + if (virTestRun("New cgroup for self", testCgroupNewForSelf, NULL) < 0) ret = -1; - if (virtTestRun("New cgroup for partition", testCgroupNewForPartition, NULL) < 0) + if (virTestRun("New cgroup for partition", testCgroupNewForPartition, NULL) < 0) ret = -1; - if (virtTestRun("New cgroup for partition nested", testCgroupNewForPartitionNested, NULL) < 0) + if (virTestRun("New cgroup for partition nested", testCgroupNewForPartitionNested, NULL) < 0) ret = -1; - if (virtTestRun("New cgroup for partition nested deeply", testCgroupNewForPartitionNestedDeep, NULL) < 0) + if (virTestRun("New cgroup for partition nested deeply", testCgroupNewForPartitionNestedDeep, NULL) < 0) ret = -1; - if (virtTestRun("New cgroup for domain partition", testCgroupNewForPartitionDomain, NULL) < 0) + if (virTestRun("New cgroup for domain partition", testCgroupNewForPartitionDomain, NULL) < 0) ret = -1; - if (virtTestRun("New cgroup for domain partition escaped", testCgroupNewForPartitionDomainEscaped, NULL) < 0) + if (virTestRun("New cgroup for domain partition escaped", testCgroupNewForPartitionDomainEscaped, NULL) < 0) ret = -1; - if (virtTestRun("Cgroup available", testCgroupAvailable, (void*)0x1) < 0) + if (virTestRun("Cgroup available", testCgroupAvailable, (void*)0x1) < 0) ret = -1; - if (virtTestRun("Cgroup controller available", testCgroupControllerAvailable, NULL) < 0) + if (virTestRun("Cgroup controller available", testCgroupControllerAvailable, NULL) < 0) ret = -1; - if (virtTestRun("virCgroupGetBlkioIoServiced works", testCgroupGetBlkioIoServiced, NULL) < 0) + if (virTestRun("virCgroupGetBlkioIoServiced works", testCgroupGetBlkioIoServiced, NULL) < 0) ret = -1; - if (virtTestRun("virCgroupGetBlkioIoDeviceServiced works", testCgroupGetBlkioIoDeviceServiced, NULL) < 0) + if (virTestRun("virCgroupGetBlkioIoDeviceServiced works", testCgroupGetBlkioIoDeviceServiced, NULL) < 0) ret = -1; - if (virtTestRun("virCgroupGetMemoryUsage works", testCgroupGetMemoryUsage, NULL) < 0) + if (virTestRun("virCgroupGetMemoryUsage works", testCgroupGetMemoryUsage, NULL) < 0) ret = -1; - if (virtTestRun("virCgroupGetPercpuStats works", testCgroupGetPercpuStats, NULL) < 0) + if (virTestRun("virCgroupGetPercpuStats works", testCgroupGetPercpuStats, NULL) < 0) ret = -1; setenv("VIR_CGROUP_MOCK_MODE", "allinone", 1); - if (virtTestRun("New cgroup for self (allinone)", testCgroupNewForSelfAllInOne, NULL) < 0) + if (virTestRun("New cgroup for self (allinone)", testCgroupNewForSelfAllInOne, NULL) < 0) ret = -1; - if (virtTestRun("Cgroup available", testCgroupAvailable, (void*)0x1) < 0) + if (virTestRun("Cgroup available", testCgroupAvailable, (void*)0x1) < 0) ret = -1; unsetenv("VIR_CGROUP_MOCK_MODE"); setenv("VIR_CGROUP_MOCK_MODE", "logind", 1); - if (virtTestRun("New cgroup for self (logind)", testCgroupNewForSelfLogind, NULL) < 0) + if (virTestRun("New cgroup for self (logind)", testCgroupNewForSelfLogind, NULL) < 0) ret = -1; - if (virtTestRun("Cgroup available", testCgroupAvailable, (void*)0x0) < 0) + if (virTestRun("Cgroup available", testCgroupAvailable, (void*)0x0) < 0) ret = -1; unsetenv("VIR_CGROUP_MOCK_MODE"); diff --git a/tests/vircryptotest.c b/tests/vircryptotest.c index 72265d9..70ae1ff 100644 --- a/tests/vircryptotest.c +++ b/tests/vircryptotest.c @@ -134,7 +134,7 @@ mymain(void) .input = i, \ .output = o, \ }; \ - if (virtTestRun("Hash " i, testCryptoHash, &data) < 0) \ + if (virTestRun("Hash " i, testCryptoHash, &data) < 0) \ ret = -1; \ } while (0) @@ -161,7 +161,7 @@ mymain(void) .ciphertext = c, \ .ciphertextlen = cl, \ }; \ - if (virtTestRun("Encrypt " n, testCryptoEncrypt, &data) < 0) \ + if (virTestRun("Encrypt " n, testCryptoEncrypt, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virdbustest.c b/tests/virdbustest.c index 1622b03..4e61cb3 100644 --- a/tests/virdbustest.c +++ b/tests/virdbustest.c @@ -704,25 +704,25 @@ mymain(void) { int ret = 0; - if (virtTestRun("Test message simple ", testMessageSimple, NULL) < 0) + if (virTestRun("Test message simple ", testMessageSimple, NULL) < 0) ret = -1; - if (virtTestRun("Test message variant ", testMessageVariant, NULL) < 0) + if (virTestRun("Test message variant ", testMessageVariant, NULL) < 0) ret = -1; - if (virtTestRun("Test message array ", testMessageArray, NULL) < 0) + if (virTestRun("Test message array ", testMessageArray, NULL) < 0) ret = -1; - if (virtTestRun("Test message array empty ref ", testMessageEmptyArrayRef, NULL) < 0) + if (virTestRun("Test message array empty ref ", testMessageEmptyArrayRef, NULL) < 0) ret = -1; - if (virtTestRun("Test message array single ref ", testMessageSingleArrayRef, NULL) < 0) + if (virTestRun("Test message array single ref ", testMessageSingleArrayRef, NULL) < 0) ret = -1; - if (virtTestRun("Test message array ref ", testMessageArrayRef, NULL) < 0) + if (virTestRun("Test message array ref ", testMessageArrayRef, NULL) < 0) ret = -1; - if (virtTestRun("Test message struct ", testMessageStruct, NULL) < 0) + if (virTestRun("Test message struct ", testMessageStruct, NULL) < 0) ret = -1; - if (virtTestRun("Test message dict ", testMessageDict, NULL) < 0) + if (virTestRun("Test message dict ", testMessageDict, NULL) < 0) ret = -1; - if (virtTestRun("Test message dict empty ref ", testMessageEmptyDictRef, NULL) < 0) + if (virTestRun("Test message dict empty ref ", testMessageEmptyDictRef, NULL) < 0) ret = -1; - if (virtTestRun("Test message dict ref ", testMessageDictRef, NULL) < 0) + if (virTestRun("Test message dict ref ", testMessageDictRef, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/virdrivermoduletest.c b/tests/virdrivermoduletest.c index 6fb842e..870a07d 100644 --- a/tests/virdrivermoduletest.c +++ b/tests/virdrivermoduletest.c @@ -47,10 +47,10 @@ mymain(void) { int ret = 0; -#define TEST(name, dep1) \ - do { \ - if (virtTestRun("Test driver " # name, testDriverModule, name) < 0) \ - ret = -1; \ +#define TEST(name, dep1) \ + do { \ + if (virTestRun("Test driver " # name, testDriverModule, name) < 0) \ + ret = -1; \ } while (0) #ifdef WITH_NETWORK diff --git a/tests/virendiantest.c b/tests/virendiantest.c index 2097c28..4072507 100644 --- a/tests/virendiantest.c +++ b/tests/virendiantest.c @@ -91,9 +91,9 @@ mymain(void) { int ret = 0; - if (virtTestRun("test1", test1, NULL) < 0) + if (virTestRun("test1", test1, NULL) < 0) ret = -1; - if (virtTestRun("test2", test2, NULL) < 0) + if (virTestRun("test2", test2, NULL) < 0) ret = -1; return ret; diff --git a/tests/virfiletest.c b/tests/virfiletest.c index 628fa1f..b99a55c 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -146,7 +146,7 @@ mymain(void) struct testFileGetMountSubtreeData data = { \ path, prefix, mounts, ARRAY_CARDINALITY(mounts), rev \ }; \ - if (virtTestRun(name, testFileGetMountSubtree, &data) < 0) \ + if (virTestRun(name, testFileGetMountSubtree, &data) < 0) \ ret = -1; \ } while (0) @@ -160,7 +160,7 @@ mymain(void) do { \ data1.path = PATH; \ data1.expect = EXPECT; \ - if (virtTestRun(virtTestCounterNext(), testFileSanitizePath, \ + if (virTestRun(virtTestCounterNext(), testFileSanitizePath, \ &data1) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virfirewalltest.c b/tests/virfirewalltest.c index f1f29c6..68c2dc5 100644 --- a/tests/virfirewalltest.c +++ b/tests/virfirewalltest.c @@ -1134,12 +1134,12 @@ mymain(void) data.tryBackend = VIR_FIREWALL_BACKEND_AUTOMATIC; \ data.expectBackend = VIR_FIREWALL_BACKEND_DIRECT; \ data.fwDisabled = true; \ - if (virtTestRun(name " auto direct", method, &data) < 0) \ + if (virTestRun(name " auto direct", method, &data) < 0) \ ret = -1; \ data.tryBackend = VIR_FIREWALL_BACKEND_DIRECT; \ data.expectBackend = VIR_FIREWALL_BACKEND_DIRECT; \ data.fwDisabled = true; \ - if (virtTestRun(name " manual direct", method, &data) < 0) \ + if (virTestRun(name " manual direct", method, &data) < 0) \ ret = -1; \ } while (0) @@ -1150,12 +1150,12 @@ mymain(void) data.tryBackend = VIR_FIREWALL_BACKEND_AUTOMATIC; \ data.expectBackend = VIR_FIREWALL_BACKEND_FIREWALLD; \ data.fwDisabled = false; \ - if (virtTestRun(name " auto firewalld", method, &data) < 0) \ + if (virTestRun(name " auto firewalld", method, &data) < 0) \ ret = -1; \ data.tryBackend = VIR_FIREWALL_BACKEND_FIREWALLD; \ data.expectBackend = VIR_FIREWALL_BACKEND_FIREWALLD; \ data.fwDisabled = false; \ - if (virtTestRun(name " manual firewalld", method, &data) < 0) \ + if (virTestRun(name " manual firewalld", method, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virhashtest.c b/tests/virhashtest.c index a3ec13c..40afd63 100644 --- a/tests/virhashtest.c +++ b/tests/virhashtest.c @@ -605,7 +605,7 @@ mymain(void) #define DO_TEST_FULL(name, cmd, data, count) \ do { \ struct testInfo info = { data, count }; \ - if (virtTestRun(name, testHash ## cmd, &info) < 0) \ + if (virTestRun(name, testHash ## cmd, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index bc2b44a..889701c 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -610,7 +610,7 @@ mymain(void) # define DO_TEST(fnc) \ do { \ VIR_DEBUG("Testing: %s", #fnc); \ - if (virtTestRun(#fnc, fnc, NULL) < 0) \ + if (virTestRun(#fnc, fnc, NULL) < 0) \ ret = -1; \ } while (0) diff --git a/tests/viridentitytest.c b/tests/viridentitytest.c index b1a1db0..c7dc89d 100644 --- a/tests/viridentitytest.c +++ b/tests/viridentitytest.c @@ -226,17 +226,17 @@ mymain(void) const char *context = "unconfined_u:unconfined_r:unconfined_t:s0"; int ret = 0; - if (virtTestRun("Identity attributes ", testIdentityAttrs, NULL) < 0) + if (virTestRun("Identity attributes ", testIdentityAttrs, NULL) < 0) ret = -1; - if (virtTestRun("Identity equality ", testIdentityEqual, NULL) < 0) + if (virTestRun("Identity equality ", testIdentityEqual, NULL) < 0) ret = -1; - if (virtTestRun("Setting fake SELinux context ", testSetFakeSELinuxContext, context) < 0) + if (virTestRun("Setting fake SELinux context ", testSetFakeSELinuxContext, context) < 0) ret = -1; - if (virtTestRun("System identity (fake SELinux enabled) ", testIdentityGetSystem, context) < 0) + if (virTestRun("System identity (fake SELinux enabled) ", testIdentityGetSystem, context) < 0) ret = -1; - if (virtTestRun("Disabling fake SELinux ", testDisableFakeSELinux, NULL) < 0) + if (virTestRun("Disabling fake SELinux ", testDisableFakeSELinux, NULL) < 0) ret = -1; - if (virtTestRun("System identity (fake SELinux disabled) ", testIdentityGetSystem, NULL) < 0) + if (virTestRun("System identity (fake SELinux disabled) ", testIdentityGetSystem, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/viriscsitest.c b/tests/viriscsitest.c index 40e4d10..7867f2a 100644 --- a/tests/viriscsitest.c +++ b/tests/viriscsitest.c @@ -182,11 +182,11 @@ mymain(void) # define DO_SESSION_TEST(name, session) \ do { \ struct testSessionInfo info = {name, 0, session}; \ - if (virtTestRun("ISCSI get session test" name, \ + if (virTestRun("ISCSI get session test" name, \ testISCSIGetSession, &info) < 0) \ rv = -1; \ info.output_version = 1; \ - if (virtTestRun("ISCSI get (non-flash) session test" name, \ + if (virTestRun("ISCSI get (non-flash) session test" name, \ testISCSIGetSession, &info) < 0) \ rv = -1; \ } while (0) @@ -209,7 +209,7 @@ mymain(void) .expected_targets = targets, .nexpected = ARRAY_CARDINALITY(targets), }; - if (virtTestRun("ISCSI scan targets", testISCSIScanTargets, &infoTargets) < 0) + if (virTestRun("ISCSI scan targets", testISCSIScanTargets, &infoTargets) < 0) rv = -1; if (rv < 0) diff --git a/tests/virkeycodetest.c b/tests/virkeycodetest.c index a429fbc..d092209 100644 --- a/tests/virkeycodetest.c +++ b/tests/virkeycodetest.c @@ -97,9 +97,9 @@ mymain(void) { int ret = 0; - if (virtTestRun("Keycode mapping ", testKeycodeMapping, NULL) < 0) + if (virTestRun("Keycode mapping ", testKeycodeMapping, NULL) < 0) ret = -1; - if (virtTestRun("Keycode strings ", testKeycodeStrings, NULL) < 0) + if (virTestRun("Keycode strings ", testKeycodeStrings, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virkeyfiletest.c b/tests/virkeyfiletest.c index 3908fa8..c4ce320 100644 --- a/tests/virkeyfiletest.c +++ b/tests/virkeyfiletest.c @@ -114,7 +114,7 @@ mymain(void) signal(SIGPIPE, SIG_IGN); - if (virtTestRun("Test parse", testParse, NULL) < 0) + if (virTestRun("Test parse", testParse, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virkmodtest.c b/tests/virkmodtest.c index 9fa40c3..b86cf02 100644 --- a/tests/virkmodtest.c +++ b/tests/virkmodtest.c @@ -150,7 +150,7 @@ mymain(void) { int ret = 0; - if (virtTestRun("config", testKModConfig, NULL) < 0) + if (virTestRun("config", testKModConfig, NULL) < 0) ret = -1; /* Although we cannot run the command on the host, we can compare @@ -162,7 +162,7 @@ mymain(void) struct testInfo data = {.module = "vfio-pci", \ .exp_cmd = _exp_cmd, \ .useBlacklist = _blkflag}; \ - if (virtTestRun(_name, _cb, &data) < 0) \ + if (virTestRun(_name, _cb, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c index 4db9c0f..cb0b889 100644 --- a/tests/virlockspacetest.c +++ b/tests/virlockspacetest.c @@ -347,25 +347,25 @@ mymain(void) signal(SIGPIPE, SIG_IGN); - if (virtTestRun("Lockspace creation", testLockSpaceCreate, NULL) < 0) + if (virTestRun("Lockspace creation", testLockSpaceCreate, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res lifecycle", testLockSpaceResourceLifecycle, NULL) < 0) + if (virTestRun("Lockspace res lifecycle", testLockSpaceResourceLifecycle, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res lock excl", testLockSpaceResourceLockExcl, NULL) < 0) + if (virTestRun("Lockspace res lock excl", testLockSpaceResourceLockExcl, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res lock shr", testLockSpaceResourceLockShr, NULL) < 0) + if (virTestRun("Lockspace res lock shr", testLockSpaceResourceLockShr, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res lock excl auto", testLockSpaceResourceLockExclAuto, NULL) < 0) + if (virTestRun("Lockspace res lock excl auto", testLockSpaceResourceLockExclAuto, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res lock shr auto", testLockSpaceResourceLockShrAuto, NULL) < 0) + if (virTestRun("Lockspace res lock shr auto", testLockSpaceResourceLockShrAuto, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res full path", testLockSpaceResourceLockPath, NULL) < 0) + if (virTestRun("Lockspace res full path", testLockSpaceResourceLockPath, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virlogtest.c b/tests/virlogtest.c index 6abd4ae..5c492a2 100644 --- a/tests/virlogtest.c +++ b/tests/virlogtest.c @@ -115,7 +115,7 @@ mymain(void) struct testLogData data = { \ str, count, pass \ }; \ - if (virtTestRun(name, test, &data) < 0) \ + if (virTestRun(name, test, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index 714f8d7..0a75b49 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -321,7 +321,7 @@ mymain(void) struct testExecRestartData data = { \ file, server_names, nservers, pass \ }; \ - if (virtTestRun("ExecRestart " file, \ + if (virTestRun("ExecRestart " file, \ testExecRestart, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index b29318e..a87086e 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -120,7 +120,7 @@ mymain(void) struct testSetStruct data = {.band = Band, \ .exp_cmd = Exp_cmd, \ __VA_ARGS__}; \ - if (virtTestRun("virNetDevBandwidthSet", \ + if (virTestRun("virNetDevBandwidthSet", \ testVirNetDevBandwidthSet, \ &data) < 0) \ ret = -1; \ diff --git a/tests/virnetdevtest.c b/tests/virnetdevtest.c index c31543e..2e88a38 100644 --- a/tests/virnetdevtest.c +++ b/tests/virnetdevtest.c @@ -72,7 +72,7 @@ mymain(void) # define DO_TEST_LINK(ifname, state, speed) \ do { \ struct testVirNetDevGetLinkInfoData data = {ifname, state, speed}; \ - if (virtTestRun("Link info: " # ifname, \ + if (virTestRun("Link info: " # ifname, \ testVirNetDevGetLinkInfo, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c index 440b7bf..bed92bb 100644 --- a/tests/virnetmessagetest.c +++ b/tests/virnetmessagetest.c @@ -529,19 +529,19 @@ mymain(void) signal(SIGPIPE, SIG_IGN); - if (virtTestRun("Message Header Encode", testMessageHeaderEncode, NULL) < 0) + if (virTestRun("Message Header Encode", testMessageHeaderEncode, NULL) < 0) ret = -1; - if (virtTestRun("Message Header Decode", testMessageHeaderDecode, NULL) < 0) + if (virTestRun("Message Header Decode", testMessageHeaderDecode, NULL) < 0) ret = -1; - if (virtTestRun("Message Payload Encode", testMessagePayloadEncode, NULL) < 0) + if (virTestRun("Message Payload Encode", testMessagePayloadEncode, NULL) < 0) ret = -1; - if (virtTestRun("Message Payload Decode", testMessagePayloadDecode, NULL) < 0) + if (virTestRun("Message Payload Decode", testMessagePayloadDecode, NULL) < 0) ret = -1; - if (virtTestRun("Message Payload Stream Encode", testMessagePayloadStreamEncode, NULL) < 0) + if (virTestRun("Message Payload Stream Encode", testMessagePayloadStreamEncode, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virnetserverclienttest.c b/tests/virnetserverclienttest.c index be15e81..3128973 100644 --- a/tests/virnetserverclienttest.c +++ b/tests/virnetserverclienttest.c @@ -143,7 +143,7 @@ mymain(void) int ret = 0; - if (virtTestRun("Identity", + if (virTestRun("Identity", testIdentity, NULL) < 0) ret = -1; diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index c2bc4e7..89965d5 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -447,35 +447,35 @@ mymain(void) if (hasIPv4) { struct testTCPData tcpData = { "127.0.0.1", freePort, "127.0.0.1" }; - if (virtTestRun("Socket TCP/IPv4 Accept", testSocketTCPAccept, &tcpData) < 0) + if (virTestRun("Socket TCP/IPv4 Accept", testSocketTCPAccept, &tcpData) < 0) ret = -1; } if (hasIPv6) { struct testTCPData tcpData = { "::1", freePort, "::1" }; - if (virtTestRun("Socket TCP/IPv6 Accept", testSocketTCPAccept, &tcpData) < 0) + if (virTestRun("Socket TCP/IPv6 Accept", testSocketTCPAccept, &tcpData) < 0) ret = -1; } if (hasIPv6 && hasIPv4) { struct testTCPData tcpData = { NULL, freePort, "127.0.0.1" }; - if (virtTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0) + if (virTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0) ret = -1; tcpData.cnode = "::1"; - if (virtTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0) + if (virTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0) ret = -1; } #endif #ifndef WIN32 - if (virtTestRun("Socket UNIX Accept", testSocketUNIXAccept, NULL) < 0) + if (virTestRun("Socket UNIX Accept", testSocketUNIXAccept, NULL) < 0) ret = -1; - if (virtTestRun("Socket UNIX Addrs", testSocketUNIXAddrs, NULL) < 0) + if (virTestRun("Socket UNIX Addrs", testSocketUNIXAddrs, NULL) < 0) ret = -1; - if (virtTestRun("Socket External Command /dev/zero", testSocketCommandNormal, NULL) < 0) + if (virTestRun("Socket External Command /dev/zero", testSocketCommandNormal, NULL) < 0) ret = -1; - if (virtTestRun("Socket External Command /dev/does-not-exist", testSocketCommandFail, NULL) < 0) + if (virTestRun("Socket External Command /dev/does-not-exist", testSocketCommandFail, NULL) < 0) ret = -1; struct testSSHData sshData1 = { @@ -488,7 +488,7 @@ mymain(void) "fi;" "'nc' $ARG -U /tmp/socket'\n", }; - if (virtTestRun("SSH test 1", testSocketSSH, &sshData1) < 0) + if (virTestRun("SSH test 1", testSocketSSH, &sshData1) < 0) ret = -1; struct testSSHData sshData2 = { @@ -507,7 +507,7 @@ mymain(void) "fi;" "'netcat' $ARG -U /tmp/socket'\n", }; - if (virtTestRun("SSH test 2", testSocketSSH, &sshData2) < 0) + if (virTestRun("SSH test 2", testSocketSSH, &sshData2) < 0) ret = -1; struct testSSHData sshData3 = { @@ -526,7 +526,7 @@ mymain(void) "fi;" "'netcat' $ARG -U /tmp/socket'\n", }; - if (virtTestRun("SSH test 3", testSocketSSH, &sshData3) < 0) + if (virTestRun("SSH test 3", testSocketSSH, &sshData3) < 0) ret = -1; struct testSSHData sshData4 = { @@ -534,7 +534,7 @@ mymain(void) .path = "/tmp/socket", .failConnect = true, }; - if (virtTestRun("SSH test 4", testSocketSSH, &sshData4) < 0) + if (virTestRun("SSH test 4", testSocketSSH, &sshData4) < 0) ret = -1; struct testSSHData sshData5 = { @@ -549,7 +549,7 @@ mymain(void) "'nc' $ARG -U /tmp/socket'\n", .dieEarly = true, }; - if (virtTestRun("SSH test 5", testSocketSSH, &sshData5) < 0) + if (virTestRun("SSH test 5", testSocketSSH, &sshData5) < 0) ret = -1; struct testSSHData sshData6 = { @@ -565,7 +565,7 @@ mymain(void) "fi;" "'nc' $ARG -U /tmp/socket'\n", }; - if (virtTestRun("SSH test 6", testSocketSSH, &sshData6) < 0) + if (virTestRun("SSH test 6", testSocketSSH, &sshData6) < 0) ret = -1; struct testSSHData sshData7 = { @@ -579,7 +579,7 @@ mymain(void) "fi;" "''nc -4'' $ARG -U /tmp/socket'\n", }; - if (virtTestRun("SSH test 7", testSocketSSH, &sshData7) < 0) + if (virTestRun("SSH test 7", testSocketSSH, &sshData7) < 0) ret = -1; #endif diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index d33b896..8e55856 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -123,7 +123,7 @@ mymain(void) data.cacrt = _caCrt; \ data.crt = _crt; \ data.expectFail = _expectFail; \ - if (virtTestRun("TLS Context " #_caCrt " + " #_crt, \ + if (virTestRun("TLS Context " #_caCrt " + " #_crt, \ testTLSContextInit, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c index 3af948a..abcf710 100644 --- a/tests/virnettlssessiontest.c +++ b/tests/virnettlssessiontest.c @@ -245,38 +245,38 @@ mymain(void) testTLSInit(KEYFILE); # define DO_SESS_TEST(_caCrt, _serverCrt, _clientCrt, _expectServerFail, \ - _expectClientFail, _hostname, _wildcards) \ - do { \ - static struct testTLSSessionData data; \ - data.servercacrt = _caCrt; \ - data.clientcacrt = _caCrt; \ - data.servercrt = _serverCrt; \ - data.clientcrt = _clientCrt; \ - data.expectServerFail = _expectServerFail; \ - data.expectClientFail = _expectClientFail; \ - data.hostname = _hostname; \ - data.wildcards = _wildcards; \ - if (virtTestRun("TLS Session " #_serverCrt " + " #_clientCrt, \ - testTLSSessionInit, &data) < 0) \ - ret = -1; \ + _expectClientFail, _hostname, _wildcards) \ + do { \ + static struct testTLSSessionData data; \ + data.servercacrt = _caCrt; \ + data.clientcacrt = _caCrt; \ + data.servercrt = _serverCrt; \ + data.clientcrt = _clientCrt; \ + data.expectServerFail = _expectServerFail; \ + data.expectClientFail = _expectClientFail; \ + data.hostname = _hostname; \ + data.wildcards = _wildcards; \ + if (virTestRun("TLS Session " #_serverCrt " + " #_clientCrt, \ + testTLSSessionInit, &data) < 0) \ + ret = -1; \ } while (0) # define DO_SESS_TEST_EXT(_serverCaCrt, _clientCaCrt, _serverCrt, _clientCrt, \ - _expectServerFail, _expectClientFail, \ - _hostname, _wildcards) \ - do { \ - static struct testTLSSessionData data; \ - data.servercacrt = _serverCaCrt; \ - data.clientcacrt = _clientCaCrt; \ - data.servercrt = _serverCrt; \ - data.clientcrt = _clientCrt; \ - data.expectServerFail = _expectServerFail; \ - data.expectClientFail = _expectClientFail; \ - data.hostname = _hostname; \ - data.wildcards = _wildcards; \ - if (virtTestRun("TLS Session " #_serverCrt " + " #_clientCrt, \ - testTLSSessionInit, &data) < 0) \ - ret = -1; \ + _expectServerFail, _expectClientFail, \ + _hostname, _wildcards) \ + do { \ + static struct testTLSSessionData data; \ + data.servercacrt = _serverCaCrt; \ + data.clientcacrt = _clientCaCrt; \ + data.servercrt = _serverCrt; \ + data.clientcrt = _clientCrt; \ + data.expectServerFail = _expectServerFail; \ + data.expectClientFail = _expectClientFail; \ + data.hostname = _hostname; \ + data.wildcards = _wildcards; \ + if (virTestRun("TLS Session " #_serverCrt " + " #_clientCrt, \ + testTLSSessionInit, &data) < 0) \ + ret = -1; \ } while (0) # define TLS_CERT_REQ(varname, cavarname, \ diff --git a/tests/virpcitest.c b/tests/virpcitest.c index dd02b0c..9628366 100644 --- a/tests/virpcitest.c +++ b/tests/virpcitest.c @@ -376,7 +376,7 @@ mymain(void) # define DO_TEST(fnc) \ do { \ - if (virtTestRun(#fnc, fnc, NULL) < 0) \ + if (virTestRun(#fnc, fnc, NULL) < 0) \ ret = -1; \ } while (0) @@ -391,7 +391,7 @@ mymain(void) ret = -1; \ break; \ } \ - if (virtTestRun(label, fnc, &data) < 0) \ + if (virTestRun(label, fnc, &data) < 0) \ ret = -1; \ VIR_FREE(label); \ } while (0) @@ -408,7 +408,7 @@ mymain(void) ret = -1; \ break; \ } \ - if (virtTestRun(label, testVirPCIDeviceCheckDriverTest, \ + if (virTestRun(label, testVirPCIDeviceCheckDriverTest, \ &data) < 0) \ ret = -1; \ VIR_FREE(label); \ diff --git a/tests/virpolkittest.c b/tests/virpolkittest.c index 73f001b..421ffee 100644 --- a/tests/virpolkittest.c +++ b/tests/virpolkittest.c @@ -334,17 +334,17 @@ mymain(void) { int ret = 0; - if (virtTestRun("Polkit auth success ", testPolkitAuthSuccess, NULL) < 0) + if (virTestRun("Polkit auth success ", testPolkitAuthSuccess, NULL) < 0) ret = -1; - if (virtTestRun("Polkit auth deny ", testPolkitAuthDenied, NULL) < 0) + if (virTestRun("Polkit auth deny ", testPolkitAuthDenied, NULL) < 0) ret = -1; - if (virtTestRun("Polkit auth challenge ", testPolkitAuthChallenge, NULL) < 0) + if (virTestRun("Polkit auth challenge ", testPolkitAuthChallenge, NULL) < 0) ret = -1; - if (virtTestRun("Polkit auth cancel ", testPolkitAuthCancelled, NULL) < 0) + if (virTestRun("Polkit auth cancel ", testPolkitAuthCancelled, NULL) < 0) ret = -1; - if (virtTestRun("Polkit auth details success ", testPolkitAuthDetailsSuccess, NULL) < 0) + if (virTestRun("Polkit auth details success ", testPolkitAuthDetailsSuccess, NULL) < 0) ret = -1; - if (virtTestRun("Polkit auth details deny ", testPolkitAuthDetailsDenied, NULL) < 0) + if (virTestRun("Polkit auth details deny ", testPolkitAuthDetailsDenied, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c index 4574215..2c8bc24 100644 --- a/tests/virportallocatortest.c +++ b/tests/virportallocatortest.c @@ -157,18 +157,18 @@ mymain(void) { int ret = 0; - if (virtTestRun("Test alloc all", testAllocAll, NULL) < 0) + if (virTestRun("Test alloc all", testAllocAll, NULL) < 0) ret = -1; - if (virtTestRun("Test alloc reuse", testAllocReuse, NULL) < 0) + if (virTestRun("Test alloc reuse", testAllocReuse, NULL) < 0) ret = -1; setenv("LIBVIRT_TEST_IPV4ONLY", "really", 1); - if (virtTestRun("Test IPv4-only alloc all", testAllocAll, NULL) < 0) + if (virTestRun("Test IPv4-only alloc all", testAllocAll, NULL) < 0) ret = -1; - if (virtTestRun("Test IPv4-only alloc reuse", testAllocReuse, NULL) < 0) + if (virTestRun("Test IPv4-only alloc reuse", testAllocReuse, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virrandomtest.c b/tests/virrandomtest.c index 367bdc7..388a3d5 100644 --- a/tests/virrandomtest.c +++ b/tests/virrandomtest.c @@ -67,7 +67,7 @@ mymain(void) { int ret = 0; - if (virtTestRun("RandomBytes", testRandomBytes, NULL) < 0) + if (virTestRun("RandomBytes", testRandomBytes, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virrotatingfiletest.c b/tests/virrotatingfiletest.c index 44a59cd..81e7b3f 100644 --- a/tests/virrotatingfiletest.c +++ b/tests/virrotatingfiletest.c @@ -699,43 +699,43 @@ mymain(void) { int ret = 0; - if (virtTestRun("Rotating file write new", testRotatingFileWriterNew, NULL) < 0) + if (virTestRun("Rotating file write new", testRotatingFileWriterNew, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file write append", testRotatingFileWriterAppend, NULL) < 0) + if (virTestRun("Rotating file write append", testRotatingFileWriterAppend, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file write truncate", testRotatingFileWriterTruncate, NULL) < 0) + if (virTestRun("Rotating file write truncate", testRotatingFileWriterTruncate, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file write rollover no backup", testRotatingFileWriterRolloverNone, NULL) < 0) + if (virTestRun("Rotating file write rollover no backup", testRotatingFileWriterRolloverNone, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file write rollover one", testRotatingFileWriterRolloverOne, NULL) < 0) + if (virTestRun("Rotating file write rollover one", testRotatingFileWriterRolloverOne, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file write rollover append", testRotatingFileWriterRolloverAppend, NULL) < 0) + if (virTestRun("Rotating file write rollover append", testRotatingFileWriterRolloverAppend, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file write rollover many", testRotatingFileWriterRolloverMany, NULL) < 0) + if (virTestRun("Rotating file write rollover many", testRotatingFileWriterRolloverMany, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file write rollover line break", testRotatingFileWriterRolloverLineBreak, NULL) < 0) + if (virTestRun("Rotating file write rollover line break", testRotatingFileWriterRolloverLineBreak, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file write to file larger then maxlen", testRotatingFileWriterLargeFile, NULL) < 0) + if (virTestRun("Rotating file write to file larger then maxlen", testRotatingFileWriterLargeFile, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file read one", testRotatingFileReaderOne, NULL) < 0) + if (virTestRun("Rotating file read one", testRotatingFileReaderOne, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file read all", testRotatingFileReaderAll, NULL) < 0) + if (virTestRun("Rotating file read all", testRotatingFileReaderAll, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file read partial", testRotatingFileReaderPartial, NULL) < 0) + if (virTestRun("Rotating file read partial", testRotatingFileReaderPartial, NULL) < 0) ret = -1; - if (virtTestRun("Rotating file read seek", testRotatingFileReaderSeek, NULL) < 0) + if (virTestRun("Rotating file read seek", testRotatingFileReaderSeek, NULL) < 0) ret = -1; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virscsitest.c b/tests/virscsitest.c index 88286f1..4a0bbb8 100644 --- a/tests/virscsitest.c +++ b/tests/virscsitest.c @@ -235,9 +235,9 @@ mymain(void) goto cleanup; } - if (virtTestRun("test1", test1, NULL) < 0) + if (virTestRun("test1", test1, NULL) < 0) ret = -1; - if (virtTestRun("test2", test2, NULL) < 0) + if (virTestRun("test2", test2, NULL) < 0) ret = -1; cleanup: diff --git a/tests/virshtest.c b/tests/virshtest.c index 3fdae92..374723c 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -258,67 +258,67 @@ mymain(void) abs_srcdir) < 0) return EXIT_FAILURE; - if (virtTestRun("virsh list (default)", + if (virTestRun("virsh list (default)", testCompareListDefault, NULL) != 0) ret = -1; - if (virtTestRun("virsh list (custom)", + if (virTestRun("virsh list (custom)", testCompareListCustom, NULL) != 0) ret = -1; - if (virtTestRun("virsh nodeinfo (default)", + if (virTestRun("virsh nodeinfo (default)", testCompareNodeinfoDefault, NULL) != 0) ret = -1; - if (virtTestRun("virsh nodeinfo (custom)", + if (virTestRun("virsh nodeinfo (custom)", testCompareNodeinfoCustom, NULL) != 0) ret = -1; - if (virtTestRun("virsh dominfo (by id)", + if (virTestRun("virsh dominfo (by id)", testCompareDominfoByID, NULL) != 0) ret = -1; - if (virtTestRun("virsh dominfo (by uuid)", + if (virTestRun("virsh dominfo (by uuid)", testCompareDominfoByUUID, NULL) != 0) ret = -1; - if (virtTestRun("virsh dominfo (by name)", + if (virTestRun("virsh dominfo (by name)", testCompareDominfoByName, NULL) != 0) ret = -1; - if (virtTestRun("virsh domid (by name)", + if (virTestRun("virsh domid (by name)", testCompareDomidByName, NULL) != 0) ret = -1; - if (virtTestRun("virsh domid (by uuid)", + if (virTestRun("virsh domid (by uuid)", testCompareDomidByUUID, NULL) != 0) ret = -1; - if (virtTestRun("virsh domuuid (by id)", + if (virTestRun("virsh domuuid (by id)", testCompareDomuuidByID, NULL) != 0) ret = -1; - if (virtTestRun("virsh domuuid (by name)", + if (virTestRun("virsh domuuid (by name)", testCompareDomuuidByName, NULL) != 0) ret = -1; - if (virtTestRun("virsh domname (by id)", + if (virTestRun("virsh domname (by id)", testCompareDomnameByID, NULL) != 0) ret = -1; - if (virtTestRun("virsh domname (by uuid)", + if (virTestRun("virsh domname (by uuid)", testCompareDomnameByUUID, NULL) != 0) ret = -1; - if (virtTestRun("virsh domstate (by id)", + if (virTestRun("virsh domstate (by id)", testCompareDomstateByID, NULL) != 0) ret = -1; - if (virtTestRun("virsh domstate (by uuid)", + if (virTestRun("virsh domstate (by uuid)", testCompareDomstateByUUID, NULL) != 0) ret = -1; - if (virtTestRun("virsh domstate (by name)", + if (virTestRun("virsh domstate (by name)", testCompareDomstateByName, NULL) != 0) ret = -1; @@ -328,7 +328,7 @@ mymain(void) do { \ const char *myargv[] = { VIRSH_DEFAULT, __VA_ARGS__, NULL }; \ const struct testInfo info = { myargv, result }; \ - if (virtTestRun("virsh echo " #i, \ + if (virTestRun("virsh echo " #i, \ testCompareEcho, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 698f472..5099b3a 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -693,7 +693,7 @@ mymain(void) for (i = 0; i < ARRAY_CARDINALITY(data.files); i++) \ if (data.files[i]) \ data.nfiles++; \ - if (virtTestRun(virtTestCounterNext(), \ + if (virTestRun(virtTestCounterNext(), \ testStorageChain, &data) < 0) \ ret = -1; \ } while (0) @@ -1051,7 +1051,7 @@ mymain(void) data2 = (struct testLookupData){ \ chain, target, from, name, index, \ result, meta, parent, }; \ - if (virtTestRun("Chain lookup " #id, \ + if (virTestRun("Chain lookup " #id, \ testStorageLookup, &data2) < 0) \ ret = -1; \ } while (0) @@ -1190,7 +1190,7 @@ mymain(void) do { \ data3.path = PATH; \ data3.expect = EXPECT; \ - if (virtTestRun("Path canonicalize " #id, \ + if (virTestRun("Path canonicalize " #id, \ testPathCanonicalize, &data3) < 0) \ ret = -1; \ } while (0) @@ -1234,7 +1234,7 @@ mymain(void) data4.top = &TOP; \ data4.base = &BASE; \ data4.expect = EXPECT; \ - if (virtTestRun("Path relative resolve " #id, \ + if (virTestRun("Path relative resolve " #id, \ testPathRelative, &data4) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virstringtest.c b/tests/virstringtest.c index 7a1dcfd..3eb3cf3 100644 --- a/tests/virstringtest.c +++ b/tests/virstringtest.c @@ -593,9 +593,9 @@ mymain(void) .delim = del, \ .tokens = toks, \ }; \ - if (virtTestRun("Split " #str, testSplit, &splitData) < 0) \ + if (virTestRun("Split " #str, testSplit, &splitData) < 0) \ ret = -1; \ - if (virtTestRun("Join " #str, testJoin, &joinData) < 0) \ + if (virTestRun("Join " #str, testJoin, &joinData) < 0) \ ret = -1; \ } while (0) @@ -623,27 +623,27 @@ mymain(void) const char *tokens8[] = { "gluster", "rdma", NULL }; TEST_SPLIT("gluster+rdma", "+", 2, tokens8); - if (virtTestRun("strdup", testStrdup, NULL) < 0) + if (virTestRun("strdup", testStrdup, NULL) < 0) ret = -1; - if (virtTestRun("strdup", testStrndupNegative, NULL) < 0) + if (virTestRun("strdup", testStrndupNegative, NULL) < 0) ret = -1; - if (virtTestRun("virStringSortCompare", testStringSortCompare, NULL) < 0) + if (virTestRun("virStringSortCompare", testStringSortCompare, NULL) < 0) ret = -1; -#define TEST_SEARCH(s, r, x, n, m, e) \ - do { \ - struct stringSearchData data = { \ - .str = s, \ - .maxMatches = x, \ - .regexp = r, \ - .expectNMatches = n, \ - .expectMatches = m, \ - .expectError = e, \ - }; \ - if (virtTestRun("virStringSearch " s, testStringSearch, &data) < 0) \ - ret = -1; \ +#define TEST_SEARCH(s, r, x, n, m, e) \ + do { \ + struct stringSearchData data = { \ + .str = s, \ + .maxMatches = x, \ + .regexp = r, \ + .expectNMatches = n, \ + .expectMatches = m, \ + .expectError = e, \ + }; \ + if (virTestRun("virStringSearch " s, testStringSearch, &data) < 0) \ + ret = -1; \ } while (0) /* error due to missing () in regexp */ @@ -667,16 +667,16 @@ mymain(void) const char *matches3[] = { "foo", "bar" }; TEST_SEARCH("1foo2bar3eek", "([a-z]+)", 2, 2, matches3, false); -#define TEST_REPLACE(h, o, n, r) \ - do { \ - struct stringReplaceData data = { \ - .haystack = h, \ - .oldneedle = o, \ - .newneedle = n, \ - .result = r \ - }; \ - if (virtTestRun("virStringReplace " h, testStringReplace, &data) < 0) \ - ret = -1; \ +#define TEST_REPLACE(h, o, n, r) \ + do { \ + struct stringReplaceData data = { \ + .haystack = h, \ + .oldneedle = o, \ + .newneedle = n, \ + .result = r \ + }; \ + if (virTestRun("virStringReplace " h, testStringReplace, &data) < 0) \ + ret = -1; \ } while (0) /* no matches */ @@ -704,7 +704,7 @@ mymain(void) struct stringToLongData data = { \ str, suff, i, i_ret, u, u_ret, ll, ll_ret, ull, ull_ret, \ }; \ - if (virtTestRun("virStringToLong '" str "'", testStringToLong, \ + if (virTestRun("virStringToLong '" str "'", testStringToLong, \ &data) < 0) \ ret = -1; \ } while (0) @@ -783,7 +783,7 @@ mymain(void) 0LL, -1, 0ULL, -1); /* test virStringFreeListCount */ - if (virtTestRun("virStringFreeListCount", testVirStringFreeListCount, + if (virTestRun("virStringFreeListCount", testVirStringFreeListCount, NULL) < 0) ret = -1; @@ -793,7 +793,7 @@ mymain(void) .string = str, \ .result = res, \ }; \ - if (virtTestRun("Strip brackets from IPv6 " #str, \ + if (virTestRun("Strip brackets from IPv6 " #str, \ testStripIPv6Brackets, &stripData) < 0) \ ret = -1; \ } while (0) @@ -812,7 +812,7 @@ mymain(void) .string = str, \ .result = res, \ }; \ - if (virtTestRun("Strip control chars from " #str, \ + if (virTestRun("Strip control chars from " #str, \ testStripControlChars, &stripData) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c index 5e72de4..4af5b5e 100644 --- a/tests/virsystemdtest.c +++ b/tests/virsystemdtest.c @@ -518,24 +518,24 @@ mymain(void) if (virUUIDParse("c7a5fdbd-edaf-9455-926a-d65c16db1809", uuid) < 0) return EXIT_FAILURE; - if (virtTestRun("Test create container ", testCreateContainer, NULL) < 0) + if (virTestRun("Test create container ", testCreateContainer, NULL) < 0) ret = -1; - if (virtTestRun("Test terminate container ", testTerminateContainer, NULL) < 0) + if (virTestRun("Test terminate container ", testTerminateContainer, NULL) < 0) ret = -1; - if (virtTestRun("Test create machine ", testCreateMachine, NULL) < 0) + if (virTestRun("Test create machine ", testCreateMachine, NULL) < 0) ret = -1; - if (virtTestRun("Test terminate machine ", testTerminateMachine, NULL) < 0) + if (virTestRun("Test terminate machine ", testTerminateMachine, NULL) < 0) ret = -1; - if (virtTestRun("Test create no systemd ", testCreateNoSystemd, NULL) < 0) + if (virTestRun("Test create no systemd ", testCreateNoSystemd, NULL) < 0) ret = -1; - if (virtTestRun("Test create systemd not running ", + if (virTestRun("Test create systemd not running ", testCreateSystemdNotRunning, NULL) < 0) ret = -1; - if (virtTestRun("Test create bad systemd ", testCreateBadSystemd, NULL) < 0) + if (virTestRun("Test create bad systemd ", testCreateBadSystemd, NULL) < 0) ret = -1; - if (virtTestRun("Test create with network ", testCreateNetwork, NULL) < 0) + if (virTestRun("Test create with network ", testCreateNetwork, NULL) < 0) ret = -1; - if (virtTestRun("Test getting machine name ", testGetMachineName, NULL) < 0) + if (virTestRun("Test getting machine name ", testGetMachineName, NULL) < 0) ret = -1; # define TEST_SCOPE(_name, unitname, _legacy) \ @@ -543,7 +543,7 @@ mymain(void) struct testNameData data = { \ .name = _name, .expected = unitname, .legacy = _legacy, \ }; \ - if (virtTestRun("Test scopename", testScopeName, &data) < 0) \ + if (virTestRun("Test scopename", testScopeName, &data) < 0) \ ret = -1; \ } while (0) @@ -560,12 +560,12 @@ mymain(void) TEST_SCOPE_NEW("qemu-3-demo", "machine-qemu\\x2d3\\x2ddemo.scope"); -# define TEST_MACHINE(_name, _id, machinename) \ +# define TEST_MACHINE(_name, _id, machinename) \ do { \ struct testNameData data = { \ - .name = _name, .expected = machinename, .id = _id, \ + .name = _name, .expected = machinename, .id = _id, \ }; \ - if (virtTestRun("Test scopename", testMachineName, &data) < 0) \ + if (virTestRun("Test scopename", testMachineName, &data) < 0) \ ret = -1; \ } while (0) @@ -580,19 +580,19 @@ mymain(void) TEST_MACHINE("123456789012345678901234567890123456789012345678901234567890", 8, "qemu-8-123456789012345678901234567890123456789012345678901234567"); -# define TESTS_PM_SUPPORT_HELPER(name, function) \ - do { \ - struct testPMSupportData data = { \ - function \ - }; \ - if (virtTestRun("Test " name " ", testPMSupportHelper, &data) < 0) \ - ret = -1; \ - if (virtTestRun("Test " name " no systemd ", \ - testPMSupportHelperNoSystemd, &data) < 0) \ - ret = -1; \ - if (virtTestRun("Test systemd " name " not running ", \ - testPMSupportSystemdNotRunning, &data) < 0) \ - ret = -1; \ +# define TESTS_PM_SUPPORT_HELPER(name, function) \ + do { \ + struct testPMSupportData data = { \ + function \ + }; \ + if (virTestRun("Test " name " ", testPMSupportHelper, &data) < 0) \ + ret = -1; \ + if (virTestRun("Test " name " no systemd ", \ + testPMSupportHelperNoSystemd, &data) < 0) \ + ret = -1; \ + if (virTestRun("Test systemd " name " not running ", \ + testPMSupportSystemdNotRunning, &data) < 0) \ + ret = -1; \ } while (0) TESTS_PM_SUPPORT_HELPER("canSuspend", &virSystemdCanSuspend); diff --git a/tests/virtimetest.c b/tests/virtimetest.c index 49040d3..635182f 100644 --- a/tests/virtimetest.c +++ b/tests/virtimetest.c @@ -128,24 +128,24 @@ mymain(void) signal(SIGPIPE, SIG_IGN); -#define TEST_FIELDS(ts, year, mon, day, hour, min, sec) \ - do { \ - struct testTimeFieldsData data = { \ - .when = ts, \ - .fields = { \ - .tm_year = year, \ - .tm_mon = mon, \ - .tm_mday = day, \ - .tm_hour = hour, \ - .tm_min = min, \ - .tm_sec = sec, \ - .tm_wday = 0, \ - .tm_yday = 0, \ - .tm_isdst = 0, \ - }, \ - }; \ - if (virtTestRun("Test fields " #ts " " #year " ", testTimeFields, &data) < 0) \ - ret = -1; \ +#define TEST_FIELDS(ts, year, mon, day, hour, min, sec) \ + do { \ + struct testTimeFieldsData data = { \ + .when = ts, \ + .fields = { \ + .tm_year = year, \ + .tm_mon = mon, \ + .tm_mday = day, \ + .tm_hour = hour, \ + .tm_min = min, \ + .tm_sec = sec, \ + .tm_wday = 0, \ + .tm_yday = 0, \ + .tm_isdst = 0, \ + }, \ + }; \ + if (virTestRun("Test fields " #ts " " #year " ", testTimeFields, &data) < 0) \ + ret = -1; \ } while (0) TEST_FIELDS(0ull, 1970, 1, 1, 0, 0, 0); @@ -168,15 +168,15 @@ mymain(void) TEST_FIELDS(2147483648000ull, 2038, 1, 19, 3, 14, 8); -#define TEST_LOCALOFFSET(tz, off) \ - do { \ - testTimeLocalOffsetData data = { \ - .zone = tz, \ - .offset = off, \ - }; \ - if (virtTestRun("Test localtime offset for " #tz, \ +#define TEST_LOCALOFFSET(tz, off) \ + do { \ + testTimeLocalOffsetData data = { \ + .zone = tz, \ + .offset = off, \ + }; \ + if (virTestRun("Test localtime offset for " #tz, \ testTimeLocalOffset, &data) < 0) \ - ret = -1; \ + ret = -1; \ } while (0) TEST_LOCALOFFSET("VIR00:30", -30 * 60); diff --git a/tests/virtypedparamtest.c b/tests/virtypedparamtest.c index d125491..97dd82a 100644 --- a/tests/virtypedparamtest.c +++ b/tests/virtypedparamtest.c @@ -278,7 +278,7 @@ testTypedParamsValidator(void) }; for (i = 0; test[i].name; ++i) { - if (virtTestRun(test[i].name, testTypedParamsValidate, &test[i]) < 0) + if (virTestRun(test[i].name, testTypedParamsValidate, &test[i]) < 0) rv = -1; } @@ -293,13 +293,13 @@ mymain(void) if (testTypedParamsValidator() < 0) rv = -1; - if (virtTestRun("Filtering", testTypedParamsFilter, NULL) < 0) + if (virTestRun("Filtering", testTypedParamsFilter, NULL) < 0) rv = -1; - if (virtTestRun("Get All Strings", testTypedParamsGetStringList, NULL) < 0) + if (virTestRun("Get All Strings", testTypedParamsGetStringList, NULL) < 0) rv = -1; - if (virtTestRun("Add string list", testTypedParamsAddStringList, NULL) < 0) + if (virTestRun("Add string list", testTypedParamsAddStringList, NULL) < 0) rv = -1; if (rv < 0) diff --git a/tests/viruritest.c b/tests/viruritest.c index e58e353..0d392ee 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -144,15 +144,15 @@ mymain(void) signal(SIGPIPE, SIG_IGN); -#define TEST_FULL(uri, uri_out, scheme, server, port, path, query, \ - fragment, user, params) \ - do { \ - const struct URIParseData data = { \ - uri, (uri_out) ? (uri_out) : (uri), scheme, server, port, \ - path, query, fragment, user, params \ - }; \ - if (virtTestRun("Test URI " # uri, testURIParse, &data) < 0) \ - ret = -1; \ +#define TEST_FULL(uri, uri_out, scheme, server, port, path, query, \ + fragment, user, params) \ + do { \ + const struct URIParseData data = { \ + uri, (uri_out) ? (uri_out) : (uri), scheme, server, port, \ + path, query, fragment, user, params \ + }; \ + if (virTestRun("Test URI " # uri, testURIParse, &data) < 0) \ + ret = -1; \ } while (0) #define TEST_PARSE(uri, scheme, server, port, path, query, fragment, user, params) \ TEST_FULL(uri, NULL, scheme, server, port, path, query, fragment, user, params) diff --git a/tests/virusbtest.c b/tests/virusbtest.c index d08e03b..4bbfe4a 100644 --- a/tests/virusbtest.c +++ b/tests/virusbtest.c @@ -240,12 +240,12 @@ mymain(void) int rv = 0; #define DO_TEST_FIND_FULL(name, vend, prod, bus, devno, vroot, mand, how, fail) \ - do { \ - struct findTestInfo data = { name, vend, prod, bus, \ - devno, vroot, mand, how, fail \ - }; \ - if (virtTestRun("USBDeviceFind " name, testDeviceFind, &data) < 0) \ - rv = -1; \ + do { \ + struct findTestInfo data = { name, vend, prod, bus, \ + devno, vroot, mand, how, fail \ + }; \ + if (virTestRun("USBDeviceFind " name, testDeviceFind, &data) < 0) \ + rv = -1; \ } while (0) #define DO_TEST_FIND(name, vend, prod, bus, devno) \ @@ -282,7 +282,7 @@ mymain(void) DO_TEST_FIND_BY_VENDOR_FAIL("Bogus vendor and product", 0xf00d, 0xbeef); DO_TEST_FIND_BY_VENDOR_FAIL("Valid vendor", 0x1d6b, 0xbeef); - if (virtTestRun("USB List test", testUSBList, NULL) < 0) + if (virTestRun("USB List test", testUSBList, NULL) < 0) rv = -1; if (rv < 0) diff --git a/tests/vmwarevertest.c b/tests/vmwarevertest.c index 24de9e1..e41231d 100644 --- a/tests/vmwarevertest.c +++ b/tests/vmwarevertest.c @@ -82,7 +82,7 @@ mymain(void) struct testInfo info = { \ vmware_type, name, version \ }; \ - if (virtTestRun("VMware Version String Parsing " name, \ + if (virTestRun("VMware Version String Parsing " name, \ testVerStrParse, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index efd6325..b5557b2 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -184,7 +184,7 @@ mymain(void) do { \ struct testInfo info = { _in, _out }; \ virResetLastError(); \ - if (virtTestRun("VMware VMX-2-XML "_in" -> "_out, \ + if (virTestRun("VMware VMX-2-XML "_in" -> "_out, \ testCompareHelper, &info) < 0) { \ ret = -1; \ } \ diff --git a/tests/xencapstest.c b/tests/xencapstest.c index 6439254..87dc8de 100644 --- a/tests/xencapstest.c +++ b/tests/xencapstest.c @@ -170,50 +170,50 @@ mymain(void) if (virInitialize() < 0) return EXIT_FAILURE; - if (virtTestRun("Capabilities for i686, no PAE, no HVM", + if (virTestRun("Capabilities for i686, no PAE, no HVM", testXeni686, NULL) != 0) ret = -1; - if (virtTestRun("Capabilities for i686, PAE, no HVM", + if (virTestRun("Capabilities for i686, PAE, no HVM", testXeni686PAE, NULL) != 0) ret = -1; /* No PAE + HVM is non-sensical - all VMX capable CPUs have PAE */ - /*if (virtTestRun("Capabilities for i686, no PAE, HVM", + /*if (virTestRun("Capabilities for i686, no PAE, HVM", testXeni686HVM, NULL) != 0) ret = -1; */ - if (virtTestRun("Capabilities for i686, PAE, HVM", + if (virTestRun("Capabilities for i686, PAE, HVM", testXeni686PAEHVM, NULL) != 0) ret = -1; - if (virtTestRun("Capabilities for x86_64, no HVM", + if (virTestRun("Capabilities for x86_64, no HVM", testXenx86_64, NULL) != 0) ret = -1; - if (virtTestRun("Capabilities for x86_64, HVM", + if (virTestRun("Capabilities for x86_64, HVM", testXenx86_64HVM, NULL) != 0) ret = -1; - if (virtTestRun("Capabilities for ia64, no HVM, LE", + if (virTestRun("Capabilities for ia64, no HVM, LE", testXenia64, NULL) != 0) ret = -1; - if (virtTestRun("Capabilities for ia64, HVM, LE", + if (virTestRun("Capabilities for ia64, HVM, LE", testXenia64HVM, NULL) != 0) ret = -1; - if (virtTestRun("Capabilities for ia64, no HVM, BE", + if (virTestRun("Capabilities for ia64, no HVM, BE", testXenia64BE, NULL) != 0) ret = -1; - if (virtTestRun("Capabilities for ia64, HVM, BE", + if (virTestRun("Capabilities for ia64, HVM, BE", testXenia64BEHVM, NULL) != 0) ret = -1; - if (virtTestRun("Capabilities for ppc64", + if (virTestRun("Capabilities for ppc64", testXenppc64, NULL) != 0) ret = -1; diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c index 6819bad..e9c583c 100644 --- a/tests/xlconfigtest.c +++ b/tests/xlconfigtest.c @@ -187,7 +187,7 @@ mymain(void) #define DO_TEST_PARSE(name) \ do { \ struct testInfo info0 = { name, 0 }; \ - if (virtTestRun("Xen XL-2-XML Parse " name, \ + if (virTestRun("Xen XL-2-XML Parse " name, \ testCompareHelper, &info0) < 0) \ ret = -1; \ } while (0) @@ -195,7 +195,7 @@ mymain(void) #define DO_TEST_FORMAT(name) \ do { \ struct testInfo info1 = { name, 1 }; \ - if (virtTestRun("Xen XL-2-XML Format " name, \ + if (virTestRun("Xen XL-2-XML Format " name, \ testCompareHelper, &info1) < 0) \ ret = -1; \ } while (0) diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index 9b21a13..d01191c 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -189,7 +189,7 @@ mymain(void) #define DO_TEST_PARSE(name) \ do { \ struct testInfo info0 = { name, 0 }; \ - if (virtTestRun("Xen XM-2-XML Parse " name, \ + if (virTestRun("Xen XM-2-XML Parse " name, \ testCompareHelper, &info0) < 0) \ ret = -1; \ } while (0) @@ -198,7 +198,7 @@ mymain(void) #define DO_TEST_FORMAT(name) \ do { \ struct testInfo info1 = { name, 1 }; \ - if (virtTestRun("Xen XM-2-XML Format " name, \ + if (virTestRun("Xen XM-2-XML Format " name, \ testCompareHelper, &info1) < 0) \ ret = -1; \ } while (0) diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c index 66503b7..e937419 100644 --- a/tests/xml2sexprtest.c +++ b/tests/xml2sexprtest.c @@ -90,7 +90,7 @@ mymain(void) do { \ struct testInfo info = { in, out, name }; \ virResetLastError(); \ - if (virtTestRun("Xen XML-2-SEXPR " in " -> " out, \ + if (virTestRun("Xen XML-2-SEXPR " in " -> " out, \ testCompareHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c index d970240..e2e1749 100644 --- a/tests/xml2vmxtest.c +++ b/tests/xml2vmxtest.c @@ -203,7 +203,7 @@ mymain(void) do { \ struct testInfo info = { _in, _out, _version }; \ virResetLastError(); \ - if (virtTestRun("VMware XML-2-VMX "_in" -> "_out, \ + if (virTestRun("VMware XML-2-VMX "_in" -> "_out, \ testCompareHelper, &info) < 0) { \ result = -1; \ } \ -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/commandtest.c | 16 ++++++++-------- tests/esxutilstest.c | 6 +++--- tests/jsontest.c | 6 +++--- tests/nwfilterebiptablestest.c | 14 +++++++------- tests/openvzutilstest.c | 4 ++-- tests/qemumonitortest.c | 4 ++-- tests/sockettest.c | 2 +- tests/testutils.c | 2 +- tests/testutils.h | 2 +- tests/utiltest.c | 2 +- tests/vboxsnapshotxmltest.c | 2 +- tests/virbuftest.c | 10 +++++----- tests/virfirewalltest.c | 20 ++++++++++---------- tests/virkmodtest.c | 2 +- tests/virnetdevbandwidthtest.c | 2 +- tests/virnetsockettest.c | 2 +- tests/virshtest.c | 2 +- tests/virstoragetest.c | 2 +- 18 files changed, 50 insertions(+), 50 deletions(-) diff --git a/tests/commandtest.c b/tests/commandtest.c index d685b1c..c0829c6 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -98,7 +98,7 @@ static int checkoutput(const char *testname, } if (STRNEQ(expectlog, actuallog)) { - virtTestDifference(stderr, expectlog, actuallog); + virTestDifference(stderr, expectlog, actuallog); goto cleanup; } @@ -504,7 +504,7 @@ static int test13(const void *unused ATTRIBUTE_UNUSED) cmd = NULL; if (STRNEQ(outactual, outexpect)) { - virtTestDifference(stderr, outexpect, outactual); + virTestDifference(stderr, outexpect, outactual); goto cleanup; } @@ -566,15 +566,15 @@ static int test14(const void *unused ATTRIBUTE_UNUSED) goto cleanup; if (STRNEQ(outactual, outexpect)) { - virtTestDifference(stderr, outexpect, outactual); + virTestDifference(stderr, outexpect, outactual); goto cleanup; } if (STRNEQ(erractual, errexpect)) { - virtTestDifference(stderr, errexpect, erractual); + virTestDifference(stderr, errexpect, erractual); goto cleanup; } if (STRNEQ(jointactual, jointexpect)) { - virtTestDifference(stderr, jointexpect, jointactual); + virTestDifference(stderr, jointexpect, jointactual); goto cleanup; } @@ -650,7 +650,7 @@ static int test16(const void *unused ATTRIBUTE_UNUSED) } if (STRNEQ(outactual, outexpect)) { - virtTestDifference(stderr, outexpect, outactual); + virTestDifference(stderr, outexpect, outactual); goto cleanup; } @@ -880,12 +880,12 @@ static int test21(const void *unused ATTRIBUTE_UNUSED) printf("STDOUT:%s\nSTDERR:%s\n", NULLSTR(outbuf), NULLSTR(errbuf)); if (STRNEQ(outbuf, outbufExpected)) { - virtTestDifference(stderr, outbufExpected, outbuf); + virTestDifference(stderr, outbufExpected, outbuf); goto cleanup; } if (STRNEQ(errbuf, errbufExpected)) { - virtTestDifference(stderr, errbufExpected, errbuf); + virTestDifference(stderr, errbufExpected, errbuf); goto cleanup; } diff --git a/tests/esxutilstest.c b/tests/esxutilstest.c index f36a415..3e2ef6f 100644 --- a/tests/esxutilstest.c +++ b/tests/esxutilstest.c @@ -58,17 +58,17 @@ testParseDatastorePath(const void *data ATTRIBUTE_UNUSED) continue; if (STRNEQ(paths[i].datastoreName, datastoreName)) { - virtTestDifference(stderr, paths[i].datastoreName, datastoreName); + virTestDifference(stderr, paths[i].datastoreName, datastoreName); goto failure; } if (STRNEQ(paths[i].directoryName, directoryName)) { - virtTestDifference(stderr, paths[i].directoryName, directoryName); + virTestDifference(stderr, paths[i].directoryName, directoryName); goto failure; } if (STRNEQ(paths[i].directoryAndFileName, directoryAndFileName)) { - virtTestDifference(stderr, paths[i].directoryAndFileName, + virTestDifference(stderr, paths[i].directoryAndFileName, directoryAndFileName); goto failure; } diff --git a/tests/jsontest.c b/tests/jsontest.c index 2a6fcde..8e44f1a 100644 --- a/tests/jsontest.c +++ b/tests/jsontest.c @@ -105,7 +105,7 @@ testJSONAddRemove(const void *data) goto cleanup; } if (STRNEQ(info->expect, result)) { - virtTestDifference(stderr, info->expect, result); + virTestDifference(stderr, info->expect, result); goto cleanup; } ret = 0; @@ -270,7 +270,7 @@ testJSONCopy(const void *data) if (STRNEQ(result, resultCopy)) { if (virTestGetVerbose()) - virtTestDifference(stderr, result, resultCopy); + virTestDifference(stderr, result, resultCopy); ret = -1; goto cleanup; } @@ -296,7 +296,7 @@ testJSONCopy(const void *data) if (STRNEQ(result, resultCopy)) { if (virTestGetVerbose()) - virtTestDifference(stderr, result, resultCopy); + virTestDifference(stderr, result, resultCopy); ret = -1; goto cleanup; } diff --git a/tests/nwfilterebiptablestest.c b/tests/nwfilterebiptablestest.c index 475e844..e6b9dd7 100644 --- a/tests/nwfilterebiptablestest.c +++ b/tests/nwfilterebiptablestest.c @@ -116,7 +116,7 @@ testNWFilterEBIPTablesAllTeardown(const void *opaque ATTRIBUTE_UNUSED) virtTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -187,7 +187,7 @@ testNWFilterEBIPTablesTearOldRules(const void *opaque ATTRIBUTE_UNUSED) virtTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -236,7 +236,7 @@ testNWFilterEBIPTablesRemoveBasicRules(const void *opaque ATTRIBUTE_UNUSED) virtTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -270,7 +270,7 @@ testNWFilterEBIPTablesTearNewRules(const void *opaque ATTRIBUTE_UNUSED) virtTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -342,7 +342,7 @@ testNWFilterEBIPTablesApplyBasicRules(const void *opaque ATTRIBUTE_UNUSED) virtTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -432,7 +432,7 @@ testNWFilterEBIPTablesApplyDHCPOnlyRules(const void *opaque ATTRIBUTE_UNUSED) virtTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -505,7 +505,7 @@ testNWFilterEBIPTablesApplyDropAllRules(const void *opaque ATTRIBUTE_UNUSED) virtTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } diff --git a/tests/openvzutilstest.c b/tests/openvzutilstest.c index fc5bee0..c7336e7 100644 --- a/tests/openvzutilstest.c +++ b/tests/openvzutilstest.c @@ -55,7 +55,7 @@ testReadConfigParam(const void *data ATTRIBUTE_UNUSED) continue; if (STRNEQ(configParams[i].value, value)) { - virtTestDifference(stderr, configParams[i].value, value); + virTestDifference(stderr, configParams[i].value, value); goto cleanup; } } @@ -121,7 +121,7 @@ testReadNetworkConf(const void *data ATTRIBUTE_UNUSED) } if (STRNEQ(expected, actual)) { - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } diff --git a/tests/qemumonitortest.c b/tests/qemumonitortest.c index a1c44f7..988266c 100644 --- a/tests/qemumonitortest.c +++ b/tests/qemumonitortest.c @@ -52,7 +52,7 @@ static int testEscapeArg(const void *data ATTRIBUTE_UNUSED) return -1; } if (STRNEQ(escapeStrings[i].escaped, escaped)) { - virtTestDifference(stderr, escapeStrings[i].escaped, escaped); + virTestDifference(stderr, escapeStrings[i].escaped, escaped); VIR_FREE(escaped); return -1; } @@ -77,7 +77,7 @@ static int testUnescapeArg(const void *data ATTRIBUTE_UNUSED) return -1; } if (STRNEQ(escapeStrings[i].unescaped, unescaped)) { - virtTestDifference(stderr, escapeStrings[i].unescaped, unescaped); + virTestDifference(stderr, escapeStrings[i].unescaped, unescaped); VIR_FREE(unescaped); return -1; } diff --git a/tests/sockettest.c b/tests/sockettest.c index 34cdb7c..6db5a5d 100644 --- a/tests/sockettest.c +++ b/tests/sockettest.c @@ -53,7 +53,7 @@ static int testFormat(virSocketAddr *addr, const char *addrstr, bool pass) return pass ? -1 : 0; if (STRNEQ(newaddrstr, addrstr)) { - virtTestDifference(stderr, newaddrstr, addrstr); + virTestDifference(stderr, newaddrstr, addrstr); VIR_FREE(newaddrstr); return pass ? -1 : 0; } else { diff --git a/tests/testutils.c b/tests/testutils.c index 23e8b13..06149762 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -607,7 +607,7 @@ virtTestDifferenceFullNoRegenerate(FILE *stream, * first and last characters at which differences occur */ int -virtTestDifference(FILE *stream, +virTestDifference(FILE *stream, const char *expect, const char *actual) { diff --git a/tests/testutils.h b/tests/testutils.h index 1b912c9..dd48a87 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -56,7 +56,7 @@ int virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxle void virtTestClearCommandPath(char *cmdset); -int virtTestDifference(FILE *stream, +int virTestDifference(FILE *stream, const char *expect, const char *actual); int virtTestDifferenceFull(FILE *stream, diff --git a/tests/utiltest.c b/tests/utiltest.c index 178c29e..5d7b915 100644 --- a/tests/utiltest.c +++ b/tests/utiltest.c @@ -52,7 +52,7 @@ testIndexToDiskName(const void *data ATTRIBUTE_UNUSED) diskName = virIndexToDiskName(i, "sd"); if (STRNEQ(diskNames[i], diskName)) { - virtTestDifference(stderr, diskNames[i], diskName); + virTestDifference(stderr, diskNames[i], diskName); VIR_FREE(diskName); return -1; diff --git a/tests/vboxsnapshotxmltest.c b/tests/vboxsnapshotxmltest.c index 24f537d..2ccfa73 100644 --- a/tests/vboxsnapshotxmltest.c +++ b/tests/vboxsnapshotxmltest.c @@ -85,7 +85,7 @@ testCompareXMLtoXMLFiles(const char *xml) goto cleanup; if (STRNEQ(actual, xmlData)) { - virtTestDifference(stderr, xmlData, actual); + virTestDifference(stderr, xmlData, actual); goto cleanup; } diff --git a/tests/virbuftest.c b/tests/virbuftest.c index 1e4ce18..22407ab 100644 --- a/tests/virbuftest.c +++ b/tests/virbuftest.c @@ -138,7 +138,7 @@ static int testBufAutoIndent(const void *data ATTRIBUTE_UNUSED) result = virBufferContentAndReset(buf); if (!result || STRNEQ(result, expected)) { - virtTestDifference(stderr, expected, result); + virTestDifference(stderr, expected, result); ret = -1; } VIR_FREE(result); @@ -175,7 +175,7 @@ static int testBufTrim(const void *data ATTRIBUTE_UNUSED) result = virBufferContentAndReset(buf); if (!result || STRNEQ(result, expected)) { - virtTestDifference(stderr, expected, result); + virTestDifference(stderr, expected, result); goto cleanup; } @@ -292,7 +292,7 @@ static int testBufAddBuffer(const void *data ATTRIBUTE_UNUSED) result = virBufferContentAndReset(&buf1); if (STRNEQ_NULLABLE(result, expected)) { - virtTestDifference(stderr, expected, result); + virTestDifference(stderr, expected, result); goto cleanup; } @@ -330,7 +330,7 @@ testBufAddStr(const void *opaque ATTRIBUTE_UNUSED) if (STRNEQ_NULLABLE(actual, data->expect)) { VIR_TEST_DEBUG("testBufAddStr(): Strings don't match:\n"); - virtTestDifference(stderr, data->expect, actual); + virTestDifference(stderr, data->expect, actual); goto cleanup; } @@ -363,7 +363,7 @@ testBufEscapeStr(const void *opaque ATTRIBUTE_UNUSED) if (STRNEQ_NULLABLE(actual, data->expect)) { VIR_TEST_DEBUG("testBufEscapeStr(): Strings don't match:\n"); - virtTestDifference(stderr, data->expect, actual); + virTestDifference(stderr, data->expect, actual); goto cleanup; } diff --git a/tests/virfirewalltest.c b/tests/virfirewalltest.c index 68c2dc5..338f714 100644 --- a/tests/virfirewalltest.c +++ b/tests/virfirewalltest.c @@ -241,7 +241,7 @@ testFirewallSingleGroup(const void *opaque) if (STRNEQ_NULLABLE(expected, actual)) { fprintf(stderr, "Unexected command execution\n"); - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -307,7 +307,7 @@ testFirewallRemoveRule(const void *opaque) if (STRNEQ_NULLABLE(expected, actual)) { fprintf(stderr, "Unexected command execution\n"); - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -380,7 +380,7 @@ testFirewallManyGroups(const void *opaque ATTRIBUTE_UNUSED) if (STRNEQ_NULLABLE(expected, actual)) { fprintf(stderr, "Unexected command execution\n"); - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -476,7 +476,7 @@ testFirewallIgnoreFailGroup(const void *opaque ATTRIBUTE_UNUSED) if (STRNEQ_NULLABLE(expected, actual)) { fprintf(stderr, "Unexected command execution\n"); - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -550,7 +550,7 @@ testFirewallIgnoreFailRule(const void *opaque ATTRIBUTE_UNUSED) if (STRNEQ_NULLABLE(expected, actual)) { fprintf(stderr, "Unexected command execution\n"); - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -621,7 +621,7 @@ testFirewallNoRollback(const void *opaque ATTRIBUTE_UNUSED) if (STRNEQ_NULLABLE(expected, actual)) { fprintf(stderr, "Unexected command execution\n"); - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -711,7 +711,7 @@ testFirewallSingleRollback(const void *opaque ATTRIBUTE_UNUSED) if (STRNEQ_NULLABLE(expected, actual)) { fprintf(stderr, "Unexected command execution\n"); - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -804,7 +804,7 @@ testFirewallManyRollback(const void *opaque ATTRIBUTE_UNUSED) if (STRNEQ_NULLABLE(expected, actual)) { fprintf(stderr, "Unexected command execution\n"); - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -927,7 +927,7 @@ testFirewallChainedRollback(const void *opaque ATTRIBUTE_UNUSED) if (STRNEQ_NULLABLE(expected, actual)) { fprintf(stderr, "Unexected command execution\n"); - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } @@ -1110,7 +1110,7 @@ testFirewallQuery(const void *opaque ATTRIBUTE_UNUSED) if (STRNEQ_NULLABLE(expected, actual)) { fprintf(stderr, "Unexected command execution\n"); - virtTestDifference(stderr, expected, actual); + virTestDifference(stderr, expected, actual); goto cleanup; } diff --git a/tests/virkmodtest.c b/tests/virkmodtest.c index b86cf02..b98edf9 100644 --- a/tests/virkmodtest.c +++ b/tests/virkmodtest.c @@ -74,7 +74,7 @@ checkOutput(virBufferPtr buf, const char *exp_cmd) } if (STRNEQ(exp_cmd, actual_cmd)) { - virtTestDifference(stderr, exp_cmd, actual_cmd); + virTestDifference(stderr, exp_cmd, actual_cmd); goto cleanup; } diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index a87086e..0550058 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -95,7 +95,7 @@ testVirNetDevBandwidthSet(const void *data) } if (STRNEQ_NULLABLE(info->exp_cmd, actual_cmd)) { - virtTestDifference(stderr, + virTestDifference(stderr, NULLSTR(info->exp_cmd), NULLSTR(actual_cmd)); goto cleanup; diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 89965d5..bbecb3c 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -407,7 +407,7 @@ static int testSocketSSH(const void *opaque) buf[rv] = '\0'; if (STRNEQ(buf, data->expectOut)) { - virtTestDifference(stderr, data->expectOut, buf); + virTestDifference(stderr, data->expectOut, buf); goto cleanup; } diff --git a/tests/virshtest.c b/tests/virshtest.c index 374723c..a0dcf10 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -72,7 +72,7 @@ testCompareOutputLit(const char *expectData, goto cleanup; if (STRNEQ(expectData, actualData)) { - virtTestDifference(stderr, expectData, actualData); + virTestDifference(stderr, expectData, actualData); goto cleanup; } diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 5099b3a..38445c8 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -394,7 +394,7 @@ testStorageChain(const void *args) goto cleanup; } if (STRNEQ(expect, actual)) { - virtTestDifference(stderr, expect, actual); + virTestDifference(stderr, expect, actual); VIR_FREE(expect); VIR_FREE(actual); goto cleanup; -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/domainsnapshotxml2xmltest.c | 4 ++-- tests/interfacexml2xmltest.c | 2 +- tests/lxcconf2xmltest.c | 2 +- tests/networkxml2xmlupdatetest.c | 2 +- tests/nodedevxml2xmltest.c | 2 +- tests/qemuargv2xmltest.c | 2 +- tests/qemucapabilitiestest.c | 2 +- tests/qemucaps2xmltest.c | 2 +- tests/qemuhelptest.c | 4 ++-- tests/qemuhotplugtest.c | 6 +++--- tests/qemumonitorjsontest.c | 2 +- tests/qemuxml2argvtest.c | 2 +- tests/qemuxml2xmltest.c | 4 ++-- tests/sexpr2xmltest.c | 2 +- tests/testutils.c | 4 ++-- tests/testutils.h | 2 +- tests/vboxsnapshotxmltest.c | 4 ++-- tests/vmwarevertest.c | 2 +- tests/vmx2xmltest.c | 2 +- tests/xlconfigtest.c | 2 +- tests/xmconfigtest.c | 2 +- 21 files changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c index 21fb298..8e53b31 100644 --- a/tests/domainsnapshotxml2xmltest.c +++ b/tests/domainsnapshotxml2xmltest.c @@ -89,10 +89,10 @@ testCompareXMLToXMLFiles(const char *inxml, if (redefine) flags |= VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE; - if (virtTestLoadFile(inxml, &inXmlData) < 0) + if (virTestLoadFile(inxml, &inXmlData) < 0) goto cleanup; - if (virtTestLoadFile(outxml, &outXmlData) < 0) + if (virTestLoadFile(outxml, &outXmlData) < 0) goto cleanup; if (!(def = virDomainSnapshotDefParseString(inXmlData, driver.caps, diff --git a/tests/interfacexml2xmltest.c b/tests/interfacexml2xmltest.c index 073ff7a..f817f00 100644 --- a/tests/interfacexml2xmltest.c +++ b/tests/interfacexml2xmltest.c @@ -24,7 +24,7 @@ testCompareXMLToXMLFiles(const char *xml) int ret = -1; virInterfaceDefPtr dev = NULL; - if (virtTestLoadFile(xml, &xmlData) < 0) + if (virTestLoadFile(xml, &xmlData) < 0) goto fail; if (!(dev = virInterfaceDefParseString(xmlData))) diff --git a/tests/lxcconf2xmltest.c b/tests/lxcconf2xmltest.c index 17994ec..7873210 100644 --- a/tests/lxcconf2xmltest.c +++ b/tests/lxcconf2xmltest.c @@ -31,7 +31,7 @@ testCompareXMLToConfigFiles(const char *xmlfile, char *actualxml = NULL; virDomainDefPtr vmdef = NULL; - if (virtTestLoadFile(configfile, &config) < 0) + if (virTestLoadFile(configfile, &config) < 0) goto fail; vmdef = lxcParseConfigString(config, caps, xmlopt); diff --git a/tests/networkxml2xmlupdatetest.c b/tests/networkxml2xmlupdatetest.c index d2a093f..440d950 100644 --- a/tests/networkxml2xmlupdatetest.c +++ b/tests/networkxml2xmlupdatetest.c @@ -27,7 +27,7 @@ testCompareXMLToXMLFiles(const char *netxml, const char *updatexml, int ret = -1; virNetworkDefPtr def = NULL; - if (virtTestLoadFile(updatexml, &updateXmlData) < 0) + if (virTestLoadFile(updatexml, &updateXmlData) < 0) goto error; if (!(def = virNetworkDefParseFile(netxml))) diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c index 09f9341..42dfa66 100644 --- a/tests/nodedevxml2xmltest.c +++ b/tests/nodedevxml2xmltest.c @@ -24,7 +24,7 @@ testCompareXMLToXMLFiles(const char *xml) int ret = -1; virNodeDeviceDefPtr dev = NULL; - if (virtTestLoadFile(xml, &xmlData) < 0) + if (virTestLoadFile(xml, &xmlData) < 0) goto fail; if (!(dev = virNodeDeviceDefParseString(xmlData, EXISTING_DEVICE, NULL))) diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index 5e761d6..f1629bc 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -62,7 +62,7 @@ static int testCompareXMLToArgvFiles(const char *xmlfile, int ret = -1; virDomainDefPtr vmdef = NULL; - if (virtTestLoadFile(cmdfile, &cmd) < 0) + if (virTestLoadFile(cmdfile, &cmd) < 0) goto fail; if (!(vmdef = qemuParseCommandLineString(driver.caps, driver.xmlopt, diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 0cee801..cbad284 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -104,7 +104,7 @@ testQemuCaps(const void *opaque) abs_srcdir, data->base, data->archName) < 0) goto cleanup; - if (virtTestLoadFile(repliesFile, &replies) < 0) + if (virTestLoadFile(repliesFile, &replies) < 0) goto cleanup; if (!(mon = testQemuFeedMonitor(replies, data->xmlopt))) diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 39d79a1..5f634d1 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -135,7 +135,7 @@ testQemuCapsXML(const void *opaque) abs_srcdir, data->base) < 0) goto cleanup; - if (virtTestLoadFile(capsFile, &capsData) < 0) + if (virTestLoadFile(capsFile, &capsData) < 0) goto cleanup; if (!(capsProvided = testGetCaps(capsData, data))) diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 8746410..80a1eb5 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -52,7 +52,7 @@ static int testHelpStrParsing(const void *data) if (virAsprintf(&path, "%s/qemuhelpdata/%s", abs_srcdir, info->name) < 0) return -1; - if (virtTestLoadFile(path, &help) < 0) + if (virTestLoadFile(path, &help) < 0) goto cleanup; if (!(flags = virQEMUCapsNew())) @@ -76,7 +76,7 @@ static int testHelpStrParsing(const void *data) info->name) < 0) goto cleanup; - if (virtTestLoadFile(path, &help) < 0) + if (virTestLoadFile(path, &help) < 0) goto cleanup; if (virQEMUCapsParseDeviceStr(flags, help) < 0) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 3961328..68279d0 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -233,12 +233,12 @@ testQemuHotplug(const void *data) test->device_filename) < 0) goto cleanup; - if (virtTestLoadFile(domain_filename, &domain_xml) < 0 || - virtTestLoadFile(device_filename, &device_xml) < 0) + if (virTestLoadFile(domain_filename, &domain_xml) < 0 || + virTestLoadFile(device_filename, &device_xml) < 0) goto cleanup; if (test->action != UPDATE && - virtTestLoadFile(result_filename, &result_xml) < 0) + virTestLoadFile(result_filename, &result_xml) < 0) goto cleanup; if (!(caps = virQEMUDriverGetCapabilities(&driver, false))) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 7d56941..e929cb2 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2159,7 +2159,7 @@ testQemuMonitorJSONGetCPUData(const void *opaque) abs_srcdir, data->name) < 0) goto cleanup; - if (virtTestLoadFile(jsonFile, &jsonStr) < 0) + if (virTestLoadFile(jsonFile, &jsonStr) < 0) goto cleanup; if (qemuMonitorTestAddItem(test, "qom-list", diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index cb7eefa..1cfbe1a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -194,7 +194,7 @@ fakeStoragePoolGetXMLDesc(virStoragePoolPtr pool, pool->name) < 0) return NULL; - if (virtTestLoadFile(xmlpath, &xmlbuf) < 0) { + if (virTestLoadFile(xmlpath, &xmlbuf) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "failed to load XML file '%s'", xmlpath); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 5f3a0b3..7b01587 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -109,9 +109,9 @@ testCompareStatusXMLToXMLFiles(const void *opaque) int ret = -1; int keepBlanksDefault = xmlKeepBlanksDefault(0); - if (virtTestLoadFile(data->inName, &inFile) < 0) + if (virTestLoadFile(data->inName, &inFile) < 0) goto cleanup; - if (virtTestLoadFile(data->outActiveName, &outActiveFile) < 0) + if (virTestLoadFile(data->outActiveName, &outActiveFile) < 0) goto cleanup; /* construct faked source status XML */ diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index a488c60..e3698fb 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -36,7 +36,7 @@ testCompareFiles(const char *xml, const char *sexpr) conn = virGetConnect(); if (!conn) goto fail; - if (virtTestLoadFile(sexpr, &sexprData) < 0) + if (virTestLoadFile(sexpr, &sexprData) < 0) goto fail; memset(&priv, 0, sizeof(priv)); diff --git a/tests/testutils.c b/tests/testutils.c index 06149762..1b081a5 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -294,7 +294,7 @@ virTestRun(const char *title, Upon any failure, diagnose it and return -1, but don't bother trying to preserve errno. Otherwise, return the number of bytes copied into BUF. */ int -virtTestLoadFile(const char *file, char **buf) +virTestLoadFile(const char *file, char **buf) { FILE *fp = fopen(file, "r"); struct stat st; @@ -693,7 +693,7 @@ virtTestCompareToFile(const char *strcontent, char *filecontent = NULL; char *fixedcontent = NULL; - if (virtTestLoadFile(filename, &filecontent) < 0 && !virTestGetRegenerate()) + if (virTestLoadFile(filename, &filecontent) < 0 && !virTestGetRegenerate()) goto failure; if (filecontent && diff --git a/tests/testutils.h b/tests/testutils.h index dd48a87..1a094b3 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -51,7 +51,7 @@ bool virtTestOOMActive(void); int virTestRun(const char *title, int (*body)(const void *data), const void *data); -int virtTestLoadFile(const char *file, char **buf); +int virTestLoadFile(const char *file, char **buf); int virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen); void virtTestClearCommandPath(char *cmdset); diff --git a/tests/vboxsnapshotxmltest.c b/tests/vboxsnapshotxmltest.c index 2ccfa73..1bbfb81 100644 --- a/tests/vboxsnapshotxmltest.c +++ b/tests/vboxsnapshotxmltest.c @@ -67,7 +67,7 @@ testCompareXMLtoXMLFiles(const char *xml) if (virFileMakePath(abs_builddir "/vboxsnapshotxmldata") < 0) goto cleanup; - if (virtTestLoadFile(xml, &xmlData) < 0) + if (virTestLoadFile(xml, &xmlData) < 0) goto cleanup; if (!(machine = virVBoxSnapshotConfLoadVboxFile(xml, (char*)""))) @@ -76,7 +76,7 @@ testCompareXMLtoXMLFiles(const char *xml) if (virVBoxSnapshotConfSaveVboxFile(machine, pathResult) < 0) goto cleanup; - if (virtTestLoadFile(pathResult, &actual) < 0) + if (virTestLoadFile(pathResult, &actual) < 0) goto cleanup; if (!(actual = testFilterXML(actual))) diff --git a/tests/vmwarevertest.c b/tests/vmwarevertest.c index e41231d..2768f43 100644 --- a/tests/vmwarevertest.c +++ b/tests/vmwarevertest.c @@ -49,7 +49,7 @@ testVerStrParse(const void *data) info->name) < 0) return -1; - if (virtTestLoadFile(path, &databuf) < 0) + if (virTestLoadFile(path, &databuf) < 0) goto cleanup; if ((vmware_type = vmwareDriverTypeFromString(info->vmware_type)) < 0) diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index b5557b2..e45f153 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -75,7 +75,7 @@ testCompareFiles(const char *vmx, const char *xml) char *formatted = NULL; virDomainDefPtr def = NULL; - if (virtTestLoadFile(vmx, &vmxData) < 0) + if (virTestLoadFile(vmx, &vmxData) < 0) goto cleanup; if (!(def = virVMXParseConfig(&ctx, xmlopt, caps, vmxData))) diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c index e9c583c..95d47c4 100644 --- a/tests/xlconfigtest.c +++ b/tests/xlconfigtest.c @@ -111,7 +111,7 @@ testCompareFormatXML(const char *xlcfg, const char *xml) conn = virGetConnect(); if (!conn) goto fail; - if (virtTestLoadFile(xlcfg, &xlcfgData) < 0) + if (virTestLoadFile(xlcfg, &xlcfgData) < 0) goto fail; if (!(conf = virConfReadMem(xlcfgData, strlen(xlcfgData), 0))) diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index d01191c..d4b6b87 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -108,7 +108,7 @@ testCompareFormatXML(const char *xmcfg, const char *xml) conn = virGetConnect(); if (!conn) goto fail; - if (virtTestLoadFile(xmcfg, &xmcfgData) < 0) + if (virTestLoadFile(xmcfg, &xmcfgData) < 0) goto fail; /* Many puppies died to bring you this code. */ -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/bhyvexml2argvtest.c | 6 +++--- tests/cputest.c | 2 +- tests/domaincapstest.c | 2 +- tests/lxcconf2xmltest.c | 2 +- tests/networkxml2conftest.c | 2 +- tests/networkxml2firewalltest.c | 2 +- tests/networkxml2xmltest.c | 2 +- tests/networkxml2xmlupdatetest.c | 2 +- tests/nodeinfotest.c | 4 ++-- tests/nwfilterxml2firewalltest.c | 2 +- tests/nwfilterxml2xmltest.c | 2 +- tests/qemuargv2xmltest.c | 2 +- tests/qemucapabilitiestest.c | 2 +- tests/qemucaps2xmltest.c | 2 +- tests/qemumonitorjsontest.c | 2 +- tests/qemuxml2argvtest.c | 2 +- tests/secretxml2xmltest.c | 2 +- tests/sexpr2xmltest.c | 2 +- tests/storagepoolxml2xmltest.c | 2 +- tests/storagevolxml2argvtest.c | 2 +- tests/storagevolxml2xmltest.c | 2 +- tests/sysinfotest.c | 2 +- tests/testutils.c | 4 ++-- tests/testutils.h | 2 +- tests/vircaps2xmltest.c | 2 +- tests/vircgrouptest.c | 2 +- tests/virnetdaemontest.c | 2 +- tests/vmx2xmltest.c | 2 +- tests/xencapstest.c | 2 +- tests/xlconfigtest.c | 4 ++-- tests/xmconfigtest.c | 4 ++-- tests/xml2sexprtest.c | 2 +- tests/xml2vmxtest.c | 2 +- 33 files changed, 39 insertions(+), 39 deletions(-) diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index 68d35db..7a2d366 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -66,14 +66,14 @@ static int testCompareXMLToArgvFiles(const char *xml, if (!(actualld = virCommandToString(ldcmd))) goto out; - if (virtTestCompareToFile(actualargv, cmdline) < 0) + if (virTestCompareToFile(actualargv, cmdline) < 0) goto out; - if (virtTestCompareToFile(actualld, ldcmdline) < 0) + if (virTestCompareToFile(actualld, ldcmdline) < 0) goto out; if (virFileExists(dmcmdline) || actualdm) { - if (virtTestCompareToFile(actualdm, dmcmdline) < 0) + if (virTestCompareToFile(actualdm, dmcmdline) < 0) goto out; } diff --git a/tests/cputest.c b/tests/cputest.c index 0890985..c0e26be 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -168,7 +168,7 @@ cpuTestCompareXML(const char *arch, if (!(actual = virCPUDefFormat(cpu, NULL, updateCPU))) goto cleanup; - if (virtTestCompareToFile(actual, xml) < 0) + if (virTestCompareToFile(actual, xml) < 0) goto cleanup; ret = 0; diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 3f5ed52..708208a 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -217,7 +217,7 @@ test_virDomainCapsFormat(const void *opaque) if (!(domCapsXML = virDomainCapsFormat(domCaps))) goto cleanup; - if (virtTestCompareToFile(domCapsXML, path) < 0) + if (virTestCompareToFile(domCapsXML, path) < 0) goto cleanup; ret = 0; diff --git a/tests/lxcconf2xmltest.c b/tests/lxcconf2xmltest.c index 7873210..d87ab34 100644 --- a/tests/lxcconf2xmltest.c +++ b/tests/lxcconf2xmltest.c @@ -45,7 +45,7 @@ testCompareXMLToConfigFiles(const char *xmlfile, if (!(actualxml = virDomainDefFormat(vmdef, caps, 0))) goto fail; - if (virtTestCompareToFile(actualxml, xmlfile) < 0) + if (virTestCompareToFile(actualxml, xmlfile) < 0) goto fail; } diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index 79853e4..b635dc5 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -45,7 +45,7 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, dnsmasqCapsPtr dctx, caps) < 0) goto fail; - if (virtTestCompareToFile(actual, outconf) < 0) + if (virTestCompareToFile(actual, outconf) < 0) goto fail; ret = 0; diff --git a/tests/networkxml2firewalltest.c b/tests/networkxml2firewalltest.c index 15e6bbe..aeabcd7 100644 --- a/tests/networkxml2firewalltest.c +++ b/tests/networkxml2firewalltest.c @@ -68,7 +68,7 @@ static int testCompareXMLToArgvFiles(const char *xml, virtTestClearCommandPath(actualargv); virCommandSetDryRun(NULL, NULL, NULL); - if (virtTestCompareToFile(actualargv, cmdline) < 0) + if (virTestCompareToFile(actualargv, cmdline) < 0) goto cleanup; ret = 0; diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index ac9d4be..13368d6 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -47,7 +47,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml, if (expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_FORMAT) goto cleanup; - if (virtTestCompareToFile(actual, outxml) < 0) { + if (virTestCompareToFile(actual, outxml) < 0) { result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_COMPARE; goto cleanup; } diff --git a/tests/networkxml2xmlupdatetest.c b/tests/networkxml2xmlupdatetest.c index 440d950..25bd706 100644 --- a/tests/networkxml2xmlupdatetest.c +++ b/tests/networkxml2xmlupdatetest.c @@ -41,7 +41,7 @@ testCompareXMLToXMLFiles(const char *netxml, const char *updatexml, goto fail; if (!expectFailure) { - if (virtTestCompareToFile(actual, outxml) < 0) + if (virTestCompareToFile(actual, outxml) < 0) goto error; } diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index bfce0bd..9eab2f6 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -60,7 +60,7 @@ linuxTestCompareFiles(char *sysfs_prefix, nodeinfo.cores, nodeinfo.threads) < 0) goto fail; - if (virtTestCompareToFile(actualData, outputfile) < 0) + if (virTestCompareToFile(actualData, outputfile) < 0) goto fail; ret = 0; @@ -137,7 +137,7 @@ linuxCPUStatsCompareFiles(const char *cpustatfile, goto fail; } - if (virtTestCompareToFile(actualData, outfile) < 0) + if (virTestCompareToFile(actualData, outfile) < 0) goto fail; ret = 0; diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewalltest.c index 33d8c83..294831b 100644 --- a/tests/nwfilterxml2firewalltest.c +++ b/tests/nwfilterxml2firewalltest.c @@ -405,7 +405,7 @@ static int testCompareXMLToArgvFiles(const char *xml, testRemoveCommonRules(actualargv); - if (virtTestCompareToFile(actualargv, cmdline) < 0) + if (virTestCompareToFile(actualargv, cmdline) < 0) goto cleanup; ret = 0; diff --git a/tests/nwfilterxml2xmltest.c b/tests/nwfilterxml2xmltest.c index b395bb0..4f581cc 100644 --- a/tests/nwfilterxml2xmltest.c +++ b/tests/nwfilterxml2xmltest.c @@ -40,7 +40,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml, if (!(actual = virNWFilterDefFormat(dev))) goto fail; - if (virtTestCompareToFile(actual, outxml) < 0) + if (virTestCompareToFile(actual, outxml) < 0) goto fail; done: diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index f1629bc..de9ec5d 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -103,7 +103,7 @@ static int testCompareXMLToArgvFiles(const char *xmlfile, if (!(actualxml = virDomainDefFormat(vmdef, driver.caps, 0))) goto fail; - if (virtTestCompareToFile(actualxml, xmlfile) < 0) + if (virTestCompareToFile(actualxml, xmlfile) < 0) goto fail; ret = 0; diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index cbad284..2a94ec7 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -118,7 +118,7 @@ testQemuCaps(const void *opaque) if (!(actual = virQEMUCapsFormatCache(capsActual, 0, 0))) goto cleanup; - if (virtTestCompareToFile(actual, capsFile) < 0) + if (virTestCompareToFile(actual, capsFile) < 0) goto cleanup; ret = 0; diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 5f634d1..1b1ff7c 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -145,7 +145,7 @@ testQemuCapsXML(const void *opaque) if (!capsXml) goto cleanup; - if (virtTestCompareToFile(capsXml, xmlFile) < 0) + if (virTestCompareToFile(capsXml, xmlFile) < 0) goto cleanup; ret = 0; diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index e929cb2..bb63386 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2189,7 +2189,7 @@ testQemuMonitorJSONGetCPUData(const void *opaque) if (!(actual = cpuDataFormat(cpuData))) goto cleanup; - if (virtTestCompareToFile(actual, dataFile) < 0) + if (virTestCompareToFile(actual, dataFile) < 0) goto cleanup; ret = 0; diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1cfbe1a..e045959 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -340,7 +340,7 @@ static int testCompareXMLToArgvFiles(const char *xml, if (!(actualargv = virCommandToString(cmd))) goto out; - if (virtTestCompareToFile(actualargv, cmdline) < 0) + if (virTestCompareToFile(actualargv, cmdline) < 0) goto out; ret = 0; diff --git a/tests/secretxml2xmltest.c b/tests/secretxml2xmltest.c index 16c0f79..51924e5 100644 --- a/tests/secretxml2xmltest.c +++ b/tests/secretxml2xmltest.c @@ -21,7 +21,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml) if (!(actual = virSecretDefFormat(secret))) goto fail; - if (virtTestCompareToFile(actual, outxml) < 0) + if (virTestCompareToFile(actual, outxml) < 0) goto fail; ret = 0; diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index e3698fb..e5c2e09 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -65,7 +65,7 @@ testCompareFiles(const char *xml, const char *sexpr) if (!(gotxml = virDomainDefFormat(def, caps, 0))) goto fail; - if (virtTestCompareToFile(gotxml, xml) < 0) + if (virTestCompareToFile(gotxml, xml) < 0) goto fail; ret = 0; diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index 6501e32..75022b1 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -29,7 +29,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml) if (!(actual = virStoragePoolDefFormat(dev))) goto fail; - if (virtTestCompareToFile(actual, outxml) < 0) + if (virTestCompareToFile(actual, outxml) < 0) goto fail; ret = 0; diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index b44df09..eef195f 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -95,7 +95,7 @@ testCompareXMLToArgvFiles(bool shouldFail, if (!(actualCmdline = virCommandToString(cmd))) goto cleanup; - if (virtTestCompareToFile(actualCmdline, cmdline) < 0) + if (virTestCompareToFile(actualCmdline, cmdline) < 0) goto cleanup; ret = 0; diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c index 580b70a..1d54e0a 100644 --- a/tests/storagevolxml2xmltest.c +++ b/tests/storagevolxml2xmltest.c @@ -34,7 +34,7 @@ testCompareXMLToXMLFiles(const char *poolxml, const char *inxml, if (!(actual = virStorageVolDefFormat(pool, dev))) goto fail; - if (virtTestCompareToFile(actual, outxml) < 0) + if (virTestCompareToFile(actual, outxml) < 0) goto fail; ret = 0; diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index 596f61f..457c341 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -79,7 +79,7 @@ testSysinfo(const void *data) if (!(sysfsActualData = virBufferCurrentContent(&buf))) goto cleanup; - if (virtTestCompareToFile(sysfsActualData, testdata->expected) < 0) + if (virTestCompareToFile(sysfsActualData, testdata->expected) < 0) goto cleanup; result = 0; diff --git a/tests/testutils.c b/tests/testutils.c index 1b081a5..5de14ef 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -686,7 +686,7 @@ int virtTestDifferenceBin(FILE *stream, * @param filename: File to compare strcontent against */ int -virtTestCompareToFile(const char *strcontent, +virTestCompareToFile(const char *strcontent, const char *filename) { int ret = -1; @@ -1138,7 +1138,7 @@ testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt, goto out; } - if (virtTestCompareToFile(actual, outfile) < 0) { + if (virTestCompareToFile(actual, outfile) < 0) { result = TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_COMPARE; goto out; } diff --git a/tests/testutils.h b/tests/testutils.h index 1a094b3..c5e312f 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -73,7 +73,7 @@ int virtTestDifferenceBin(FILE *stream, const char *expect, const char *actual, size_t length); -int virtTestCompareToFile(const char *strcontent, +int virTestCompareToFile(const char *strcontent, const char *filename); unsigned int virTestGetDebug(void); diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c index 16c26e6..2362d30 100644 --- a/tests/vircaps2xmltest.c +++ b/tests/vircaps2xmltest.c @@ -120,7 +120,7 @@ test_virCapabilitiesFormat(const void *opaque) abs_srcdir, data->filename) < 0) goto cleanup; - if (virtTestCompareToFile(capsXML, path) < 0) + if (virTestCompareToFile(capsXML, path) < 0) goto cleanup; ret = 0; diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index aa3f448..a7ab358 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -190,7 +190,7 @@ testCgroupDetectMounts(const void *args) goto cleanup; actual = virBufferCurrentContent(&buf); - if (virtTestCompareToFile(actual, parsed) < 0) + if (virTestCompareToFile(actual, parsed) < 0) goto cleanup; result = 0; diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index 0a75b49..4b38a3d 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -258,7 +258,7 @@ static int testExecRestart(const void *opaque) if (!(outjsonstr = virJSONValueToString(outjson, true))) goto cleanup; - if (virtTestCompareToFile(outjsonstr, outfile) < 0) + if (virTestCompareToFile(outjsonstr, outfile) < 0) goto cleanup; ret = 0; diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index e45f153..4cb939c 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -90,7 +90,7 @@ testCompareFiles(const char *vmx, const char *xml) VIR_DOMAIN_DEF_FORMAT_SECURE))) goto cleanup; - if (virtTestCompareToFile(formatted, xml) < 0) + if (virTestCompareToFile(formatted, xml) < 0) goto cleanup; ret = 0; diff --git a/tests/xencapstest.c b/tests/xencapstest.c index 87dc8de..1ed89a2 100644 --- a/tests/xencapstest.c +++ b/tests/xencapstest.c @@ -45,7 +45,7 @@ testCompareFiles(virArch hostmachine, const char *xml_rel, if (!(actualxml = virCapabilitiesFormatXML(caps))) goto fail; - if (virtTestCompareToFile(actualxml, xml) < 0) + if (virTestCompareToFile(actualxml, xml) < 0) goto fail; ret = 0; diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c index 95d47c4..a1b81ee 100644 --- a/tests/xlconfigtest.c +++ b/tests/xlconfigtest.c @@ -79,7 +79,7 @@ testCompareParseXML(const char *xlcfg, const char *xml) goto fail; gotxlcfgData[wrote] = '\0'; - if (virtTestCompareToFile(gotxlcfgData, xlcfg) < 0) + if (virTestCompareToFile(gotxlcfgData, xlcfg) < 0) goto fail; ret = 0; @@ -124,7 +124,7 @@ testCompareFormatXML(const char *xlcfg, const char *xml) VIR_DOMAIN_XML_SECURE))) goto fail; - if (virtTestCompareToFile(gotxml, xml) < 0) + if (virTestCompareToFile(gotxml, xml) < 0) goto fail; ret = 0; diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index d4b6b87..1f6dee6 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -79,7 +79,7 @@ testCompareParseXML(const char *xmcfg, const char *xml) goto fail; gotxmcfgData[wrote] = '\0'; - if (virtTestCompareToFile(gotxmcfgData, xmcfg) < 0) + if (virTestCompareToFile(gotxmcfgData, xmcfg) < 0) goto fail; ret = 0; @@ -124,7 +124,7 @@ testCompareFormatXML(const char *xmcfg, const char *xml) if (!(gotxml = virDomainDefFormat(def, caps, VIR_DOMAIN_DEF_FORMAT_SECURE))) goto fail; - if (virtTestCompareToFile(gotxml, xml) < 0) + if (virTestCompareToFile(gotxml, xml) < 0) goto fail; ret = 0; diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c index e937419..fa9612d 100644 --- a/tests/xml2sexprtest.c +++ b/tests/xml2sexprtest.c @@ -39,7 +39,7 @@ testCompareFiles(const char *xml, const char *sexpr) if (!(gotsexpr = xenFormatSxpr(NULL, def))) goto fail; - if (virtTestCompareToFile(gotsexpr, sexpr) < 0) + if (virTestCompareToFile(gotsexpr, sexpr) < 0) goto fail; ret = 0; diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c index e2e1749..61c78ac 100644 --- a/tests/xml2vmxtest.c +++ b/tests/xml2vmxtest.c @@ -91,7 +91,7 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version) if (formatted == NULL) goto failure; - if (virtTestCompareToFile(formatted, vmx) < 0) + if (virTestCompareToFile(formatted, vmx) < 0) goto failure; result = 0; -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/domainsnapshotxml2xmltest.c | 2 +- tests/interfacexml2xmltest.c | 2 +- tests/nodedevxml2xmltest.c | 2 +- tests/qemuhotplugtest.c | 2 +- tests/testutils.c | 8 ++++---- tests/testutils.h | 36 ++++++++++++++++++------------------ tests/virfiletest.c | 2 +- tests/viruritest.c | 6 +++--- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c index 8e53b31..7428762 100644 --- a/tests/domainsnapshotxml2xmltest.c +++ b/tests/domainsnapshotxml2xmltest.c @@ -114,7 +114,7 @@ testCompareXMLToXMLFiles(const char *inxml, } if (STRNEQ(outXmlData, actual)) { - virtTestDifferenceFull(stderr, outXmlData, outxml, actual, inxml); + virTestDifferenceFull(stderr, outXmlData, outxml, actual, inxml); goto cleanup; } diff --git a/tests/interfacexml2xmltest.c b/tests/interfacexml2xmltest.c index f817f00..084d47b 100644 --- a/tests/interfacexml2xmltest.c +++ b/tests/interfacexml2xmltest.c @@ -34,7 +34,7 @@ testCompareXMLToXMLFiles(const char *xml) goto fail; if (STRNEQ(xmlData, actual)) { - virtTestDifferenceFull(stderr, xmlData, xml, actual, NULL); + virTestDifferenceFull(stderr, xmlData, xml, actual, NULL); goto fail; } diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c index 42dfa66..745995e 100644 --- a/tests/nodedevxml2xmltest.c +++ b/tests/nodedevxml2xmltest.c @@ -34,7 +34,7 @@ testCompareXMLToXMLFiles(const char *xml) goto fail; if (STRNEQ(xmlData, actual)) { - virtTestDifferenceFull(stderr, xmlData, xml, actual, NULL); + virTestDifferenceFull(stderr, xmlData, xml, actual, NULL); goto fail; } diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 68279d0..54a0a4a 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -192,7 +192,7 @@ testQemuHotplugCheckResult(virDomainObjPtr vm, ret = 0; } else { if (!fail) - virtTestDifferenceFull(stderr, + virTestDifferenceFull(stderr, expected, expectedFile, actual, NULL); ret = -1; diff --git a/tests/testutils.c b/tests/testutils.c index 5de14ef..e0fc209 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -565,7 +565,7 @@ virtTestDifferenceFullInternal(FILE *stream, * regenerate the expected file. */ int -virtTestDifferenceFull(FILE *stream, +virTestDifferenceFull(FILE *stream, const char *expect, const char *expectName, const char *actual, @@ -705,7 +705,7 @@ virTestCompareToFile(const char *strcontent, if (STRNEQ_NULLABLE(fixedcontent ? fixedcontent : strcontent, filecontent)) { - virtTestDifferenceFull(stderr, + virTestDifferenceFull(stderr, filecontent, filename, strcontent, NULL); goto failure; @@ -758,7 +758,7 @@ virtTestLogOutput(virLogSourcePtr source ATTRIBUTE_UNUSED, } static void -virtTestLogClose(void *data) +virTestLogClose(void *data) { struct virtTestLogData *log = data; @@ -892,7 +892,7 @@ int virtTestMain(int argc, virLogSetFromEnv(); if (!getenv("LIBVIRT_DEBUG") && !virLogGetNbOutputs()) { - if (virLogDefineOutput(virtTestLogOutput, virtTestLogClose, &testLog, + if (virLogDefineOutput(virtTestLogOutput, virTestLogClose, &testLog, VIR_LOG_DEBUG, VIR_LOG_TO_STDERR, NULL, 0) < 0) return EXIT_FAILURE; } diff --git a/tests/testutils.h b/tests/testutils.h index c5e312f..d23e3ae 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -59,7 +59,7 @@ void virtTestClearCommandPath(char *cmdset); int virTestDifference(FILE *stream, const char *expect, const char *actual); -int virtTestDifferenceFull(FILE *stream, +int virTestDifferenceFull(FILE *stream, const char *expect, const char *expectName, const char *actual, @@ -111,24 +111,24 @@ int virtTestMain(int argc, return virtTestMain(argc, argv, func, NULL); \ } -# define VIRT_TEST_PRELOAD(lib) \ - do { \ - const char *preload = getenv("LD_PRELOAD"); \ - if (preload == NULL || strstr(preload, lib) == NULL) { \ - char *newenv; \ - if (!virFileIsExecutable(lib)) { \ - perror(lib); \ - return EXIT_FAILURE; \ - } \ - if (!preload) { \ - newenv = (char *) lib; \ +# define VIRT_TEST_PRELOAD(lib) \ + do { \ + const char *preload = getenv("LD_PRELOAD"); \ + if (preload == NULL || strstr(preload, lib) == NULL) { \ + char *newenv; \ + if (!virFileIsExecutable(lib)) { \ + perror(lib); \ + return EXIT_FAILURE; \ + } \ + if (!preload) { \ + newenv = (char *) lib; \ } else if (virAsprintf(&newenv, "%s:%s", lib, preload) < 0) { \ - perror("virAsprintf"); \ - return EXIT_FAILURE; \ - } \ - setenv("LD_PRELOAD", newenv, 1); \ - execv(argv[0], argv); \ - } \ + perror("virAsprintf"); \ + return EXIT_FAILURE; \ + } \ + setenv("LD_PRELOAD", newenv, 1); \ + execv(argv[0], argv); \ + } \ } while (0) # define VIRT_TEST_MAIN_PRELOAD(func, ...) \ diff --git a/tests/virfiletest.c b/tests/virfiletest.c index b99a55c..a28fdba 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -160,7 +160,7 @@ mymain(void) do { \ data1.path = PATH; \ data1.expect = EXPECT; \ - if (virTestRun(virtTestCounterNext(), testFileSanitizePath, \ + if (virTestRun(virtTestCounterNext(), testFileSanitizePath, \ &data1) < 0) \ ret = -1; \ } while (0) diff --git a/tests/viruritest.c b/tests/viruritest.c index 0d392ee..e857c09 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -156,9 +156,9 @@ mymain(void) } while (0) #define TEST_PARSE(uri, scheme, server, port, path, query, fragment, user, params) \ TEST_FULL(uri, NULL, scheme, server, port, path, query, fragment, user, params) -#define TEST_PARAMS(query_in, query_out, params) \ - TEST_FULL("test://example.com/?" query_in, \ - *query_out ? "test://example.com/?" query_out : NULL, \ +#define TEST_PARAMS(query_in, query_out, params) \ + TEST_FULL("test://example.com/?" query_in, \ + *query_out ? "test://example.com/?" query_out : NULL, \ "test", "example.com", 0, "/", query_in, NULL, NULL, params) virURIParam params[] = { -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/networkxml2firewalltest.c | 2 +- tests/nwfilterebiptablestest.c | 14 +++++++------- tests/nwfilterxml2firewalltest.c | 2 +- tests/testutils.c | 2 +- tests/testutils.h | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/networkxml2firewalltest.c b/tests/networkxml2firewalltest.c index aeabcd7..97cff66 100644 --- a/tests/networkxml2firewalltest.c +++ b/tests/networkxml2firewalltest.c @@ -65,7 +65,7 @@ static int testCompareXMLToArgvFiles(const char *xml, goto cleanup; actualargv = virBufferContentAndReset(&buf); - virtTestClearCommandPath(actualargv); + virTestClearCommandPath(actualargv); virCommandSetDryRun(NULL, NULL, NULL); if (virTestCompareToFile(actualargv, cmdline) < 0) diff --git a/tests/nwfilterebiptablestest.c b/tests/nwfilterebiptablestest.c index e6b9dd7..656d97c 100644 --- a/tests/nwfilterebiptablestest.c +++ b/tests/nwfilterebiptablestest.c @@ -113,7 +113,7 @@ testNWFilterEBIPTablesAllTeardown(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; actual = virBufferContentAndReset(&buf); - virtTestClearCommandPath(actual); + virTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { virTestDifference(stderr, expected, actual); @@ -184,7 +184,7 @@ testNWFilterEBIPTablesTearOldRules(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; actual = virBufferContentAndReset(&buf); - virtTestClearCommandPath(actual); + virTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { virTestDifference(stderr, expected, actual); @@ -233,7 +233,7 @@ testNWFilterEBIPTablesRemoveBasicRules(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; actual = virBufferContentAndReset(&buf); - virtTestClearCommandPath(actual); + virTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { virTestDifference(stderr, expected, actual); @@ -267,7 +267,7 @@ testNWFilterEBIPTablesTearNewRules(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; actual = virBufferContentAndReset(&buf); - virtTestClearCommandPath(actual); + virTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { virTestDifference(stderr, expected, actual); @@ -339,7 +339,7 @@ testNWFilterEBIPTablesApplyBasicRules(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; actual = virBufferContentAndReset(&buf); - virtTestClearCommandPath(actual); + virTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { virTestDifference(stderr, expected, actual); @@ -429,7 +429,7 @@ testNWFilterEBIPTablesApplyDHCPOnlyRules(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; actual = virBufferContentAndReset(&buf); - virtTestClearCommandPath(actual); + virTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { virTestDifference(stderr, expected, actual); @@ -502,7 +502,7 @@ testNWFilterEBIPTablesApplyDropAllRules(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; actual = virBufferContentAndReset(&buf); - virtTestClearCommandPath(actual); + virTestClearCommandPath(actual); if (STRNEQ_NULLABLE(actual, expected)) { virTestDifference(stderr, expected, actual); diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewalltest.c index 294831b..08867ef 100644 --- a/tests/nwfilterxml2firewalltest.c +++ b/tests/nwfilterxml2firewalltest.c @@ -400,7 +400,7 @@ static int testCompareXMLToArgvFiles(const char *xml, goto cleanup; actualargv = virBufferContentAndReset(&buf); - virtTestClearCommandPath(actualargv); + virTestClearCommandPath(actualargv); virCommandSetDryRun(NULL, NULL, NULL); testRemoveCommonRules(actualargv); diff --git a/tests/testutils.c b/tests/testutils.c index e0fc209..04145be 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -1008,7 +1008,7 @@ int virtTestMain(int argc, * iptables --table filter --insert FORWARD --out-interface virbr0 --jump REJECT * iptables --table filter --insert FORWARD --in-interface virbr0 --out-interface virbr0 --jump ACCEPT" */ -void virtTestClearCommandPath(char *cmdset) +void virTestClearCommandPath(char *cmdset) { size_t offset = 0; char *lineStart = cmdset; diff --git a/tests/testutils.h b/tests/testutils.h index d23e3ae..a16b4dd 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -54,7 +54,7 @@ int virTestRun(const char *title, int virTestLoadFile(const char *file, char **buf); int virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen); -void virtTestClearCommandPath(char *cmdset); +void virTestClearCommandPath(char *cmdset); int virTestDifference(FILE *stream, const char *expect, -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/qemuargv2xmltest.c | 2 +- tests/qemuxml2argvtest.c | 2 +- tests/testutils.c | 2 +- tests/testutils.h | 2 +- tests/virfirewalltest.c | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index de9ec5d..c614e9f 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -69,7 +69,7 @@ static int testCompareXMLToArgvFiles(const char *xmlfile, cmd, NULL, NULL, NULL))) goto fail; - if (!virtTestOOMActive()) { + if (!virTestOOMActive()) { if ((log = virtTestLogContentAndReset()) == NULL) goto fail; if (flags & FLAG_EXPECT_WARNING) { diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index e045959..e4edb83 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -351,7 +351,7 @@ static int testCompareXMLToArgvFiles(const char *xml, VIR_TEST_DEBUG("Error expected but there wasn't any.\n"); goto out; } - if (!virtTestOOMActive()) { + if (!virTestOOMActive()) { if (flags & FLAG_EXPECT_FAILURE) { if ((log = virtTestLogContentAndReset())) VIR_TEST_DEBUG("Got expected error: \n%s", log); diff --git a/tests/testutils.c b/tests/testutils.c index 04145be..592e0e0 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -84,7 +84,7 @@ static size_t testEnd; char *progname; -bool virtTestOOMActive(void) +bool virTestOOMActive(void) { return testOOMActive; } diff --git a/tests/testutils.h b/tests/testutils.h index a16b4dd..b60c21f 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -46,7 +46,7 @@ extern char *progname; # error Fix Makefile.am # endif -bool virtTestOOMActive(void); +bool virTestOOMActive(void); int virTestRun(const char *title, int (*body)(const void *data), diff --git a/tests/virfirewalltest.c b/tests/virfirewalltest.c index 338f714..6f4fed5 100644 --- a/tests/virfirewalltest.c +++ b/tests/virfirewalltest.c @@ -611,7 +611,7 @@ testFirewallNoRollback(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; } - if (virtTestOOMActive()) + if (virTestOOMActive()) goto cleanup; if (virBufferError(&cmdbuf)) @@ -701,7 +701,7 @@ testFirewallSingleRollback(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; } - if (virtTestOOMActive()) + if (virTestOOMActive()) goto cleanup; if (virBufferError(&cmdbuf)) @@ -794,7 +794,7 @@ testFirewallManyRollback(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; } - if (virtTestOOMActive()) + if (virTestOOMActive()) goto cleanup; if (virBufferError(&cmdbuf)) @@ -917,7 +917,7 @@ testFirewallChainedRollback(const void *opaque ATTRIBUTE_UNUSED) goto cleanup; } - if (virtTestOOMActive()) + if (virTestOOMActive()) goto cleanup; if (virBufferError(&cmdbuf)) -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/qemucommandutiltest.c | 2 +- tests/testutils.c | 6 +++--- tests/testutils.h | 2 +- tests/virbitmaptest.c | 2 +- tests/virfiletest.c | 2 +- tests/virstoragetest.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/qemucommandutiltest.c b/tests/qemucommandutiltest.c index 4eba3f4..1eb0b00 100644 --- a/tests/qemucommandutiltest.c +++ b/tests/qemucommandutiltest.c @@ -81,7 +81,7 @@ mymain(void) return EXIT_AM_SKIP; #endif - virtTestCounterReset("testQemuCommandBuildObjectFromJSON"); + virTestCounterReset("testQemuCommandBuildObjectFromJSON"); #define DO_TEST_COMMAND_OBJECT_FROM_JSON(PROPS, EXPECT) \ do { \ diff --git a/tests/testutils.c b/tests/testutils.c index 592e0e0..cb4382a 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -1170,7 +1170,7 @@ static char *virtTestCounterPrefixEndOffset; /** - * virtTestCounterReset: + * virTestCounterReset: * @prefix: name of the test group * * Resets the counter and sets up the test group name to use with @@ -1180,7 +1180,7 @@ static char *virtTestCounterPrefixEndOffset; * case names (including the number index) will be silently truncated. */ void -virtTestCounterReset(const char *prefix) +virTestCounterReset(const char *prefix) { virtTestCounter = 0; @@ -1196,7 +1196,7 @@ virtTestCounterReset(const char *prefix) * a way to do automagic test case numbering. * * Returns string consisting of test name prefix configured via - * virtTestCounterReset() and a number that increments in every call of this + * virTestCounterReset() and a number that increments in every call of this * function. This function is not thread safe. * * Note: The buffer for the assembled message is 128 bytes long. Longer test diff --git a/tests/testutils.h b/tests/testutils.h index b60c21f..2e3fada 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -97,7 +97,7 @@ char *virtTestLogContentAndReset(void); void virtTestQuiesceLibvirtErrors(bool always); -void virtTestCounterReset(const char *prefix); +void virTestCounterReset(const char *prefix); const char *virtTestCounterNext(void); int virtTestMain(int argc, diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index a59065b..eb2385f 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -675,7 +675,7 @@ mymain(void) if (virTestRun("test10", test10, NULL) < 0) ret = -1; - virtTestCounterReset("test11-"); + virTestCounterReset("test11-"); TESTBINARYOP("0", "0", "0,^0", test11); TESTBINARYOP("0-3", "0", "1-3", test11); TESTBINARYOP("0-3", "0,3", "1-2", test11); diff --git a/tests/virfiletest.c b/tests/virfiletest.c index a28fdba..01029de 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -167,7 +167,7 @@ mymain(void) #define DO_TEST_SANITIZE_PATH_SAME(PATH) DO_TEST_SANITIZE_PATH(PATH, PATH) - virtTestCounterReset("testFileSanitizePath "); + virTestCounterReset("testFileSanitizePath "); DO_TEST_SANITIZE_PATH("", ""); DO_TEST_SANITIZE_PATH("/", "/"); DO_TEST_SANITIZE_PATH("/path", "/path"); diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 38445c8..3dd0aa7 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -708,7 +708,7 @@ mymain(void) } while (0) /* The actual tests, in several groups. */ - virtTestCounterReset("Storage backing chain "); + virTestCounterReset("Storage backing chain "); /* Missing file */ TEST_ONE_CHAIN("bogus", VIR_STORAGE_FILE_RAW, EXP_FAIL); -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/cputest.c | 4 ++-- tests/qemuargv2xmltest.c | 2 +- tests/qemuxml2argvtest.c | 4 ++-- tests/testutils.c | 2 +- tests/testutils.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index c0e26be..010846c 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -476,13 +476,13 @@ cpuTestRun(const char *name, const struct data *data) if (virAsprintf(&label, "CPU %s(%s): %s", apis[data->api], data->arch, name) < 0) return -1; - tmp = virtTestLogContentAndReset(); + tmp = virTestLogContentAndReset(); VIR_FREE(tmp); if (virTestRun(label, cpuTest[data->api], data) < 0) { if (virTestGetDebug()) { char *log; - if ((log = virtTestLogContentAndReset()) && + if ((log = virTestLogContentAndReset()) && strlen(log) > 0) VIR_TEST_DEBUG("\n%s\n", log); VIR_FREE(log); diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index c614e9f..1d95eda 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -70,7 +70,7 @@ static int testCompareXMLToArgvFiles(const char *xmlfile, goto fail; if (!virTestOOMActive()) { - if ((log = virtTestLogContentAndReset()) == NULL) + if ((log = virTestLogContentAndReset()) == NULL) goto fail; if (flags & FLAG_EXPECT_WARNING) { if (*log) { diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index e4edb83..1ee664b 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -310,7 +310,7 @@ static int testCompareXMLToArgvFiles(const char *xml, virQEMUCapsFilterByMachineType(extraFlags, vm->def->os.machine); - log = virtTestLogContentAndReset(); + log = virTestLogContentAndReset(); VIR_FREE(log); virResetLastError(); @@ -353,7 +353,7 @@ static int testCompareXMLToArgvFiles(const char *xml, } if (!virTestOOMActive()) { if (flags & FLAG_EXPECT_FAILURE) { - if ((log = virtTestLogContentAndReset())) + if ((log = virTestLogContentAndReset())) VIR_TEST_DEBUG("Got expected error: \n%s", log); } virResetLastError(); diff --git a/tests/testutils.c b/tests/testutils.c index cb4382a..40ac8ef 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -768,7 +768,7 @@ virTestLogClose(void *data) /* Return a malloc'd string (possibly with strlen of 0) of all data * logged since the last call to this function, or NULL on failure. */ char * -virtTestLogContentAndReset(void) +virTestLogContentAndReset(void) { char *ret; diff --git a/tests/testutils.h b/tests/testutils.h index 2e3fada..265a0a9 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -93,7 +93,7 @@ unsigned int virTestGetRegenerate(void); fprintf(stderr, __VA_ARGS__); \ } while (0) -char *virtTestLogContentAndReset(void); +char *virTestLogContentAndReset(void); void virtTestQuiesceLibvirtErrors(bool always); -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/testutils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index 40ac8ef..03369ab 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -89,7 +89,7 @@ bool virTestOOMActive(void) return testOOMActive; } -static int virtTestUseTerminalColors(void) +static int virTestUseTerminalColors(void) { return isatty(STDIN_FILENO); } @@ -187,17 +187,17 @@ virTestRun(const char *title, if (virTestGetVerbose()) { if (ret == 0) - if (virtTestUseTerminalColors()) + if (virTestUseTerminalColors()) fprintf(stderr, "\e[32mOK\e[0m\n"); /* green */ else fprintf(stderr, "OK\n"); else if (ret == EXIT_AM_SKIP) - if (virtTestUseTerminalColors()) + if (virTestUseTerminalColors()) fprintf(stderr, "\e[34m\e[1mSKIP\e[0m\n"); /* bold blue */ else fprintf(stderr, "SKIP\n"); else - if (virtTestUseTerminalColors()) + if (virTestUseTerminalColors()) fprintf(stderr, "\e[31m\e[1mFAILED\e[0m\n"); /* bold red */ else fprintf(stderr, "FAILED\n"); -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/esxutilstest.c | 2 +- tests/metadatatest.c | 2 +- tests/objecteventtest.c | 2 +- tests/sockettest.c | 2 +- tests/testutils.c | 2 +- tests/testutils.h | 2 +- tests/utiltest.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/esxutilstest.c b/tests/esxutilstest.c index 3e2ef6f..44dce3b 100644 --- a/tests/esxutilstest.c +++ b/tests/esxutilstest.c @@ -245,7 +245,7 @@ mymain(void) { int result = 0; - virtTestQuiesceLibvirtErrors(true); + virTestQuiesceLibvirtErrors(true); # define DO_TEST(_name) \ do { \ diff --git a/tests/metadatatest.c b/tests/metadatatest.c index acaf7a7..d8f2c9e 100644 --- a/tests/metadatatest.c +++ b/tests/metadatatest.c @@ -279,7 +279,7 @@ mymain(void) return EXIT_FAILURE; } - virtTestQuiesceLibvirtErrors(false); + virTestQuiesceLibvirtErrors(false); if (virTestRun("Assign metadata ", testAssignMetadata, &test) < 0) ret = EXIT_FAILURE; diff --git a/tests/objecteventtest.c b/tests/objecteventtest.c index 1c200e8..a2fa365 100644 --- a/tests/objecteventtest.c +++ b/tests/objecteventtest.c @@ -546,7 +546,7 @@ mymain(void) if (!(test.conn = virConnectOpen("test:///default"))) return EXIT_FAILURE; - virtTestQuiesceLibvirtErrors(false); + virTestQuiesceLibvirtErrors(false); /* Domain event tests */ if (virTestRun("Domain createXML start event (old API)", diff --git a/tests/sockettest.c b/tests/sockettest.c index 6db5a5d..d3ff735 100644 --- a/tests/sockettest.c +++ b/tests/sockettest.c @@ -272,7 +272,7 @@ mymain(void) * register a handler to stop error messages cluttering * up display */ - virtTestQuiesceLibvirtErrors(false); + virTestQuiesceLibvirtErrors(false); #define DO_TEST_PARSE_AND_FORMAT(addrstr, family, pass) \ do { \ diff --git a/tests/testutils.c b/tests/testutils.c index 03369ab..e5e6a62 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -726,7 +726,7 @@ virtTestErrorFuncQuiet(void *data ATTRIBUTE_UNUSED, /* register an error handler in tests when using connections */ void -virtTestQuiesceLibvirtErrors(bool always) +virTestQuiesceLibvirtErrors(bool always) { if (always || !virTestGetVerbose()) virSetErrorFunc(NULL, virtTestErrorFuncQuiet); diff --git a/tests/testutils.h b/tests/testutils.h index 265a0a9..1df964e 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -95,7 +95,7 @@ unsigned int virTestGetRegenerate(void); char *virTestLogContentAndReset(void); -void virtTestQuiesceLibvirtErrors(bool always); +void virTestQuiesceLibvirtErrors(bool always); void virTestCounterReset(const char *prefix); const char *virtTestCounterNext(void); diff --git a/tests/utiltest.c b/tests/utiltest.c index 5d7b915..10bc40b 100644 --- a/tests/utiltest.c +++ b/tests/utiltest.c @@ -263,7 +263,7 @@ mymain(void) { int result = 0; - virtTestQuiesceLibvirtErrors(true); + virTestQuiesceLibvirtErrors(true); #define DO_TEST(_name) \ do { \ -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/qemuxml2xmltest.c | 2 +- tests/testutils.c | 4 ++-- tests/testutils.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 7b01587..6bbf402 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -159,7 +159,7 @@ testCompareStatusXMLToXMLFiles(const void *opaque) if (STRNEQ(actual, expect)) { /* For status test we don't want to regenerate output to not * add the status data.*/ - virtTestDifferenceFullNoRegenerate(stderr, + virTestDifferenceFullNoRegenerate(stderr, expect, data->outActiveName, actual, data->inName); goto cleanup; diff --git a/tests/testutils.c b/tests/testutils.c index e5e6a62..9ebd94a 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -588,7 +588,7 @@ virTestDifferenceFull(FILE *stream, * regenerate the expected file. */ int -virtTestDifferenceFullNoRegenerate(FILE *stream, +virTestDifferenceFullNoRegenerate(FILE *stream, const char *expect, const char *expectName, const char *actual, @@ -611,7 +611,7 @@ virTestDifference(FILE *stream, const char *expect, const char *actual) { - return virtTestDifferenceFullNoRegenerate(stream, + return virTestDifferenceFullNoRegenerate(stream, expect, NULL, actual, NULL); } diff --git a/tests/testutils.h b/tests/testutils.h index 1df964e..422270f 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -64,7 +64,7 @@ int virTestDifferenceFull(FILE *stream, const char *expectName, const char *actual, const char *actualName); -int virtTestDifferenceFullNoRegenerate(FILE *stream, +int virTestDifferenceFullNoRegenerate(FILE *stream, const char *expect, const char *expectName, const char *actual, -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/testutils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index 9ebd94a..2f27bde 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -476,7 +476,7 @@ virTestRewrapFile(const char *filename) * non-NULL. */ static int -virtTestDifferenceFullInternal(FILE *stream, +virTestDifferenceFullInternal(FILE *stream, const char *expect, const char *expectName, const char *actual, @@ -571,7 +571,7 @@ virTestDifferenceFull(FILE *stream, const char *actual, const char *actualName) { - return virtTestDifferenceFullInternal(stream, expect, expectName, + return virTestDifferenceFullInternal(stream, expect, expectName, actual, actualName, true); } @@ -594,7 +594,7 @@ virTestDifferenceFullNoRegenerate(FILE *stream, const char *actual, const char *actualName) { - return virtTestDifferenceFullInternal(stream, expect, expectName, + return virTestDifferenceFullInternal(stream, expect, expectName, actual, actualName, false); } -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/testutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index 2f27bde..f56ab09 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -351,7 +351,7 @@ virTestLoadFile(const char *file, char **buf) #ifndef WIN32 static -void virtTestCaptureProgramExecChild(const char *const argv[], +void virTestCaptureProgramExecChild(const char *const argv[], int pipefd) { size_t i; @@ -408,7 +408,7 @@ virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen) switch (pid) { case 0: VIR_FORCE_CLOSE(pipefd[0]); - virtTestCaptureProgramExecChild(argv, pipefd[1]); + virTestCaptureProgramExecChild(argv, pipefd[1]); VIR_FORCE_CLOSE(pipefd[1]); _exit(EXIT_FAILURE); -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/testutils.c | 2 +- tests/testutils.h | 2 +- tests/virnetmessagetest.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index f56ab09..7244a52 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -625,7 +625,7 @@ virTestDifference(FILE *stream, * Display expected and actual output text, trimmed to * first and last characters at which differences occur */ -int virtTestDifferenceBin(FILE *stream, +int virTestDifferenceBin(FILE *stream, const char *expect, const char *actual, size_t length) diff --git a/tests/testutils.h b/tests/testutils.h index 422270f..2e67600 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -69,7 +69,7 @@ int virTestDifferenceFullNoRegenerate(FILE *stream, const char *expectName, const char *actual, const char *actualName); -int virtTestDifferenceBin(FILE *stream, +int virTestDifferenceBin(FILE *stream, const char *expect, const char *actual, size_t length); diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c index bed92bb..8189031 100644 --- a/tests/virnetmessagetest.c +++ b/tests/virnetmessagetest.c @@ -77,7 +77,7 @@ static int testMessageHeaderEncode(const void *args ATTRIBUTE_UNUSED) } if (memcmp(expect, msg->buffer, sizeof(expect)) != 0) { - virtTestDifferenceBin(stderr, expect, msg->buffer, sizeof(expect)); + virTestDifferenceBin(stderr, expect, msg->buffer, sizeof(expect)); goto cleanup; } @@ -269,7 +269,7 @@ static int testMessagePayloadEncode(const void *args ATTRIBUTE_UNUSED) } if (memcmp(expect, msg->buffer, sizeof(expect)) != 0) { - virtTestDifferenceBin(stderr, expect, msg->buffer, sizeof(expect)); + virTestDifferenceBin(stderr, expect, msg->buffer, sizeof(expect)); goto cleanup; } @@ -511,7 +511,7 @@ static int testMessagePayloadStreamEncode(const void *args ATTRIBUTE_UNUSED) } if (memcmp(expect, msg->buffer, sizeof(expect)) != 0) { - virtTestDifferenceBin(stderr, expect, msg->buffer, sizeof(expect)); + virTestDifferenceBin(stderr, expect, msg->buffer, sizeof(expect)); goto cleanup; } -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/testutils.c | 4 ++-- tests/testutils.h | 2 +- tests/virshtest.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index 7244a52..f0a4dec 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -396,7 +396,7 @@ void virTestCaptureProgramExecChild(const char *const argv[], } int -virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen) +virTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen) { int pipefd[2]; int len; @@ -428,7 +428,7 @@ virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen) } #else /* !WIN32 */ int -virtTestCaptureProgramOutput(const char *const argv[] ATTRIBUTE_UNUSED, +virTestCaptureProgramOutput(const char *const argv[] ATTRIBUTE_UNUSED, char **buf ATTRIBUTE_UNUSED, int maxlen ATTRIBUTE_UNUSED) { diff --git a/tests/testutils.h b/tests/testutils.h index 2e67600..dca112e 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -52,7 +52,7 @@ int virTestRun(const char *title, int (*body)(const void *data), const void *data); int virTestLoadFile(const char *file, char **buf); -int virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen); +int virTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen); void virTestClearCommandPath(char *cmdset); diff --git a/tests/virshtest.c b/tests/virshtest.c index a0dcf10..a860341 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -65,7 +65,7 @@ testCompareOutputLit(const char *expectData, int result = -1; char *actualData = NULL; - if (virtTestCaptureProgramOutput(argv, &actualData, 4096) < 0) + if (virTestCaptureProgramOutput(argv, &actualData, 4096) < 0) goto cleanup; if (filter && testFilterLine(actualData, filter) < 0) -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/qemucommandutiltest.c | 2 +- tests/testutils.c | 6 +++--- tests/testutils.h | 2 +- tests/virbitmaptest.c | 2 +- tests/virfiletest.c | 2 +- tests/virstoragetest.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/qemucommandutiltest.c b/tests/qemucommandutiltest.c index 1eb0b00..aa87b4a 100644 --- a/tests/qemucommandutiltest.c +++ b/tests/qemucommandutiltest.c @@ -87,7 +87,7 @@ mymain(void) do { \ data1.props = PROPS; \ data1.expectprops = EXPECT; \ - if (virTestRun(virtTestCounterNext(), \ + if (virTestRun(virTestCounterNext(), \ testQemuCommandBuildObjectFromJSON, \ &data1) < 0) \ ret = -1; \ diff --git a/tests/testutils.c b/tests/testutils.c index f0a4dec..3454429 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -1174,7 +1174,7 @@ static char *virtTestCounterPrefixEndOffset; * @prefix: name of the test group * * Resets the counter and sets up the test group name to use with - * virtTestCounterNext(). This function is not thread safe. + * virTestCounterNext(). This function is not thread safe. * * Note: The buffer for the assembled message is 128 bytes long. Longer test * case names (including the number index) will be silently truncated. @@ -1190,7 +1190,7 @@ virTestCounterReset(const char *prefix) /** - * virtTestCounterNext: + * virTestCounterNext: * * This function is designed to ease test creation and reordering by adding * a way to do automagic test case numbering. @@ -1203,7 +1203,7 @@ virTestCounterReset(const char *prefix) * case names (including the number index) will be silently truncated. */ const char -*virtTestCounterNext(void) +*virTestCounterNext(void) { size_t len = ARRAY_CARDINALITY(virtTestCounterStr); diff --git a/tests/testutils.h b/tests/testutils.h index dca112e..7d9edcc 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -98,7 +98,7 @@ char *virTestLogContentAndReset(void); void virTestQuiesceLibvirtErrors(bool always); void virTestCounterReset(const char *prefix); -const char *virtTestCounterNext(void); +const char *virTestCounterNext(void); int virtTestMain(int argc, char **argv, diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index eb2385f..b21319a 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -645,7 +645,7 @@ test12(const void *opaque ATTRIBUTE_UNUSED) testBinaryOpData.a = A; \ testBinaryOpData.b = B; \ testBinaryOpData.res = RES; \ - if (virTestRun(virtTestCounterNext(), FUNC, &testBinaryOpData) < 0) \ + if (virTestRun(virTestCounterNext(), FUNC, &testBinaryOpData) < 0) \ ret = -1; static int diff --git a/tests/virfiletest.c b/tests/virfiletest.c index 01029de..1a6ff25 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -160,7 +160,7 @@ mymain(void) do { \ data1.path = PATH; \ data1.expect = EXPECT; \ - if (virTestRun(virtTestCounterNext(), testFileSanitizePath, \ + if (virTestRun(virTestCounterNext(), testFileSanitizePath, \ &data1) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 3dd0aa7..eb78464 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -693,7 +693,7 @@ mymain(void) for (i = 0; i < ARRAY_CARDINALITY(data.files); i++) \ if (data.files[i]) \ data.nfiles++; \ - if (virTestRun(virtTestCounterNext(), \ + if (virTestRun(virTestCounterNext(), \ testStorageChain, &data) < 0) \ ret = -1; \ } while (0) -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/testutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index 3454429..61e7a22 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -719,7 +719,7 @@ virTestCompareToFile(const char *strcontent, } static void -virtTestErrorFuncQuiet(void *data ATTRIBUTE_UNUSED, +virTestErrorFuncQuiet(void *data ATTRIBUTE_UNUSED, virErrorPtr err ATTRIBUTE_UNUSED) { } @@ -729,7 +729,7 @@ void virTestQuiesceLibvirtErrors(bool always) { if (always || !virTestGetVerbose()) - virSetErrorFunc(NULL, virtTestErrorFuncQuiet); + virSetErrorFunc(NULL, virTestErrorFuncQuiet); } struct virtTestLogData { -- 2.5.5

This function doesn't follow our convention of naming functions. --- tests/testutils.c | 2 +- tests/testutils.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index 61e7a22..b96fed6 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -841,7 +841,7 @@ virTestSetEnvPath(void) #define TEST_MOCK (abs_builddir "/.libs/virtestmock.so") -int virtTestMain(int argc, +int virTestMain(int argc, char **argv, int (*func)(void), ...) diff --git a/tests/testutils.h b/tests/testutils.h index 7d9edcc..3ef270d 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -100,7 +100,7 @@ void virTestQuiesceLibvirtErrors(bool always); void virTestCounterReset(const char *prefix); const char *virTestCounterNext(void); -int virtTestMain(int argc, +int virTestMain(int argc, char **argv, int (*func)(void), ...); @@ -108,7 +108,7 @@ int virtTestMain(int argc, /* Setup, then call func() */ # define VIRT_TEST_MAIN(func) \ int main(int argc, char **argv) { \ - return virtTestMain(argc, argv, func, NULL); \ + return virTestMain(argc, argv, func, NULL); \ } # define VIRT_TEST_PRELOAD(lib) \ @@ -133,7 +133,7 @@ int virtTestMain(int argc, # define VIRT_TEST_MAIN_PRELOAD(func, ...) \ int main(int argc, char **argv) { \ - return virtTestMain(argc, argv, func, __VA_ARGS__, NULL); \ + return virTestMain(argc, argv, func, __VA_ARGS__, NULL); \ } virCapsPtr virTestGenericCapsInit(void); -- 2.5.5
participants (2)
-
Pavel Hrdina
-
Tomáš Ryšavý