void test_mutt_ch_canonical_charset(void)
{
// void mutt_ch_canonical_charset(char *buf, size_t buflen, const char *name);
+
+ {
+ mutt_ch_canonical_charset(NULL, 10, "apple");
+ TEST_CHECK_(1, "mutt_ch_canonical_charset(NULL, 10, \"apple\")");
+ }
+
+ {
+ char buf[32] = { 0 };
+ mutt_ch_canonical_charset(buf, sizeof(buf), NULL);
+ TEST_CHECK_(1, "mutt_ch_canonical_charset(&buf, sizeof(buf), NULL)");
+ }
}
void test_mutt_ch_charset_lookup(void)
{
// const char *mutt_ch_charset_lookup(const char *chs);
+
+ {
+ TEST_CHECK(!mutt_ch_charset_lookup(NULL));
+ }
}
void test_mutt_ch_check(void)
{
// int mutt_ch_check(const char *s, size_t slen, const char *from, const char *to);
+
+ {
+ TEST_CHECK(mutt_ch_check(NULL, 10, "apple", "banana") != 0);
+ }
+
+ {
+ char buf[32] = { 0 };
+ TEST_CHECK(mutt_ch_check(buf, sizeof(buf), NULL, "banana") != 0);
+ }
+
+ {
+ char buf[32] = { 0 };
+ TEST_CHECK(mutt_ch_check(buf, sizeof(buf), "apple", NULL) != 0);
+ }
}
void test_mutt_ch_check_charset(void)
{
// bool mutt_ch_check_charset(const char *cs, bool strict);
+
+ {
+ TEST_CHECK(!mutt_ch_check_charset(NULL, false));
+ }
}
void test_mutt_ch_choose(void)
{
// char *mutt_ch_choose(const char *fromcode, const char *charsets, const char *u, size_t ulen, char **d, size_t *dlen);
+
+ {
+ char buf_in[32] = { 0 };
+ char *buf_out = NULL;
+ size_t buflen = 0;
+ TEST_CHECK(mutt_ch_choose(NULL, "banana", buf_in, sizeof(buf_in), &buf_out, &buflen) != NULL);
+ }
+
+ {
+ char buf_in[32] = { 0 };
+ char *buf_out = NULL;
+ size_t buflen = 0;
+ TEST_CHECK(!mutt_ch_choose("apple", NULL, buf_in, sizeof(buf_in), &buf_out, &buflen));
+ }
+
+ {
+ char *buf_out = NULL;
+ size_t buflen = 0;
+ TEST_CHECK(mutt_ch_choose("apple", "banana", NULL, 10, &buf_out, &buflen) != NULL);
+ }
+
+ {
+ char buf_in[32] = { 0 };
+ size_t buflen = 0;
+ TEST_CHECK(!mutt_ch_choose("apple", "banana", buf_in, sizeof(buf_in), NULL, &buflen));
+ }
+
+ {
+ char buf_in[32] = { 0 };
+ char *buf_out = NULL;
+ TEST_CHECK(mutt_ch_choose("apple", "banana", buf_in, sizeof(buf_in), &buf_out, NULL) != NULL);
+ }
}
void test_mutt_ch_chscmp(void)
{
// bool mutt_ch_chscmp(const char *cs1, const char *cs2);
+
+ {
+ TEST_CHECK(!mutt_ch_chscmp(NULL, "banana"));
+ }
+
+ {
+ TEST_CHECK(!mutt_ch_chscmp("apple", NULL));
+ }
}
void test_mutt_ch_convert_nonmime_string(void)
{
// int mutt_ch_convert_nonmime_string(char **ps);
+
+ {
+ TEST_CHECK(mutt_ch_convert_nonmime_string(NULL) != 0);
+ }
}
void test_mutt_ch_convert_string(void)
{
// int mutt_ch_convert_string(char **ps, const char *from, const char *to, int flags);
+
+ {
+ char *ps = strdup("apple");
+ TEST_CHECK(mutt_ch_convert_string(NULL, "apple", "banana", 0) != 0);
+ free(ps);
+ }
+
+ {
+ char *ps = NULL;
+ TEST_CHECK(mutt_ch_convert_string(&ps, "apple", "banana", 0) == 0);
+ }
+
+ {
+ char *ps = strdup("apple");
+ TEST_CHECK(mutt_ch_convert_string(&ps, NULL, "banana", 0) != 0);
+ free(ps);
+ }
+
+ {
+ char *ps = strdup("apple");
+ TEST_CHECK(mutt_ch_convert_string(&ps, "apple", NULL, 0) != 0);
+ free(ps);
+ }
}
void test_mutt_ch_fgetconv(void)
{
// int mutt_ch_fgetconv(struct FgetConv *fc);
+
+ {
+ TEST_CHECK(mutt_ch_fgetconv(NULL) == EOF);
+ }
}
void test_mutt_ch_fgetconv_close(void)
{
// void mutt_ch_fgetconv_close(struct FgetConv **fc);
+
+ {
+ mutt_ch_fgetconv_close(NULL);
+ TEST_CHECK_(1, "mutt_ch_fgetconv_close(NULL)");
+ }
+
+ {
+ struct FgetConv *fgetconv = NULL;
+ mutt_ch_fgetconv_close(&fgetconv);
+ TEST_CHECK_(1, "mutt_ch_fgetconv_close(&fgetconv)");
+ }
}
void test_mutt_ch_fgetconv_open(void)
{
// struct FgetConv *mutt_ch_fgetconv_open(FILE *fp, const char *from, const char *to, int flags);
+
+ {
+ TEST_CHECK(mutt_ch_fgetconv_open(NULL, "apple", "banana", 0) != NULL);
+ }
+
+ {
+ FILE fp = { 0 };
+ TEST_CHECK(mutt_ch_fgetconv_open(&fp, NULL, "banana", 0) != NULL);
+ }
+
+ {
+ FILE fp = { 0 };
+ TEST_CHECK(mutt_ch_fgetconv_open(&fp, "apple", NULL, 0) != NULL);
+ }
}
void test_mutt_ch_fgetconvs(void)
{
// char *mutt_ch_fgetconvs(char *buf, size_t buflen, struct FgetConv *fc);
+
+ {
+ struct FgetConv fgetconv = { 0 };
+ TEST_CHECK(!mutt_ch_fgetconvs(NULL, 10, &fgetconv));
+ }
+
+ {
+ char buf[32] = { 0 };
+ TEST_CHECK(!mutt_ch_fgetconvs(buf, sizeof(buf), NULL));
+ }
}
void test_mutt_ch_iconv_lookup(void)
{
// const char *mutt_ch_iconv_lookup(const char *chs);
+
+ {
+ TEST_CHECK(!mutt_ch_iconv_lookup(NULL));
+ }
}
void test_mutt_ch_iconv_open(void)
{
// iconv_t mutt_ch_iconv_open(const char *tocode, const char *fromcode, int flags);
+
+ {
+ TEST_CHECK(mutt_ch_iconv_open(NULL, "banana", 0) != NULL);
+ }
+
+ {
+ TEST_CHECK(mutt_ch_iconv_open("apple", NULL, 0) != NULL);
+ }
}
void test_mutt_ch_lookup_add(void)
{
// bool mutt_ch_lookup_add(enum LookupType type, const char *pat, const char *replace, struct Buffer *err);
+
+ {
+ struct Buffer buf = { 0 };
+ TEST_CHECK(!mutt_ch_lookup_add(0, NULL, "banana", &buf));
+ }
+
+ {
+ struct Buffer buf = { 0 };
+ TEST_CHECK(!mutt_ch_lookup_add(0, "apple", NULL, &buf));
+ }
+
+ {
+ TEST_CHECK(mutt_ch_lookup_add(0, "apple", "banana", NULL));
+ }
}
void test_mutt_ch_set_charset(void)
{
// void mutt_ch_set_charset(const char *charset);
+
+ {
+ mutt_ch_set_charset(NULL);
+ TEST_CHECK_(1, "mutt_ch_set_charset(NULL)");
+ }
}