diff --git a/tests/commandtest.c b/tests/commandtest.c index eeb6d1e131..4780cf985f 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -1020,7 +1020,7 @@ mymain(void) # define DO_TEST(NAME) \ if (virtTestRun("Command Exec " #NAME " test", \ - 1, NAME, NULL) < 0) \ + NAME, NULL) < 0) \ ret = -1 DO_TEST(test0); diff --git a/tests/cputest.c b/tests/cputest.c index 408a510429..8e3640b291 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -472,7 +472,7 @@ cpuTestRun(const char *name, const struct data *data) tmp = virtTestLogContentAndReset(); VIR_FREE(tmp); - if (virtTestRun(label, 1, cpuTest[data->api], data) < 0) { + if (virtTestRun(label, cpuTest[data->api], data) < 0) { if (virTestGetDebug()) { char *log; if ((log = virtTestLogContentAndReset()) && diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c index defa9553e4..92251193bb 100644 --- a/tests/domainsnapshotxml2xmltest.c +++ b/tests/domainsnapshotxml2xmltest.c @@ -102,7 +102,7 @@ mymain(void) do { \ const struct testInfo info = {name, uuid, internal}; \ if (virtTestRun("SNAPSHOT XML-2-XML " name, \ - 1, testCompareXMLToXMLHelper, &info) < 0) \ + testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/esxutilstest.c b/tests/esxutilstest.c index a60c7ecad7..05763665b9 100644 --- a/tests/esxutilstest.c +++ b/tests/esxutilstest.c @@ -253,7 +253,7 @@ mymain(void) # define DO_TEST(_name) \ do { \ - if (virtTestRun("VMware "#_name, 1, test##_name, \ + if (virtTestRun("VMware "#_name, test##_name, \ NULL) < 0) { \ result = -1; \ } \ diff --git a/tests/fchosttest.c b/tests/fchosttest.c index 05ff20ba69..b5291f04ab 100644 --- a/tests/fchosttest.c +++ b/tests/fchosttest.c @@ -169,15 +169,15 @@ mymain(void) goto cleanup; } - if (virtTestRun("test1", 1, test1, NULL) < 0) + if (virtTestRun("test1", test1, NULL) < 0) ret = -1; - if (virtTestRun("test2", 1, test2, NULL) < 0) + if (virtTestRun("test2", test2, NULL) < 0) ret = -1; - if (virtTestRun("test3", 1, test3, NULL) < 0) + if (virtTestRun("test3", test3, NULL) < 0) ret = -1; - if (virtTestRun("test4", 1, test4, NULL) < 0) + if (virtTestRun("test4", test4, NULL) < 0) ret = -1; - if (virtTestRun("test5", 1, test5, NULL) < 0) + if (virtTestRun("test5", test5, NULL) < 0) ret = -1; cleanup: diff --git a/tests/fdstreamtest.c b/tests/fdstreamtest.c index 7bd6e230ec..0eeb8a57ec 100644 --- a/tests/fdstreamtest.c +++ b/tests/fdstreamtest.c @@ -328,13 +328,13 @@ mymain(void) abort(); } - if (virtTestRun("Stream read blocking ", 1, testFDStreamReadBlock, scratchdir) < 0) + if (virtTestRun("Stream read blocking ", testFDStreamReadBlock, scratchdir) < 0) ret = -1; - if (virtTestRun("Stream read non-blocking ", 1, testFDStreamReadNonblock, scratchdir) < 0) + if (virtTestRun("Stream read non-blocking ", testFDStreamReadNonblock, scratchdir) < 0) ret = -1; - if (virtTestRun("Stream write blocking ", 1, testFDStreamWriteBlock, scratchdir) < 0) + if (virtTestRun("Stream write blocking ", testFDStreamWriteBlock, scratchdir) < 0) ret = -1; - if (virtTestRun("Stream write non-blocking ", 1, testFDStreamWriteNonblock, scratchdir) < 0) + if (virtTestRun("Stream write non-blocking ", testFDStreamWriteNonblock, scratchdir) < 0) ret = -1; if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL) diff --git a/tests/interfacexml2xmltest.c b/tests/interfacexml2xmltest.c index 8092a5964a..13f9053881 100644 --- a/tests/interfacexml2xmltest.c +++ b/tests/interfacexml2xmltest.c @@ -69,9 +69,9 @@ mymain(void) { int ret = 0; -#define DO_TEST(name) \ - if (virtTestRun("Interface XML-2-XML " name, \ - 1, testCompareXMLToXMLHelper, (name)) < 0) \ +#define DO_TEST(name) \ + if (virtTestRun("Interface XML-2-XML " name, \ + testCompareXMLToXMLHelper, (name)) < 0) \ ret = -1 DO_TEST("ethernet-dhcp"); diff --git a/tests/jsontest.c b/tests/jsontest.c index 1d385d44b5..6add816bf0 100644 --- a/tests/jsontest.c +++ b/tests/jsontest.c @@ -138,7 +138,7 @@ mymain(void) #define DO_TEST_FULL(name, cmd, doc, expect, pass) \ do { \ struct testInfo info = { doc, expect, pass }; \ - if (virtTestRun(name, 1, testJSON ## cmd, &info) < 0) \ + if (virtTestRun(name, testJSON ## cmd, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/libvirtdconftest.c b/tests/libvirtdconftest.c index ba61a0fd34..fbc0f3feb9 100644 --- a/tests/libvirtdconftest.c +++ b/tests/libvirtdconftest.c @@ -223,7 +223,7 @@ mymain(void) VIR_DEBUG("Initial config [%s]", filedata); for (i = 0; params[i] != 0; i++) { const struct testCorruptData data = { params, filedata, filename, i }; - if (virtTestRun("Test corruption", 1, testCorrupt, &data) < 0) + if (virtTestRun("Test corruption", testCorrupt, &data) < 0) ret = -1; } diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c index aeb394085c..5846ab026d 100644 --- a/tests/lxcxml2xmltest.c +++ b/tests/lxcxml2xmltest.c @@ -117,8 +117,8 @@ mymain(void) # define DO_TEST_FULL(name, is_different, inactive) \ do { \ const struct testInfo info = {name, is_different, inactive}; \ - if (virtTestRun("LXC XML-2-XML " name, \ - 1, testCompareXMLToXMLHelper, &info) < 0) \ + if (virtTestRun("LXC XML-2-XML " name, \ + testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/metadatatest.c b/tests/metadatatest.c index 30c43ba7a8..0896c52163 100644 --- a/tests/metadatatest.c +++ b/tests/metadatatest.c @@ -231,11 +231,11 @@ mymain(void) virtTestQuiesceLibvirtErrors(false); - if (virtTestRun("Assign metadata ", 1, testAssignMetadata, &test) < 0) + if (virtTestRun("Assign metadata ", testAssignMetadata, &test) < 0) ret = EXIT_FAILURE; - if (virtTestRun("Rewrite Metadata ", 1, testRewriteMetadata, &test) < 0) + if (virtTestRun("Rewrite Metadata ", testRewriteMetadata, &test) < 0) ret = EXIT_FAILURE; - if (virtTestRun("Erase metadata ", 1, testEraseMetadata, &test) < 0) + if (virtTestRun("Erase metadata ", testEraseMetadata, &test) < 0) ret = EXIT_FAILURE; virDomainFree(test.dom); diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index ad50e881bc..d968568eac 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -130,7 +130,7 @@ mymain(void) info.name = xname; \ info.caps = xcaps; \ if (virtTestRun("Network XML-2-Conf " xname, \ - 1, testCompareXMLToConfHelper, &info) < 0) { \ + testCompareXMLToConfHelper, &info) < 0) { \ ret = -1; \ } \ } while (0) diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index c4fca0803d..0a92513351 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -90,7 +90,7 @@ mymain(void) do { \ const struct testInfo info = {name, flags}; \ if (virtTestRun("Network XML-2-XML " name, \ - 1, testCompareXMLToXMLHelper, &info) < 0) \ + testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) #define DO_TEST(name) DO_TEST_FULL(name, 0) diff --git a/tests/networkxml2xmlupdatetest.c b/tests/networkxml2xmlupdatetest.c index e5a17b2d99..6263dac2d7 100644 --- a/tests/networkxml2xmlupdatetest.c +++ b/tests/networkxml2xmlupdatetest.c @@ -130,7 +130,7 @@ mymain(void) command, section, flags, \ parentIndex, expectFailure}; \ if (virtTestRun("Network XML-2-XML " name, \ - 1, testCompareXMLToXMLHelper, &info) < 0) \ + testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c index d4f7ee7425..2ebdee133b 100644 --- a/tests/nodedevxml2xmltest.c +++ b/tests/nodedevxml2xmltest.c @@ -69,9 +69,9 @@ mymain(void) { int ret = 0; -#define DO_TEST(name) \ - if (virtTestRun("Node device XML-2-XML " name, \ - 1, testCompareXMLToXMLHelper, (name)) < 0) \ +#define DO_TEST(name) \ + if (virtTestRun("Node device XML-2-XML " name, \ + testCompareXMLToXMLHelper, (name)) < 0) \ ret = -1 DO_TEST("computer"); diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index db637cec14..74f6d4d2fb 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -142,7 +142,7 @@ mymain(void) return EXIT_FAILURE; for (i = 0; i < ARRAY_CARDINALITY(nodeData); i++) - if (virtTestRun(nodeData[i], 1, linuxTestNodeInfo, nodeData[i]) != 0) + if (virtTestRun(nodeData[i], linuxTestNodeInfo, nodeData[i]) != 0) ret = -1; return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/nwfilterxml2xmltest.c b/tests/nwfilterxml2xmltest.c index 14191a676a..8c510ca025 100644 --- a/tests/nwfilterxml2xmltest.c +++ b/tests/nwfilterxml2xmltest.c @@ -104,7 +104,7 @@ mymain(void) .expect_warning = EXPECT_WARN, \ }; \ if (virtTestRun("NWFilter XML-2-XML " NAME, \ - 1, testCompareXMLToXMLHelper, (&tp)) < 0) \ + testCompareXMLToXMLHelper, (&tp)) < 0) \ ret = -1; \ } while (0) diff --git a/tests/openvzutilstest.c b/tests/openvzutilstest.c index ee68c06ad9..3858b420ad 100644 --- a/tests/openvzutilstest.c +++ b/tests/openvzutilstest.c @@ -148,7 +148,7 @@ mymain(void) # define DO_TEST(_name) \ do { \ - if (virtTestRun("OpenVZ "#_name, 1, test##_name, \ + if (virtTestRun("OpenVZ "#_name, test##_name, \ NULL) < 0) { \ result = -1; \ } \ diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index 4e279814c5..7a49b0bc8b 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -594,8 +594,8 @@ mymain(void) virEventRegisterDefaultImpl(); -#define DO_TEST(name) \ - if (virtTestRun(# name, 1, testQemuAgent ## name, xmlopt) < 0) \ +#define DO_TEST(name) \ + if (virtTestRun(# name, testQemuAgent ## name, xmlopt) < 0) \ ret = -1 DO_TEST(FSFreeze); diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index 5cf7828986..6dd8bb0e10 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -126,11 +126,11 @@ mymain(void) if (!(driver.xmlopt = virQEMUDriverCreateXMLConf(&driver))) return EXIT_FAILURE; -# define DO_TEST_FULL(name, extraFlags, migrateFrom) \ +# define DO_TEST_FULL(name, extraFlags, migrateFrom) \ do { \ const struct testInfo info = { name, extraFlags, migrateFrom }; \ if (virtTestRun("QEMU ARGV-2-XML " name, \ - 1, testCompareXMLToArgvHelper, &info) < 0) \ + testCompareXMLToArgvHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 1620a7dd4e..9902fc5c05 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -229,7 +229,7 @@ mymain(void) #define DO_TEST(name) \ data.base = name; \ - if (virtTestRun(name, 1, testQemuCaps, &data) < 0) \ + if (virtTestRun(name, testQemuCaps, &data) < 0) \ ret = -1 DO_TEST("caps_1.2.2-1"); diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index a1cf568430..3628fbe2dc 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -141,7 +141,7 @@ mymain(void) return EXIT_FAILURE; \ virQEMUCapsSetList(info.flags, __VA_ARGS__, QEMU_CAPS_LAST); \ if (virtTestRun("QEMU Help String Parsing " name, \ - 1, testHelpStrParsing, &info) < 0) \ + testHelpStrParsing, &info) < 0) \ ret = -1; \ virObjectUnref(info.flags); \ } while (0) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 5148a21223..961dfc6a47 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -372,7 +372,7 @@ mymain(void) data.mon = my_mon; \ data.keep = kep; \ data.deviceDeletedEvent = event; \ - if (virtTestRun(name, 1, testQemuHotplug, &data) < 0) \ + if (virtTestRun(name, testQemuHotplug, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index cd83592ad6..6ef877ced5 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1760,14 +1760,14 @@ mymain(void) virEventRegisterDefaultImpl(); -#define DO_TEST(name) \ - if (virtTestRun(# name, 1, testQemuMonitorJSON ## name, xmlopt) < 0) \ +#define DO_TEST(name) \ + if (virtTestRun(# name, testQemuMonitorJSON ## name, xmlopt) < 0) \ ret = -1 -#define DO_TEST_SIMPLE(CMD, FNC, ...) \ +#define DO_TEST_SIMPLE(CMD, FNC, ...) \ simpleFunc = (testQemuMonitorJSONSimpleFuncData) {.cmd = CMD, .func = FNC, \ .xmlopt = xmlopt, __VA_ARGS__ }; \ - if (virtTestRun(# FNC, 1, testQemuMonitorJSONSimpleFunc, &simpleFunc) < 0) \ + if (virtTestRun(# FNC, testQemuMonitorJSONSimpleFunc, &simpleFunc) < 0) \ ret = -1 DO_TEST(GetStatus); diff --git a/tests/qemumonitortest.c b/tests/qemumonitortest.c index 3851251fe0..1c13a89f8b 100644 --- a/tests/qemumonitortest.c +++ b/tests/qemumonitortest.c @@ -93,7 +93,7 @@ mymain(void) # define DO_TEST(_name) \ do { \ - if (virtTestRun("qemu monitor "#_name, 1, test##_name, \ + if (virtTestRun("qemu monitor "#_name, test##_name, \ NULL) < 0) { \ result = -1; \ } \ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 38319e5a70..58165fda76 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -332,7 +332,7 @@ mymain(void) return EXIT_FAILURE; \ virQEMUCapsSetList(info.extraFlags, __VA_ARGS__, QEMU_CAPS_LAST);\ if (virtTestRun("QEMU XML-2-ARGV " name, \ - 1, testCompareXMLToArgvHelper, &info) < 0) \ + testCompareXMLToArgvHelper, &info) < 0) \ ret = -1; \ virObjectUnref(info.extraFlags); \ } while (0) diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 9fd3ada742..4e308b406b 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -120,7 +120,7 @@ mymain(void) do { \ const struct testInfo info = {name, is_different, when}; \ if (virtTestRun("QEMU XML-2-XML " name, \ - 1, testCompareXMLToXMLHelper, &info) < 0) \ + testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c index 9f4f442a70..2cc15d1500 100644 --- a/tests/qemuxmlnstest.c +++ b/tests/qemuxmlnstest.c @@ -225,7 +225,7 @@ mymain(void) return EXIT_FAILURE; \ virQEMUCapsSetList(info.extraFlags, __VA_ARGS__, QEMU_CAPS_LAST);\ if (virtTestRun("QEMU XML-2-ARGV " name, \ - 1, testCompareXMLToArgvHelper, &info) < 0) \ + testCompareXMLToArgvHelper, &info) < 0) \ ret = -1; \ virObjectUnref(info.extraFlags); \ } while (0) diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c index fa99f99ebd..d1fd92f8da 100644 --- a/tests/securityselinuxlabeltest.c +++ b/tests/securityselinuxlabeltest.c @@ -335,9 +335,9 @@ mymain(void) if (!(xmlopt = virQEMUDriverCreateXMLConf(NULL))) return EXIT_FAILURE; -#define DO_TEST_LABELING(name) \ - if (virtTestRun("Labelling " # name, 1, testSELinuxLabeling, name) < 0) \ - ret = -1; \ +#define DO_TEST_LABELING(name) \ + if (virtTestRun("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 e2806c1685..99b9b24807 100644 --- a/tests/securityselinuxtest.c +++ b/tests/securityselinuxtest.c @@ -291,7 +291,7 @@ mymain(void) user, role, imageRole, type, imageType, \ sensMin, sensMax, catMin, catMax \ }; \ - if (virtTestRun("GenLabel " # desc, 1, testSELinuxGenLabel, &data) < 0) \ + if (virtTestRun("GenLabel " # desc, testSELinuxGenLabel, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index b939319a8e..f8b0661364 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -123,7 +123,7 @@ mymain(void) struct testInfo info = { in, out, version }; \ virResetLastError(); \ if (virtTestRun("Xen SEXPR-2-XML " in " -> " out, \ - 1, testCompareHelper, &info) < 0) \ + testCompareHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/sockettest.c b/tests/sockettest.c index 6842ba40db..4b38cdf016 100644 --- a/tests/sockettest.c +++ b/tests/sockettest.c @@ -190,7 +190,7 @@ mymain(void) struct testParseData data = { &addr, addrstr, family, pass }; \ memset(&addr, 0, sizeof(addr)); \ if (virtTestRun("Test parse " addrstr, \ - 1, testParseHelper, &data) < 0) \ + testParseHelper, &data) < 0) \ ret = -1; \ } while (0) @@ -200,11 +200,11 @@ mymain(void) struct testParseData data = { &addr, addrstr, family, pass }; \ memset(&addr, 0, sizeof(addr)); \ if (virtTestRun("Test parse " addrstr " family " #family, \ - 1, testParseHelper, &data) < 0) \ + testParseHelper, &data) < 0) \ ret = -1; \ struct testFormatData data2 = { &addr, addrstr, pass }; \ if (virtTestRun("Test format " addrstr " family " #family, \ - 1, testFormatHelper, &data2) < 0) \ + testFormatHelper, &data2) < 0) \ ret = -1; \ } while (0) @@ -214,11 +214,11 @@ mymain(void) struct testParseData data = { &addr, addrstr, family, true}; \ memset(&addr, 0, sizeof(addr)); \ if (virtTestRun("Test parse " addrstr " family " #family, \ - 1, testParseHelper, &data) < 0) \ + testParseHelper, &data) < 0) \ ret = -1; \ struct testFormatData data2 = { &addr, addrformated, pass }; \ if (virtTestRun("Test format " addrstr " family " #family, \ - 1, testFormatHelper, &data2) < 0) \ + testFormatHelper, &data2) < 0) \ ret = -1; \ } while (0) @@ -226,7 +226,7 @@ mymain(void) do { \ struct testRangeData data = { saddr, eaddr, size, pass }; \ if (virtTestRun("Test range " saddr " -> " eaddr " size " #size, \ - 1, testRangeHelper, &data) < 0) \ + testRangeHelper, &data) < 0) \ ret = -1; \ } while (0) @@ -234,14 +234,14 @@ mymain(void) do { \ struct testNetmaskData data = { addr1, addr2, netmask, pass }; \ if (virtTestRun("Test netmask " addr1 " + " addr2 " in " netmask, \ - 1, testNetmaskHelper, &data) < 0) \ + testNetmaskHelper, &data) < 0) \ ret = -1; \ } while (0) #define DO_TEST_WILDCARD(addr, pass) \ do { \ struct testWildcardData data = { addr, pass}; \ - if (virtTestRun("Test wildcard " addr, 1, \ + if (virtTestRun("Test wildcard " addr, \ testWildcardHelper, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/statstest.c b/tests/statstest.c index 94ccd4f30a..441cedb0c6 100644 --- a/tests/statstest.c +++ b/tests/statstest.c @@ -67,7 +67,7 @@ mymain(void) do { \ struct testInfo info = { dev, num }; \ if (virtTestRun("Device " dev " -> " # num, \ - 1, testDeviceHelper, &info) < 0) \ + testDeviceHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index d59cff9746..0ae9b298f1 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -79,9 +79,9 @@ mymain(void) { int ret = 0; -#define DO_TEST(name) \ - if (virtTestRun("Storage Pool XML-2-XML " name, \ - 1, testCompareXMLToXMLHelper, (name)) < 0) \ +#define DO_TEST(name) \ + if (virtTestRun("Storage Pool XML-2-XML " name, \ + testCompareXMLToXMLHelper, (name)) < 0) \ ret = -1 DO_TEST("pool-dir"); diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index cafcaada51..ed9a520b01 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -212,7 +212,7 @@ mymain(void) struct testInfo info = { shouldFail, pool, vol, inputpool, inputvol, \ cmdline, flags, imgformat }; \ if (virtTestRun("Storage Vol XML-2-argv " cmdline, \ - 1, testCompareXMLToArgvHelper, &info) < 0) \ + testCompareXMLToArgvHelper, &info) < 0) \ ret = -1; \ } \ while (0); diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c index 5b0a60b640..1fd01f15c4 100644 --- a/tests/storagevolxml2xmltest.c +++ b/tests/storagevolxml2xmltest.c @@ -100,13 +100,13 @@ mymain(void) { int ret = 0; -#define DO_TEST(pool, name) \ - do { \ - struct testInfo info = { pool, name }; \ - if (virtTestRun("Storage Vol XML-2-XML " name, \ - 1, testCompareXMLToXMLHelper, &info) < 0) \ - ret = -1; \ - } \ +#define DO_TEST(pool, name) \ + do { \ + struct testInfo info = { pool, name }; \ + if (virtTestRun("Storage Vol XML-2-XML " name, \ + testCompareXMLToXMLHelper, &info) < 0) \ + ret = -1; \ + } \ while (0); DO_TEST("pool-dir", "vol-file"); diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index ba57a7a740..74c47005b8 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -117,7 +117,7 @@ sysinfotest_run(const char *test, goto error; } - if (virtTestRun(test, 1, testSysinfo, &testdata) < 0) + if (virtTestRun(test, testSysinfo, &testdata) < 0) goto error; ret = EXIT_SUCCESS; diff --git a/tests/testutils.c b/tests/testutils.c index da69d53ab7..5d634b4024 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -71,19 +71,6 @@ static size_t testEnd = 0; char *progname; char *abs_srcdir; -double -virtTestCountAverage(double *items, int nitems) -{ - long double sum = 0; - size_t i; - - for (i=1; i < nitems; i++) - sum += items[i]; - - return (double) (sum / nitems); -} - - void virtTestResult(const char *name, int ret, const char *msg, ...) { va_list vargs; @@ -123,16 +110,15 @@ void virtTestResult(const char *name, int ret, const char *msg, ...) } /* - * Runs test and count average time (if the nloops is grater than 1) + * Runs test * * returns: -1 = error, 0 = success */ int -virtTestRun(const char *title, int nloops, int (*body)(const void *data), const void *data) +virtTestRun(const char *title, + int (*body)(const void *data), const void *data) { int ret = 0; - size_t i; - double *ts = NULL; if (testCounter == 0 && !virTestGetVerbose()) fprintf(stderr, " "); @@ -149,37 +135,16 @@ virtTestRun(const char *title, int nloops, int (*body)(const void *data), const if (virTestGetVerbose()) fprintf(stderr, "%2zu) %-65s ... ", testCounter, title); - if (nloops > 1 && (VIR_ALLOC_N(ts, nloops) < 0)) - return -1; - - for (i=0; i < nloops; i++) { - struct timeval before, after; - - if (ts) - GETTIMEOFDAY(&before); - - virResetLastError(); - ret = body(data); - virErrorPtr err = virGetLastError(); - if (err) { - if (virTestGetVerbose() || virTestGetDebug()) - virDispatchError(NULL); - } - - if (ret != 0) { - break; - } - - if (ts) { - GETTIMEOFDAY(&after); - ts[i] = DIFF_MSEC(&after, &before); - } + virResetLastError(); + ret = body(data); + virErrorPtr err = virGetLastError(); + if (err) { + if (virTestGetVerbose() || virTestGetDebug()) + virDispatchError(NULL); } + if (virTestGetVerbose()) { - if (ret == 0 && ts) - fprintf(stderr, "OK [%.5f ms]\n", - virtTestCountAverage(ts, nloops)); - else if (ret == 0) + if (ret == 0) fprintf(stderr, "OK\n"); else if (ret == EXIT_AM_SKIP) fprintf(stderr, "SKIP\n"); @@ -199,7 +164,6 @@ virtTestRun(const char *title, int nloops, int (*body)(const void *data), const fprintf(stderr, "!"); } - VIR_FREE(ts); return ret; } diff --git a/tests/testutils.h b/tests/testutils.h index 2da6424236..478b53cfe4 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -40,13 +40,9 @@ extern char *progname; extern char *abs_srcdir; -double virtTestCountAverage(double *items, - int nitems); - void virtTestResult(const char *name, int ret, const char *msg, ...) ATTRIBUTE_FMT_PRINTF(3,4); int virtTestRun(const char *title, - int nloops, 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 422f4e8161..89e82aac79 100644 --- a/tests/utiltest.c +++ b/tests/utiltest.c @@ -152,9 +152,9 @@ mymain(void) virtTestQuiesceLibvirtErrors(true); -#define DO_TEST(_name) \ +#define DO_TEST(_name) \ do { \ - if (virtTestRun("Util "#_name, 1, test##_name, \ + if (virtTestRun("Util "#_name, test##_name, \ NULL) < 0) { \ result = -1; \ } \ diff --git a/tests/viratomictest.c b/tests/viratomictest.c index 40a05b84df..d092b95b15 100644 --- a/tests/viratomictest.c +++ b/tests/viratomictest.c @@ -167,9 +167,9 @@ mymain(void) if (virThreadInitialize() < 0) return -1; - if (virtTestRun("types", 1, testTypes, NULL) < 0) + if (virtTestRun("types", testTypes, NULL) < 0) ret = -1; - if (virtTestRun("threads", 1, testThreads, NULL) < 0) + if (virtTestRun("threads", testThreads, NULL) < 0) ret = -1; return ret; diff --git a/tests/virauthconfigtest.c b/tests/virauthconfigtest.c index a27bae5539..0bed9974f1 100644 --- a/tests/virauthconfigtest.c +++ b/tests/virauthconfigtest.c @@ -96,7 +96,7 @@ mymain(void) config, hostname, service, credname, expect \ }; \ if (virtTestRun("Test Lookup " hostname "-" service "-" credname, \ - 1, testAuthLookup, &data) < 0) \ + testAuthLookup, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index 7ec78fdad4..64fa769624 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -502,23 +502,23 @@ mymain(void) { int ret = 0; - if (virtTestRun("test1", 1, test1, NULL) < 0) + if (virtTestRun("test1", test1, NULL) < 0) ret = -1; - if (virtTestRun("test2", 1, test2, NULL) < 0) + if (virtTestRun("test2", test2, NULL) < 0) ret = -1; - if (virtTestRun("test3", 1, test3, NULL) < 0) + if (virtTestRun("test3", test3, NULL) < 0) ret = -1; - if (virtTestRun("test4", 1, test4, NULL) < 0) + if (virtTestRun("test4", test4, NULL) < 0) ret = -1; - if (virtTestRun("test5", 1, test5, NULL) < 0) + if (virtTestRun("test5", test5, NULL) < 0) ret = -1; - if (virtTestRun("test6", 1, test6, NULL) < 0) + if (virtTestRun("test6", test6, NULL) < 0) ret = -1; - if (virtTestRun("test7", 1, test7, NULL) < 0) + if (virtTestRun("test7", test7, NULL) < 0) ret = -1; - if (virtTestRun("test8", 1, test8, NULL) < 0) + if (virtTestRun("test8", test8, NULL) < 0) ret = -1; - if (virtTestRun("test9", 1, test9, NULL) < 0) + if (virtTestRun("test9", test9, NULL) < 0) ret = -1; return ret; diff --git a/tests/virbuftest.c b/tests/virbuftest.c index a6dcae6f52..1645e76e1b 100644 --- a/tests/virbuftest.c +++ b/tests/virbuftest.c @@ -210,7 +210,7 @@ mymain(void) #define DO_TEST(msg, cb, data) \ do { \ struct testInfo info = { data }; \ - if (virtTestRun("Buf: " msg, 1, cb, &info) < 0) \ + if (virtTestRun("Buf: " msg, cb, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index 570e0615c9..d5ed01692e 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -550,38 +550,38 @@ mymain(void) setenv("LIBVIRT_FAKE_SYSFS_DIR", fakesysfsdir, 1); - if (virtTestRun("New cgroup for self", 1, testCgroupNewForSelf, NULL) < 0) + if (virtTestRun("New cgroup for self", testCgroupNewForSelf, NULL) < 0) ret = -1; - if (virtTestRun("New cgroup for partition", 1, testCgroupNewForPartition, NULL) < 0) + if (virtTestRun("New cgroup for partition", testCgroupNewForPartition, NULL) < 0) ret = -1; - if (virtTestRun("New cgroup for partition nested", 1, testCgroupNewForPartitionNested, NULL) < 0) + if (virtTestRun("New cgroup for partition nested", testCgroupNewForPartitionNested, NULL) < 0) ret = -1; - if (virtTestRun("New cgroup for partition nested deeply", 1, testCgroupNewForPartitionNestedDeep, NULL) < 0) + if (virtTestRun("New cgroup for partition nested deeply", testCgroupNewForPartitionNestedDeep, NULL) < 0) ret = -1; - if (virtTestRun("New cgroup for domain partition", 1, testCgroupNewForPartitionDomain, NULL) < 0) + if (virtTestRun("New cgroup for domain partition", testCgroupNewForPartitionDomain, NULL) < 0) ret = -1; - if (virtTestRun("New cgroup for domain partition escaped", 1, testCgroupNewForPartitionDomainEscaped, NULL) < 0) + if (virtTestRun("New cgroup for domain partition escaped", testCgroupNewForPartitionDomainEscaped, NULL) < 0) ret = -1; - if (virtTestRun("Cgroup available", 1, testCgroupAvailable, (void*)0x1) < 0) + if (virtTestRun("Cgroup available", testCgroupAvailable, (void*)0x1) < 0) ret = -1; setenv("VIR_CGROUP_MOCK_MODE", "allinone", 1); - if (virtTestRun("New cgroup for self (allinone)", 1, testCgroupNewForSelfAllInOne, NULL) < 0) + if (virtTestRun("New cgroup for self (allinone)", testCgroupNewForSelfAllInOne, NULL) < 0) ret = -1; - if (virtTestRun("Cgroup available", 1, testCgroupAvailable, (void*)0x1) < 0) + if (virtTestRun("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)", 1, testCgroupNewForSelfLogind, NULL) < 0) + if (virtTestRun("New cgroup for self (logind)", testCgroupNewForSelfLogind, NULL) < 0) ret = -1; - if (virtTestRun("Cgroup available", 1, testCgroupAvailable, (void*)0x0) < 0) + if (virtTestRun("Cgroup available", testCgroupAvailable, (void*)0x0) < 0) ret = -1; unsetenv("VIR_CGROUP_MOCK_MODE"); diff --git a/tests/virdbustest.c b/tests/virdbustest.c index 083202c1b5..cd4edc742c 100644 --- a/tests/virdbustest.c +++ b/tests/virdbustest.c @@ -377,15 +377,15 @@ mymain(void) { int ret = 0; - if (virtTestRun("Test message simple ", 1, testMessageSimple, NULL) < 0) + if (virtTestRun("Test message simple ", testMessageSimple, NULL) < 0) ret = -1; - if (virtTestRun("Test message variant ", 1, testMessageVariant, NULL) < 0) + if (virtTestRun("Test message variant ", testMessageVariant, NULL) < 0) ret = -1; - if (virtTestRun("Test message array ", 1, testMessageArray, NULL) < 0) + if (virtTestRun("Test message array ", testMessageArray, NULL) < 0) ret = -1; - if (virtTestRun("Test message struct ", 1, testMessageStruct, NULL) < 0) + if (virtTestRun("Test message struct ", testMessageStruct, NULL) < 0) ret = -1; - if (virtTestRun("Test message dict ", 1, testMessageDict, NULL) < 0) + if (virtTestRun("Test message dict ", testMessageDict, NULL) < 0) ret = -1; return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/virdrivermoduletest.c b/tests/virdrivermoduletest.c index 1aae245af7..ba6e39d08f 100644 --- a/tests/virdrivermoduletest.c +++ b/tests/virdrivermoduletest.c @@ -59,7 +59,7 @@ mymain(void) #define TEST(name, dep1) \ do { \ const struct testDriverData data = { name, dep1 }; \ - if (virtTestRun("Test driver " # name, 1, testDriverModule, &data) < 0) \ + if (virtTestRun("Test driver " # name, testDriverModule, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virendiantest.c b/tests/virendiantest.c index 3dde89778f..4f672ce6f5 100644 --- a/tests/virendiantest.c +++ b/tests/virendiantest.c @@ -91,9 +91,9 @@ mymain(void) { int ret = 0; - if (virtTestRun("test1", 1, test1, NULL) < 0) + if (virtTestRun("test1", test1, NULL) < 0) ret = -1; - if (virtTestRun("test2", 1, test2, NULL) < 0) + if (virtTestRun("test2", test2, NULL) < 0) ret = -1; return ret; diff --git a/tests/virhashtest.c b/tests/virhashtest.c index dd2c948d11..51197813f0 100644 --- a/tests/virhashtest.c +++ b/tests/virhashtest.c @@ -668,7 +668,7 @@ mymain(void) #define DO_TEST_FULL(name, cmd, data, count) \ do { \ struct testInfo info = { data, count }; \ - if (virtTestRun(name, 1, testHash ## cmd, &info) < 0) \ + if (virtTestRun(name, testHash ## cmd, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/viridentitytest.c b/tests/viridentitytest.c index 269a57d137..814db4f4d2 100644 --- a/tests/viridentitytest.c +++ b/tests/viridentitytest.c @@ -164,9 +164,9 @@ mymain(void) { int ret = 0; - if (virtTestRun("Identity attributes ", 1, testIdentityAttrs, NULL) < 0) + if (virtTestRun("Identity attributes ", testIdentityAttrs, NULL) < 0) ret = -1; - if (virtTestRun("Identity equality ", 1, testIdentityEqual, NULL) < 0) + if (virtTestRun("Identity equality ", testIdentityEqual, NULL) < 0) ret = -1; return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virkeycodetest.c b/tests/virkeycodetest.c index 53f9d48a35..5d1a87b4ff 100644 --- a/tests/virkeycodetest.c +++ b/tests/virkeycodetest.c @@ -96,9 +96,9 @@ mymain(void) { int ret = 0; - if (virtTestRun("Keycode mapping ", 1, testKeycodeMapping, NULL) < 0) + if (virtTestRun("Keycode mapping ", testKeycodeMapping, NULL) < 0) ret = -1; - if (virtTestRun("Keycode strings ", 1, testKeycodeStrings, NULL) < 0) + if (virtTestRun("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 8fe7e38f39..1570ad6cf9 100644 --- a/tests/virkeyfiletest.c +++ b/tests/virkeyfiletest.c @@ -113,7 +113,7 @@ mymain(void) signal(SIGPIPE, SIG_IGN); - if (virtTestRun("Test parse", 1, testParse, NULL) < 0) + if (virtTestRun("Test parse", testParse, NULL) < 0) ret = -1; return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c index 1985a4ac16..78094ef389 100644 --- a/tests/virlockspacetest.c +++ b/tests/virlockspacetest.c @@ -345,25 +345,25 @@ mymain(void) signal(SIGPIPE, SIG_IGN); - if (virtTestRun("Lockspace creation", 1, testLockSpaceCreate, NULL) < 0) + if (virtTestRun("Lockspace creation", testLockSpaceCreate, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res lifecycle", 1, testLockSpaceResourceLifecycle, NULL) < 0) + if (virtTestRun("Lockspace res lifecycle", testLockSpaceResourceLifecycle, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res lock excl", 1, testLockSpaceResourceLockExcl, NULL) < 0) + if (virtTestRun("Lockspace res lock excl", testLockSpaceResourceLockExcl, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res lock shr", 1, testLockSpaceResourceLockShr, NULL) < 0) + if (virtTestRun("Lockspace res lock shr", testLockSpaceResourceLockShr, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res lock excl auto", 1, testLockSpaceResourceLockExclAuto, NULL) < 0) + if (virtTestRun("Lockspace res lock excl auto", testLockSpaceResourceLockExclAuto, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res lock shr auto", 1, testLockSpaceResourceLockShrAuto, NULL) < 0) + if (virtTestRun("Lockspace res lock shr auto", testLockSpaceResourceLockShrAuto, NULL) < 0) ret = -1; - if (virtTestRun("Lockspace res full path", 1, testLockSpaceResourceLockPath, NULL) < 0) + if (virtTestRun("Lockspace res full path", testLockSpaceResourceLockPath, NULL) < 0) ret = -1; return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c index eabc609501..ad619de6c2 100644 --- a/tests/virnetmessagetest.c +++ b/tests/virnetmessagetest.c @@ -527,19 +527,19 @@ mymain(void) signal(SIGPIPE, SIG_IGN); - if (virtTestRun("Message Header Encode", 1, testMessageHeaderEncode, NULL) < 0) + if (virtTestRun("Message Header Encode", testMessageHeaderEncode, NULL) < 0) ret = -1; - if (virtTestRun("Message Header Decode", 1, testMessageHeaderDecode, NULL) < 0) + if (virtTestRun("Message Header Decode", testMessageHeaderDecode, NULL) < 0) ret = -1; - if (virtTestRun("Message Payload Encode", 1, testMessagePayloadEncode, NULL) < 0) + if (virtTestRun("Message Payload Encode", testMessagePayloadEncode, NULL) < 0) ret = -1; - if (virtTestRun("Message Payload Decode", 1, testMessagePayloadDecode, NULL) < 0) + if (virtTestRun("Message Payload Decode", testMessagePayloadDecode, NULL) < 0) ret = -1; - if (virtTestRun("Message Payload Stream Encode", 1, testMessagePayloadStreamEncode, NULL) < 0) + if (virtTestRun("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 eb5803f007..9c4b4c6cfb 100644 --- a/tests/virnetserverclienttest.c +++ b/tests/virnetserverclienttest.c @@ -143,7 +143,7 @@ mymain(void) int ret = 0; - if (virtTestRun("Identity", 1, + if (virtTestRun("Identity", testIdentity, NULL) < 0) ret = -1; diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 5b434ba9e8..b3e12f9b53 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -471,35 +471,35 @@ mymain(void) if (hasIPv4) { struct testTCPData tcpData = { "127.0.0.1", freePort, "127.0.0.1" }; - if (virtTestRun("Socket TCP/IPv4 Accept", 1, testSocketTCPAccept, &tcpData) < 0) + if (virtTestRun("Socket TCP/IPv4 Accept", testSocketTCPAccept, &tcpData) < 0) ret = -1; } if (hasIPv6) { struct testTCPData tcpData = { "::1", freePort, "::1" }; - if (virtTestRun("Socket TCP/IPv6 Accept", 1, testSocketTCPAccept, &tcpData) < 0) + if (virtTestRun("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", 1, testSocketTCPAccept, &tcpData) < 0) + if (virtTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0) ret = -1; tcpData.cnode = "::1"; - if (virtTestRun("Socket TCP/IPv4+IPv6 Accept", 1, testSocketTCPAccept, &tcpData) < 0) + if (virtTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0) ret = -1; } #endif #ifndef WIN32 - if (virtTestRun("Socket UNIX Accept", 1, testSocketUNIXAccept, NULL) < 0) + if (virtTestRun("Socket UNIX Accept", testSocketUNIXAccept, NULL) < 0) ret = -1; - if (virtTestRun("Socket UNIX Addrs", 1, testSocketUNIXAddrs, NULL) < 0) + if (virtTestRun("Socket UNIX Addrs", testSocketUNIXAddrs, NULL) < 0) ret = -1; - if (virtTestRun("Socket External Command /dev/zero", 1, testSocketCommandNormal, NULL) < 0) + if (virtTestRun("Socket External Command /dev/zero", testSocketCommandNormal, NULL) < 0) ret = -1; - if (virtTestRun("Socket External Command /dev/does-not-exist", 1, testSocketCommandFail, NULL) < 0) + if (virtTestRun("Socket External Command /dev/does-not-exist", testSocketCommandFail, NULL) < 0) ret = -1; struct testSSHData sshData1 = { @@ -512,7 +512,7 @@ mymain(void) "fi;" "'nc' $ARG -U /tmp/socket'\n", }; - if (virtTestRun("SSH test 1", 1, testSocketSSH, &sshData1) < 0) + if (virtTestRun("SSH test 1", testSocketSSH, &sshData1) < 0) ret = -1; struct testSSHData sshData2 = { @@ -531,7 +531,7 @@ mymain(void) "fi;" "'netcat' $ARG -U /tmp/socket'\n", }; - if (virtTestRun("SSH test 2", 1, testSocketSSH, &sshData2) < 0) + if (virtTestRun("SSH test 2", testSocketSSH, &sshData2) < 0) ret = -1; struct testSSHData sshData3 = { @@ -550,7 +550,7 @@ mymain(void) "fi;" "'netcat' $ARG -U /tmp/socket'\n", }; - if (virtTestRun("SSH test 3", 1, testSocketSSH, &sshData3) < 0) + if (virtTestRun("SSH test 3", testSocketSSH, &sshData3) < 0) ret = -1; struct testSSHData sshData4 = { @@ -558,7 +558,7 @@ mymain(void) .path = "/tmp/socket", .failConnect = true, }; - if (virtTestRun("SSH test 4", 1, testSocketSSH, &sshData4) < 0) + if (virtTestRun("SSH test 4", testSocketSSH, &sshData4) < 0) ret = -1; struct testSSHData sshData5 = { @@ -573,7 +573,7 @@ mymain(void) "'nc' $ARG -U /tmp/socket'\n", .dieEarly = true, }; - if (virtTestRun("SSH test 5", 1, testSocketSSH, &sshData5) < 0) + if (virtTestRun("SSH test 5", testSocketSSH, &sshData5) < 0) ret = -1; struct testSSHData sshData6 = { @@ -589,7 +589,7 @@ mymain(void) "fi;" "'nc' $ARG -U /tmp/socket'\n", }; - if (virtTestRun("SSH test 6", 1, testSocketSSH, &sshData6) < 0) + if (virtTestRun("SSH test 6", testSocketSSH, &sshData6) < 0) ret = -1; struct testSSHData sshData7 = { @@ -603,7 +603,7 @@ mymain(void) "fi;" "''nc -4'' $ARG -U /tmp/socket'\n", }; - if (virtTestRun("SSH test 7", 1, testSocketSSH, &sshData7) < 0) + if (virtTestRun("SSH test 7", testSocketSSH, &sshData7) < 0) ret = -1; #endif diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index 33f239c7d9..fc512fccb9 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -120,7 +120,7 @@ mymain(void) data.cacrt = _caCrt; \ data.crt = _crt; \ data.expectFail = _expectFail; \ - if (virtTestRun("TLS Context " #_caCrt " + " #_crt, 1, \ + if (virtTestRun("TLS Context " #_caCrt " + " #_crt, \ testTLSContextInit, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c index f5f72129dc..6d77d35f22 100644 --- a/tests/virnettlssessiontest.c +++ b/tests/virnettlssessiontest.c @@ -253,7 +253,7 @@ mymain(void) data.hostname = _hostname; \ data.wildcards = _wildcards; \ if (virtTestRun("TLS Session " #_serverCrt " + " #_clientCrt, \ - 1, testTLSSessionInit, &data) < 0) \ + testTLSSessionInit, &data) < 0) \ ret = -1; \ } while (0) @@ -271,7 +271,7 @@ mymain(void) data.hostname = _hostname; \ data.wildcards = _wildcards; \ if (virtTestRun("TLS Session " #_serverCrt " + " #_clientCrt, \ - 1, testTLSSessionInit, &data) < 0) \ + testTLSSessionInit, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c index 615fa15d05..4d0518a8b8 100644 --- a/tests/virportallocatortest.c +++ b/tests/virportallocatortest.c @@ -191,10 +191,10 @@ mymain(void) { int ret = 0; - if (virtTestRun("Test alloc all", 1, testAllocAll, NULL) < 0) + if (virtTestRun("Test alloc all", testAllocAll, NULL) < 0) ret = -1; - if (virtTestRun("Test alloc reuse", 1, testAllocReuse, NULL) < 0) + if (virtTestRun("Test alloc reuse", testAllocReuse, NULL) < 0) ret = -1; return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virshtest.c b/tests/virshtest.c index fe255d390c..8367248883 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -241,77 +241,77 @@ mymain(void) return EXIT_FAILURE; if (virtTestRun("virsh list (default)", - 1, testCompareListDefault, NULL) != 0) + testCompareListDefault, NULL) != 0) ret = -1; if (virtTestRun("virsh list (custom)", - 1, testCompareListCustom, NULL) != 0) + testCompareListCustom, NULL) != 0) ret = -1; if (virtTestRun("virsh nodeinfo (default)", - 1, testCompareNodeinfoDefault, NULL) != 0) + testCompareNodeinfoDefault, NULL) != 0) ret = -1; if (virtTestRun("virsh nodeinfo (custom)", - 1, testCompareNodeinfoCustom, NULL) != 0) + testCompareNodeinfoCustom, NULL) != 0) ret = -1; if (virtTestRun("virsh dominfo (by id)", - 1, testCompareDominfoByID, NULL) != 0) + testCompareDominfoByID, NULL) != 0) ret = -1; if (virtTestRun("virsh dominfo (by uuid)", - 1, testCompareDominfoByUUID, NULL) != 0) + testCompareDominfoByUUID, NULL) != 0) ret = -1; if (virtTestRun("virsh dominfo (by name)", - 1, testCompareDominfoByName, NULL) != 0) + testCompareDominfoByName, NULL) != 0) ret = -1; if (virtTestRun("virsh domid (by name)", - 1, testCompareDomidByName, NULL) != 0) + testCompareDomidByName, NULL) != 0) ret = -1; if (virtTestRun("virsh domid (by uuid)", - 1, testCompareDomidByUUID, NULL) != 0) + testCompareDomidByUUID, NULL) != 0) ret = -1; if (virtTestRun("virsh domuuid (by id)", - 1, testCompareDomuuidByID, NULL) != 0) + testCompareDomuuidByID, NULL) != 0) ret = -1; if (virtTestRun("virsh domuuid (by name)", - 1, testCompareDomuuidByName, NULL) != 0) + testCompareDomuuidByName, NULL) != 0) ret = -1; if (virtTestRun("virsh domname (by id)", - 1, testCompareDomnameByID, NULL) != 0) + testCompareDomnameByID, NULL) != 0) ret = -1; if (virtTestRun("virsh domname (by uuid)", - 1, testCompareDomnameByUUID, NULL) != 0) + testCompareDomnameByUUID, NULL) != 0) ret = -1; if (virtTestRun("virsh domstate (by id)", - 1, testCompareDomstateByID, NULL) != 0) + testCompareDomstateByID, NULL) != 0) ret = -1; if (virtTestRun("virsh domstate (by uuid)", - 1, testCompareDomstateByUUID, NULL) != 0) + testCompareDomstateByUUID, NULL) != 0) ret = -1; if (virtTestRun("virsh domstate (by name)", - 1, testCompareDomstateByName, NULL) != 0) + testCompareDomstateByName, NULL) != 0) ret = -1; /* It's a bit awkward listing result before argument, but that's a * limitation of C99 vararg macros. */ -# define DO_TEST(i, result, ...) \ +# define DO_TEST(i, result, ...) \ do { \ const char *myargv[] = { VIRSH_DEFAULT, __VA_ARGS__, NULL }; \ const struct testInfo info = { myargv, result }; \ if (virtTestRun("virsh echo " #i, \ - 1, testCompareEcho, &info) < 0) \ + testCompareEcho, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index a3c59efaae..e5c73f5d29 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -311,7 +311,7 @@ mymain(void) struct testChainData data = { \ start, format, chain, ARRAY_CARDINALITY(chain), flags, \ }; \ - if (virtTestRun("Storage backing chain " id, 1, \ + if (virtTestRun("Storage backing chain " id, \ testStorageChain, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virstringtest.c b/tests/virstringtest.c index 30803d45cb..32a1e72c9a 100644 --- a/tests/virstringtest.c +++ b/tests/virstringtest.c @@ -249,9 +249,9 @@ mymain(void) .delim = del, \ .tokens = toks, \ }; \ - if (virtTestRun("Split " #str, 1, testSplit, &splitData) < 0) \ + if (virtTestRun("Split " #str, testSplit, &splitData) < 0) \ ret = -1; \ - if (virtTestRun("Join " #str, 1, testJoin, &joinData) < 0) \ + if (virtTestRun("Join " #str, testJoin, &joinData) < 0) \ ret = -1; \ } while (0) @@ -276,10 +276,10 @@ mymain(void) const char *tokens7[] = { "The", "quick", "brown", "fox", "", NULL }; TEST_SPLIT("The quick brown fox ", " ", 0, tokens7); - if (virtTestRun("strdup", 1, testStrdup, NULL) < 0) + if (virtTestRun("strdup", testStrdup, NULL) < 0) ret = -1; - if (virtTestRun("strdup", 1, testStrndupNegative, NULL) < 0) + if (virtTestRun("strdup", testStrndupNegative, NULL) < 0) ret = -1; return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c index e6efebf3a8..9f6fc839cc 100644 --- a/tests/virsystemdtest.c +++ b/tests/virsystemdtest.c @@ -206,17 +206,17 @@ mymain(void) { int ret = 0; - if (virtTestRun("Test create container ", 1, testCreateContainer, NULL) < 0) + if (virtTestRun("Test create container ", testCreateContainer, NULL) < 0) ret = -1; - if (virtTestRun("Test terminate container ", 1, testTerminateContainer, NULL) < 0) + if (virtTestRun("Test terminate container ", testTerminateContainer, NULL) < 0) ret = -1; - if (virtTestRun("Test create machine ", 1, testCreateMachine, NULL) < 0) + if (virtTestRun("Test create machine ", testCreateMachine, NULL) < 0) ret = -1; - if (virtTestRun("Test terminate machine ", 1, testTerminateMachine, NULL) < 0) + if (virtTestRun("Test terminate machine ", testTerminateMachine, NULL) < 0) ret = -1; - if (virtTestRun("Test create no systemd ", 1, testCreateNoSystemd, NULL) < 0) + if (virtTestRun("Test create no systemd ", testCreateNoSystemd, NULL) < 0) ret = -1; - if (virtTestRun("Test create bad systemd ", 1, testCreateBadSystemd, NULL) < 0) + if (virtTestRun("Test create bad systemd ", testCreateBadSystemd, NULL) < 0) ret = -1; # define TEST_SCOPE(name, partition, unitname) \ @@ -224,7 +224,7 @@ mymain(void) struct testScopeData data = { \ name, partition, unitname \ }; \ - if (virtTestRun("Test scopename", 1, testScopeName, &data) < 0) \ + if (virtTestRun("Test scopename", testScopeName, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/virtimetest.c b/tests/virtimetest.c index 7768ecb265..c1f8f4bbe0 100644 --- a/tests/virtimetest.c +++ b/tests/virtimetest.c @@ -93,7 +93,7 @@ mymain(void) .tm_isdst = 0, \ }, \ }; \ - if (virtTestRun("Test fields " #ts " " #year " ", 1, testTimeFields, &data) < 0) \ + if (virtTestRun("Test fields " #ts " " #year " ", testTimeFields, &data) < 0) \ ret = -1; \ } while (0) diff --git a/tests/viruritest.c b/tests/viruritest.c index dab81290e7..41a8ca70b6 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -149,7 +149,7 @@ mymain(void) uri, (uri_out) ? (uri_out) : (uri), scheme, server, port, \ path, query, fragment, user, params \ }; \ - if (virtTestRun("Test URI " # uri, 1, testURIParse, &data) < 0) \ + if (virtTestRun("Test URI " # uri, testURIParse, &data) < 0) \ ret = -1; \ } while (0) #define TEST_PARSE(uri, scheme, server, port, path, query, fragment, user, params) \ diff --git a/tests/vmwarevertest.c b/tests/vmwarevertest.c index 47c250c79b..e981dda33e 100644 --- a/tests/vmwarevertest.c +++ b/tests/vmwarevertest.c @@ -83,7 +83,7 @@ mymain(void) vmware_type, name, version \ }; \ if (virtTestRun("VMware Version String Parsing " name, \ - 1, testVerStrParse, &info) < 0) \ + testVerStrParse, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index da8da3afd9..13515f0883 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -188,7 +188,7 @@ mymain(void) do { \ struct testInfo info = { _in, _out }; \ virResetLastError(); \ - if (virtTestRun("VMware VMX-2-XML "_in" -> "_out, 1, \ + if (virtTestRun("VMware VMX-2-XML "_in" -> "_out, \ testCompareHelper, &info) < 0) { \ ret = -1; \ } \ diff --git a/tests/xencapstest.c b/tests/xencapstest.c index 9de3919fef..ed1fee5c38 100644 --- a/tests/xencapstest.c +++ b/tests/xencapstest.c @@ -167,50 +167,50 @@ mymain(void) return EXIT_FAILURE; if (virtTestRun("Capabilities for i686, no PAE, no HVM", - 1, testXeni686, NULL) != 0) + testXeni686, NULL) != 0) ret = -1; if (virtTestRun("Capabilities for i686, PAE, no HVM", - 1, testXeni686PAE, NULL) != 0) + 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", - 1, testXeni686HVM, NULL) != 0) + testXeni686HVM, NULL) != 0) ret = -1; */ if (virtTestRun("Capabilities for i686, PAE, HVM", - 1, testXeni686PAEHVM, NULL) != 0) + testXeni686PAEHVM, NULL) != 0) ret = -1; if (virtTestRun("Capabilities for x86_64, no HVM", - 1, testXenx86_64, NULL) != 0) + testXenx86_64, NULL) != 0) ret = -1; if (virtTestRun("Capabilities for x86_64, HVM", - 1, testXenx86_64HVM, NULL) != 0) + testXenx86_64HVM, NULL) != 0) ret = -1; if (virtTestRun("Capabilities for ia64, no HVM, LE", - 1, testXenia64, NULL) != 0) + testXenia64, NULL) != 0) ret = -1; if (virtTestRun("Capabilities for ia64, HVM, LE", - 1, testXenia64HVM, NULL) != 0) + testXenia64HVM, NULL) != 0) ret = -1; if (virtTestRun("Capabilities for ia64, no HVM, BE", - 1, testXenia64BE, NULL) != 0) + testXenia64BE, NULL) != 0) ret = -1; if (virtTestRun("Capabilities for ia64, HVM, BE", - 1, testXenia64BEHVM, NULL) != 0) + testXenia64BEHVM, NULL) != 0) ret = -1; if (virtTestRun("Capabilities for ppc64", - 1, testXenppc64, NULL) != 0) + testXenppc64, NULL) != 0) ret = -1; diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index 73e4a2d684..c8014e1d8e 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -207,10 +207,10 @@ mymain(void) struct testInfo info0 = { name, version, 0 }; \ struct testInfo info1 = { name, version, 1 }; \ if (virtTestRun("Xen XM-2-XML Parse " name, \ - 1, testCompareHelper, &info0) < 0) \ + testCompareHelper, &info0) < 0) \ ret = -1; \ if (virtTestRun("Xen XM-2-XML Format " name, \ - 1, testCompareHelper, &info1) < 0) \ + testCompareHelper, &info1) < 0) \ ret = -1; \ } while (0) diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c index 87ac2c3e20..a4d2b14218 100644 --- a/tests/xml2sexprtest.c +++ b/tests/xml2sexprtest.c @@ -101,7 +101,7 @@ mymain(void) struct testInfo info = { in, out, name, version }; \ virResetLastError(); \ if (virtTestRun("Xen XML-2-SEXPR " in " -> " out, \ - 1, testCompareHelper, &info) < 0) \ + testCompareHelper, &info) < 0) \ ret = -1; \ } while (0) diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c index a8adc822b7..2f2db6070e 100644 --- a/tests/xml2vmxtest.c +++ b/tests/xml2vmxtest.c @@ -220,7 +220,7 @@ mymain(void) do { \ struct testInfo info = { _in, _out, _version }; \ virResetLastError(); \ - if (virtTestRun("VMware XML-2-VMX "_in" -> "_out, 1, \ + if (virtTestRun("VMware XML-2-VMX "_in" -> "_out, \ testCompareHelper, &info) < 0) { \ result = -1; \ } \