Check for /dev/full, don't run test if it doesn't exist (e.g. on NetBSD)

This commit is contained in:
Nils O. Selåsdal
2012-11-06 22:42:54 +01:00
parent 531abb1b57
commit 73a9bab11a
+7 -2
View File
@@ -255,10 +255,11 @@ START_TEST (test_logfile_full_filesystem)
}; };
struct uc_log_destination *dest; struct uc_log_destination *dest;
uc_log_init(&mods); uc_log_init(&mods);
dest = uc_log_new_file("/dev/full", UC_LL_DEBUG, 1); 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_log_add_destination(dest);
UC_LOGF(UC_LL_DEBUG, 0, "Lorum ipson %d\n", 1); 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_loglevel_surpressed_module);
tcase_add_test(tc1, test_logfile_reopen_files); tcase_add_test(tc1, test_logfile_reopen_files);
tcase_add_test(tc1, test_logfile_remove_dest); 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(tc1, test_logfile_invalid_file);
tcase_add_test(tc2, test_logfile_invalid_file_after_repoen); tcase_add_test(tc2, test_logfile_invalid_file_after_repoen);