summaryrefslogtreecommitdiff
path: root/tests/virhostdevtest.c
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2019-06-14 10:39:24 +0200
committerMichal Privoznik <mprivozn@redhat.com>2019-08-06 11:20:39 +0200
commitd2899a648543402b5bf44531fc2e9d5a835eaa5e (patch)
tree905ab434ab55677290a72ed7d83b805ccae6f977 /tests/virhostdevtest.c
parent22fc83df92b36e1ca51235212ab6f36ad5059daa (diff)
downloadlibvirt-d2899a648543402b5bf44531fc2e9d5a835eaa5e.tar.gz
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>
Diffstat (limited to 'tests/virhostdevtest.c')
-rw-r--r--tests/virhostdevtest.c5
1 files changed, 4 insertions, 1 deletions
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);