virhostdevtest: Don't proceed to test cases if init failed

The myInit() function is called before any of the test cases
because it prepares all internal structures for individual cases.
Well, if it fails there's no point in proceeding with testing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2019-06-14 10:39:24 +02:00
parent 22fc83df92
commit d2899a6485

View File

@ -574,8 +574,11 @@ mymain(void)
ret = -1; \
} while (0)
if (myInit() < 0)
if (myInit() < 0) {
fprintf(stderr, "Init data structures failed.");
virFileDeleteTree(fakerootdir);
return EXIT_FAILURE;
}
DO_TEST(testVirHostdevRoundtripNoGuest);
DO_TEST(testVirHostdevRoundtripUnmanaged);