From 73a9bab11a90bd37fcaf803a845641f573c703f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Tue, 6 Nov 2012 22:42:54 +0100 Subject: [PATCH] Check for /dev/full, don't run test if it doesn't exist (e.g. on NetBSD) --- test/test_logging.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/test_logging.c b/test/test_logging.c index c5ef3ea..1d5a2f7 100644 --- a/test/test_logging.c +++ b/test/test_logging.c @@ -255,10 +255,11 @@ START_TEST (test_logfile_full_filesystem) }; struct uc_log_destination *dest; + uc_log_init(&mods); dest = uc_log_new_file("/dev/full", UC_LL_DEBUG, 1); - fail_if(dest == NULL); + fail_if(dest == NULL, "Cannot open /dev/full"); uc_log_add_destination(dest); UC_LOGF(UC_LL_DEBUG, 0, "Lorum ipson %d\n", 1); @@ -340,7 +341,11 @@ Suite *logging_suite(void) tcase_add_test(tc1, test_logfile_loglevel_surpressed_module); tcase_add_test(tc1, test_logfile_reopen_files); tcase_add_test(tc1, test_logfile_remove_dest); - tcase_add_test(tc1, test_logfile_full_filesystem); + if(access("/dev/full", R_OK) == 0) { + tcase_add_test(tc1, test_logfile_full_filesystem); + } else { + puts("Cannot access /dev/full. Not testing test_logfile_full_filesystem"); + } tcase_add_test(tc1, test_logfile_invalid_file); tcase_add_test(tc2, test_logfile_invalid_file_after_repoen);