From: Michal Privoznik Date: Fri, 14 Jun 2019 08:39:24 +0000 (+0200) Subject: virhostdevtest: Don't proceed to test cases if init failed X-Git-Tag: v5.7.0-rc1~378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2899a648543402b5bf44531fc2e9d5a835eaa5e;p=thirdparty%2Flibvirt.git 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 ACKed-by: Peter Krempa --- diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index 20eaca82e0..cf39c83c76 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -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);