mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
tests: Use STRNEQ_NULLABLE
It's possible that the @outbuf and/or @errbuf could be NULL and thus we need to use the right comparison macro. Found by Coverity Signed-off-by: John Ferlan <jferlan@redhat.com> ACKed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
8f3c00c6e8
commit
f0982d5faa
@ -875,12 +875,12 @@ static int test21(const void *unused ATTRIBUTE_UNUSED)
|
|||||||
if (virTestGetVerbose())
|
if (virTestGetVerbose())
|
||||||
printf("STDOUT:%s\nSTDERR:%s\n", NULLSTR(outbuf), NULLSTR(errbuf));
|
printf("STDOUT:%s\nSTDERR:%s\n", NULLSTR(outbuf), NULLSTR(errbuf));
|
||||||
|
|
||||||
if (STRNEQ(outbuf, outbufExpected)) {
|
if (STRNEQ_NULLABLE(outbuf, outbufExpected)) {
|
||||||
virTestDifference(stderr, outbufExpected, outbuf);
|
virTestDifference(stderr, outbufExpected, outbuf);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STRNEQ(errbuf, errbufExpected)) {
|
if (STRNEQ_NULLABLE(errbuf, errbufExpected)) {
|
||||||
virTestDifference(stderr, errbufExpected, errbuf);
|
virTestDifference(stderr, errbufExpected, errbuf);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user