提交 062ea148 编写于 作者: T Tomáš Ryšavý 提交者: John Ferlan

Rename virtTestDifference to virTestDifference.

This function doesn't follow our convention of naming functions.
上级 cd7dd150
......@@ -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;
}
......
......@@ -58,18 +58,18 @@ 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,
directoryAndFileName);
virTestDifference(stderr, paths[i].directoryAndFileName,
directoryAndFileName);
goto failure;
}
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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 {
......
......@@ -607,9 +607,9 @@ virtTestDifferenceFullNoRegenerate(FILE *stream,
* first and last characters at which differences occur
*/
int
virtTestDifference(FILE *stream,
const char *expect,
const char *actual)
virTestDifference(FILE *stream,
const char *expect,
const char *actual)
{
return virtTestDifferenceFullNoRegenerate(stream,
expect, NULL,
......
......@@ -56,9 +56,9 @@ int virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxle
void virtTestClearCommandPath(char *cmdset);
int virtTestDifference(FILE *stream,
const char *expect,
const char *actual);
int virTestDifference(FILE *stream,
const char *expect,
const char *actual);
int virtTestDifferenceFull(FILE *stream,
const char *expect,
const char *expectName,
......
......@@ -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;
......
......@@ -85,7 +85,7 @@ testCompareXMLtoXMLFiles(const char *xml)
goto cleanup;
if (STRNEQ(actual, xmlData)) {
virtTestDifference(stderr, xmlData, actual);
virTestDifference(stderr, xmlData, actual);
goto cleanup;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -95,9 +95,9 @@ testVirNetDevBandwidthSet(const void *data)
}
if (STRNEQ_NULLABLE(info->exp_cmd, actual_cmd)) {
virtTestDifference(stderr,
NULLSTR(info->exp_cmd),
NULLSTR(actual_cmd));
virTestDifference(stderr,
NULLSTR(info->exp_cmd),
NULLSTR(actual_cmd));
goto cleanup;
}
......
......@@ -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;
}
......
......@@ -72,7 +72,7 @@ testCompareOutputLit(const char *expectData,
goto cleanup;
if (STRNEQ(expectData, actualData)) {
virtTestDifference(stderr, expectData, actualData);
virTestDifference(stderr, expectData, actualData);
goto cleanup;
}
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册