void test_mutt_file_check_empty(void)
{
// int mutt_file_check_empty(const char *path);
+
+ {
+ TEST_CHECK(mutt_file_check_empty(NULL) != 0);
+ }
}
void test_mutt_file_chmod(void)
{
// int mutt_file_chmod(const char *path, mode_t mode);
+
+ {
+ TEST_CHECK(mutt_file_chmod(NULL, 0) != 0);
+ }
}
void test_mutt_file_chmod_add(void)
{
// int mutt_file_chmod_add(const char *path, mode_t mode);
+
+ {
+ TEST_CHECK(mutt_file_chmod_add(NULL, 0) != 0);
+ }
}
void test_mutt_file_chmod_add_stat(void)
{
// int mutt_file_chmod_add_stat(const char *path, mode_t mode, struct stat *st);
+
+ {
+ struct stat stat = { 0 };
+ TEST_CHECK(mutt_file_chmod_add_stat(NULL, 0, &stat) != 0);
+ }
+
+ {
+ TEST_CHECK(mutt_file_chmod_add_stat("apple", 0, NULL) != 0);
+ }
}
void test_mutt_file_chmod_rm(void)
{
// int mutt_file_chmod_rm(const char *path, mode_t mode);
+
+ {
+ TEST_CHECK(mutt_file_chmod_rm(NULL, 0) != 0);
+ }
}
void test_mutt_file_chmod_rm_stat(void)
{
// int mutt_file_chmod_rm_stat(const char *path, mode_t mode, struct stat *st);
+
+ {
+ struct stat stat = { 0 };
+ TEST_CHECK(mutt_file_chmod_rm_stat(NULL, 0, &stat) != 0);
+ }
+
+ {
+ TEST_CHECK(mutt_file_chmod_rm_stat("apple", 0, NULL) != 0);
+ }
}
void test_mutt_file_copy_bytes(void)
{
// int mutt_file_copy_bytes(FILE *fp_in, FILE *fp_out, size_t size);
+
+ {
+ FILE fp = { 0 };
+ TEST_CHECK(mutt_file_copy_bytes(NULL, &fp, 10) != 0);
+ }
+
+ {
+ FILE fp = { 0 };
+ TEST_CHECK(mutt_file_copy_bytes(&fp, NULL, 10) != 0);
+ }
}
void test_mutt_file_copy_stream(void)
{
// int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out);
+
+ {
+ FILE fp = { 0 };
+ TEST_CHECK(mutt_file_copy_stream(NULL, &fp) != 0);
+ }
+
+ {
+ FILE fp = { 0 };
+ TEST_CHECK(mutt_file_copy_stream(&fp, NULL) != 0);
+ }
}
void test_mutt_file_decrease_mtime(void)
{
// time_t mutt_file_decrease_mtime(const char *fp, struct stat *st);
+
+ {
+ struct stat stat = { 0 };
+ TEST_CHECK(mutt_file_decrease_mtime(NULL, &stat) != 0);
+ }
+
+ {
+ TEST_CHECK(mutt_file_decrease_mtime("apple", NULL) != 0);
+ }
}
void test_mutt_file_expand_fmt(void)
{
// void mutt_file_expand_fmt(char *dest, size_t destlen, const char *fmt, const char *src);
+
+ {
+ mutt_file_expand_fmt(NULL, 10, "apple", "banana");
+ TEST_CHECK_(1, "mutt_file_expand_fmt(NULL, 10, \"apple\", \"banana\")");
+ }
+
+ {
+ char buf[32] = { 0 };
+ mutt_file_expand_fmt(buf, sizeof(buf), NULL, "banana");
+ TEST_CHECK_(1, "mutt_file_expand_fmt(&buf, sizeof(buf), NULL, \"banana\")");
+ }
+
+ {
+ char buf[32] = { 0 };
+ mutt_file_expand_fmt(buf, sizeof(buf), "apple", NULL);
+ TEST_CHECK_(1, "mutt_file_expand_fmt(&buf, sizeof(buf), \"apple\", NULL)");
+ }
}
void test_mutt_file_expand_fmt_quote(void)
{
// void mutt_file_expand_fmt_quote(char *dest, size_t destlen, const char *fmt, const char *src);
+
+ {
+ mutt_file_expand_fmt_quote(NULL, 10, "apple", "banana");
+ TEST_CHECK_(1, "mutt_file_expand_fmt_quote(NULL, 10, \"apple\", \"banana\")");
+ }
+
+ {
+ char buf[32] = { 0 };
+ mutt_file_expand_fmt_quote(buf, sizeof(buf), NULL, "banana");
+ TEST_CHECK_(1, "mutt_file_expand_fmt_quote(&buf, sizeof(buf), NULL, \"banana\")");
+ }
+
+ {
+ char buf[32] = { 0 };
+ mutt_file_expand_fmt_quote(buf, sizeof(buf), "apple", NULL);
+ TEST_CHECK_(1, "mutt_file_expand_fmt_quote(&buf, sizeof(buf), \"apple\", NULL)");
+ }
}
void test_mutt_file_fclose(void)
{
// int mutt_file_fclose(FILE **fp);
+
+ {
+ TEST_CHECK(mutt_file_fclose(NULL) == 0);
+ }
+
+ {
+ FILE *fp = NULL;
+ TEST_CHECK(mutt_file_fclose(&fp) == 0);
+ }
}
void test_mutt_file_fopen(void)
{
// FILE *mutt_file_fopen(const char *path, const char *mode);
+
+ {
+ TEST_CHECK(!mutt_file_fopen(NULL, "banana"));
+ }
+
+ {
+ TEST_CHECK(!mutt_file_fopen("apple", NULL));
+ }
}
void test_mutt_file_fsync_close(void)
{
// int mutt_file_fsync_close(FILE **fp);
+
+ {
+ TEST_CHECK(mutt_file_fsync_close(NULL) == 0);
+ }
+
+ {
+ FILE *fp = NULL;
+ TEST_CHECK(mutt_file_fsync_close(&fp) == 0);
+ }
}
void test_mutt_file_get_size(void)
{
// long mutt_file_get_size(const char *path);
+
+ {
+ TEST_CHECK(mutt_file_get_size(NULL) == 0);
+ }
}
void test_mutt_file_get_stat_timespec(void)
{
// void mutt_file_get_stat_timespec(struct timespec *dest, struct stat *sb, enum MuttStatType type);
+
+ {
+ struct stat stat = { 0 };
+ mutt_file_get_stat_timespec(NULL, &stat, 0);
+ TEST_CHECK_(1, "mutt_file_get_stat_timespec(NULL, &stat, 0)");
+ }
+
+ {
+ struct timespec timespec = { 0 };
+ mutt_file_get_stat_timespec(×pec, NULL, 0);
+ TEST_CHECK_(1, "mutt_file_get_stat_timespec(×pec, NULL, 0)");
+ }
}
void test_mutt_file_iter_line(void)
{
// bool mutt_file_iter_line(struct MuttFileIter *iter, FILE *fp, int flags);
+
+ {
+ FILE fp = { 0 };
+ TEST_CHECK(!mutt_file_iter_line(NULL, &fp, 0));
+ }
+
+ {
+ struct MuttFileIter muttfileiter = { 0 };
+ TEST_CHECK(!mutt_file_iter_line(&muttfileiter, NULL, 0));
+ }
}
#include "config.h"
#include "mutt/mutt.h"
+bool map_dummy(char *line, int line_num, void *user_data)
+{
+ return false;
+}
+
void test_mutt_file_map_lines(void)
{
// bool mutt_file_map_lines(mutt_file_map_t func, void *user_data, FILE *fp, int flags);
+
+ {
+ FILE fp = { 0 };
+ TEST_CHECK(!mutt_file_map_lines(NULL, "apple", &fp, 0));
+ }
+
+ {
+ mutt_file_map_t map = map_dummy;
+ FILE *fp = fopen("/dev/null", "r");
+ TEST_CHECK(mutt_file_map_lines(map, NULL, fp, 0));
+ fclose(fp);
+ }
+
+ {
+ mutt_file_map_t map = map_dummy;
+ TEST_CHECK(!mutt_file_map_lines(map, "apple", NULL, 0));
+ }
}
void test_mutt_file_mkdir(void)
{
// int mutt_file_mkdir(const char *path, mode_t mode);
+
+ {
+ TEST_CHECK(mutt_file_mkdir(NULL, 0) != 0);
+ }
}
void test_mutt_file_mkstemp_full(void)
{
// FILE *mutt_file_mkstemp_full(const char *file, int line, const char *func);
+
+ C_Tmpdir = "/tmp";
+
+ {
+ TEST_CHECK(mutt_file_mkstemp_full(NULL, 0, "apple") != NULL);
+ }
+
+ {
+ TEST_CHECK(mutt_file_mkstemp_full("apple", 0, NULL) != NULL);
+ }
}
void test_mutt_file_open(void)
{
// int mutt_file_open(const char *path, int flags);
+
+ {
+ TEST_CHECK(mutt_file_open(NULL, 0) != 0);
+ }
}
void test_mutt_file_quote_filename(void)
{
// size_t mutt_file_quote_filename(const char *filename, char *buf, size_t buflen);
+
+ {
+ char buf[32] = { 0 };
+ TEST_CHECK(mutt_file_quote_filename(NULL, buf, sizeof(buf)) == 0);
+ }
+
+ {
+ TEST_CHECK(mutt_file_quote_filename("apple", NULL, 10) == 0);
+ }
}
void test_mutt_file_read_keyword(void)
{
// char *mutt_file_read_keyword(const char *file, char *buf, size_t buflen);
+
+ {
+ char buf[32] = { 0 };
+ TEST_CHECK(!mutt_file_read_keyword(NULL, buf, sizeof(buf)));
+ }
+
+ {
+ TEST_CHECK(!mutt_file_read_keyword("apple", NULL, 10));
+ }
}
void test_mutt_file_read_line(void)
{
// char *mutt_file_read_line(char *line, size_t *size, FILE *fp, int *line_num, int flags);
+
+ {
+ size_t size = 0;
+ FILE *fp = fopen("/dev/null", "r");
+ int line_num = 0;
+ TEST_CHECK(!mutt_file_read_line(NULL, &size, fp, &line_num, 0));
+ fclose(fp);
+ }
+
+ {
+ FILE fp = { 0 };
+ char *line = strdup("apple");
+ int line_num = 0;
+ TEST_CHECK(!mutt_file_read_line(line, NULL, &fp, &line_num, 0));
+ free(line);
+ }
+
+ {
+ size_t size = 0;
+ char *line = strdup("apple");
+ int line_num = 0;
+ TEST_CHECK(!mutt_file_read_line(line, &size, NULL, &line_num, 0));
+ free(line);
+ }
+
+ {
+ size_t size = 0;
+ char *line = strdup("apple");
+ FILE fp = { 0 };
+ TEST_CHECK(!mutt_file_read_line(line, &size, &fp, NULL, 0));
+ }
}
void test_mutt_file_rename(void)
{
// int mutt_file_rename(const char *oldfile, const char *newfile);
+
+ {
+ TEST_CHECK(mutt_file_rename(NULL, "apple") != 0);
+ }
+
+ {
+ TEST_CHECK(mutt_file_rename("apple", NULL) != 0);
+ }
}
void test_mutt_file_rmtree(void)
{
// int mutt_file_rmtree(const char *path);
+
+ {
+ TEST_CHECK(mutt_file_rmtree(NULL) != 0);
+ }
}
void test_mutt_file_safe_rename(void)
{
// int mutt_file_safe_rename(const char *src, const char *target);
+
+ {
+ TEST_CHECK(mutt_file_safe_rename(NULL, "apple") != 0);
+ }
+
+ {
+ TEST_CHECK(mutt_file_safe_rename("apple", NULL) != 0);
+ }
}
void test_mutt_file_sanitize_filename(void)
{
// void mutt_file_sanitize_filename(char *fp, bool slash);
+
+ {
+ mutt_file_sanitize_filename(NULL, false);
+ TEST_CHECK_(1, "mutt_file_sanitize_filename(NULL, false)");
+ }
}
void test_mutt_file_sanitize_regex(void)
{
// int mutt_file_sanitize_regex(struct Buffer *dest, const char *src);
+
+ {
+ TEST_CHECK(mutt_file_sanitize_regex(NULL, "apple") != 0);
+ }
+
+ {
+ struct Buffer buf = { 0 };
+ TEST_CHECK(mutt_file_sanitize_regex(&buf, NULL) != 0);
+ }
}
void test_mutt_file_set_mtime(void)
{
// void mutt_file_set_mtime(const char *from, const char *to);
+
+ {
+ mutt_file_set_mtime(NULL, "apple");
+ TEST_CHECK_(1, "mutt_file_set_mtime(NULL, \"apple\")");
+ }
+
+ {
+ mutt_file_set_mtime("apple", NULL);
+ TEST_CHECK_(1, "mutt_file_set_mtime(\"apple\", NULL)");
+ }
}
void test_mutt_file_stat_compare(void)
{
// int mutt_file_stat_compare(struct stat *sba, enum MuttStatType sba_type, struct stat *sbb, enum MuttStatType sbb_type);
+
+ {
+ struct stat stat = { 0 };
+ TEST_CHECK(mutt_file_stat_compare(NULL, 0, &stat, 0) == 0);
+ }
+
+ {
+ struct stat stat = { 0 };
+ TEST_CHECK(mutt_file_stat_compare(&stat, 0, NULL, 0) == 0);
+ }
}
void test_mutt_file_stat_timespec_compare(void)
{
// int mutt_file_stat_timespec_compare(struct stat *sba, enum MuttStatType type, struct timespec *b);
+
+ {
+ struct timespec timespec = { 0 };
+ TEST_CHECK(mutt_file_stat_timespec_compare(NULL, 0, ×pec) == 0);
+ }
+
+ {
+ struct stat stat = { 0 };
+ TEST_CHECK(mutt_file_stat_timespec_compare(&stat, 0, NULL) == 0);
+ }
}
void test_mutt_file_symlink(void)
{
// int mutt_file_symlink(const char *oldpath, const char *newpath);
+
+ {
+ TEST_CHECK(mutt_file_symlink(NULL, "apple") != 0);
+ }
+
+ {
+ TEST_CHECK(mutt_file_symlink("apple", NULL) != 0);
+ }
}
void test_mutt_file_timespec_compare(void)
{
// int mutt_file_timespec_compare(struct timespec *a, struct timespec *b);
+
+ {
+ struct timespec timespec = { 0 };
+ TEST_CHECK(mutt_file_timespec_compare(NULL, ×pec) == 0);
+ }
+
+ {
+ struct timespec timespec = { 0 };
+ TEST_CHECK(mutt_file_timespec_compare(×pec, NULL) == 0);
+ }
}
void test_mutt_file_unlink(void)
{
// void mutt_file_unlink(const char *s);
+
+ {
+ mutt_file_unlink(NULL);
+ TEST_CHECK_(1, "mutt_file_unlink(NULL)");
+ }
}
void test_mutt_file_unlink_empty(void)
{
// void mutt_file_unlink_empty(const char *path);
+
+ {
+ mutt_file_unlink_empty(NULL);
+ TEST_CHECK_(1, "mutt_file_unlink_empty(NULL)");
+ }
}