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);