tests: append a newline to expected-output files lacking NL-at-EOF

* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Adjust the
code that creates "actual" output, so that it too produces a
newline-terminated buffer.
* tests/qemuxml2argvdata/*.args: Append a newline to each, via:
for i in $(find|grep '\.args$'); do echo >> $i;done
This commit is contained in:
Jim Meyering 2008-08-11 12:29:58 +00:00
parent b3728d7d72
commit efb8492b9d
41 changed files with 50 additions and 40 deletions

View File

@ -1,3 +1,12 @@
Fri Aug 11 14:29:02 CEST 2008 Jim Meyering <meyering@redhat.com>
tests: append a newline to expected-output files lacking NL-at-EOF
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Adjust the
code that creates "actual" output, so that it too produces a
newline-terminated buffer.
* tests/qemuxml2argvdata/*.args: Append a newline to each, via:
for i in $(find|grep '\.args$'); do echo >> $i;done
Fri Aug 8 16:41:24 BST 2008 Daniel Berrange <berrange@redhat.com> Fri Aug 8 16:41:24 BST 2008 Daniel Berrange <berrange@redhat.com>
* src/iptables.c, src/lxc_driver.c, src/openvz_driver.c, * src/iptables.c, src/lxc_driver.c, src/openvz_driver.c,

View File

@ -53,7 +53,7 @@ static int testCompareXMLToArgvFiles(const char *xml, const char *cmd, int extra
goto fail; goto fail;
tmp = argv; tmp = argv;
len = 0; len = 1; /* for trailing newline */
while (*tmp) { while (*tmp) {
len += strlen(*tmp) + 1; len += strlen(*tmp) + 1;
tmp++; tmp++;
@ -68,6 +68,7 @@ static int testCompareXMLToArgvFiles(const char *xml, const char *cmd, int extra
strcat(actualargv, *tmp); strcat(actualargv, *tmp);
tmp++; tmp++;
} }
strcat(actualargv, "\n");
if (STRNEQ(expectargv, actualargv)) { if (STRNEQ(expectargv, actualargv)) {
virtTestDifference(stderr, expectargv, actualargv); virtTestDifference(stderr, expectargv, actualargv);