static void test_auth_cache_parse_key(void)
{
- struct {
+ static const struct {
const char *in, *out;
} tests[] = {
{ "%n@%d", "%u" },
static void test_charset_utf8_common(const char *input_charset)
{
- struct {
+ static const struct {
const char *input;
const char *output;
enum charset_result result;
#ifdef HAVE_ICONV
static void test_charset_iconv(void)
{
- struct {
+ static const struct {
const char *charset;
const char *input;
const char *output;
}
static void test_charset_iconv_crashes(void)
{
- struct {
+ static const struct {
const char *charset;
const char *input;
} tests[] = {
static
void test_cipher_test_vectors(void)
{
- static struct {
+ static const struct {
const char *key;
const char *iv;
const char *pt;
static void test_dns_compare(void)
{
- struct {
+ static const struct {
const char *a;
const char *b;
int res;
static void test_dns_match(void)
{
- struct {
+ static const struct {
const char *name;
const char *mask;
int res;
static void test_fts_filter_contractions_fr(void)
{
- struct {
+ static const struct {
const char *input;
const char *output;
} tests[] = {
static void test_fts_filter_lowercase(void)
{
- struct {
+ static const struct {
const char *input;
const char *output;
} tests[] = {
#ifdef HAVE_LIBICU
static void test_fts_filter_lowercase_utf8(void)
{
- struct {
+ static const struct {
const char *input;
const char *output;
} tests[] = {
static void test_fts_filter_lowercase_too_long_utf8(void)
{
- struct {
+ static const struct {
const char *input;
const char *output;
} tests[] = {
static void test_fts_tokenizer_delete_trailing_partial_char(void)
{
- const struct {
+ static const struct {
const char *str;
unsigned int truncated_len;
} tests[] = {
static void test_imap_append_string_for_humans(void)
{
- static struct {
+ static const struct {
const char *input, *output;
} tests[] = {
{ "", "\"\"" },
static void test_imap_append_astring(void)
{
- static struct {
+ static const struct {
const char *input, *output;
} tests[] = {
{ "", "\"\"" },
static void test_imap_append_nstring(void)
{
- static struct {
+ static const struct {
const char *input, *output;
} tests[] = {
{ "", "\"\"" },
static void test_imap_utf7_by_example(void)
{
- static struct test {
+ static const struct test {
const char *utf8;
const char *mutf7;
} tests[] = {
static void test_mail_index_modseq_get_next_log_offset(void)
{
- struct {
+ static const struct {
uint32_t log_seq;
uoff_t log_offset;
} tests[] = {
static void test_istream_add_missing_eoh(void)
{
- struct {
+ static const struct {
const char *input;
const char *output;
unsigned int extra;
static void test_istream_hide_body(void)
{
- struct {
+ static const struct {
const char *input;
const char *output;
int extra;
#include "mail-html2text.h"
#include "test-common.h"
-static struct {
+static const struct {
const char *input;
const char *output;
} tests[] = {
#include "message-snippet.h"
#include "test-common.h"
-static struct {
+static const struct {
const char *input;
unsigned int max_snippet_chars;
const char *output;
static void test_rfc822_parse_quoted_string(void)
{
- const struct {
+ static const struct {
const char *input, *output;
int ret;
} tests[] = {
static void test_settings_get_time(void)
{
- struct {
+ static const struct {
const char *input;
unsigned int output;
} tests[] = {
#define CURRENT_UNIX_TIME 1000000
-static struct {
+static const struct {
const char *input, *output;
} tests[] = {
{ "ALL", NULL },
#include "mail-search-parser.h"
#include "mail-search.h"
-struct {
+static const struct {
const char *input;
const char *output;
} tests[] = {
"%{sha1:168}",
NULL
};
- static struct hash_format_test tests[] = {
+ static const struct hash_format_test tests[] = {
{ "%{sha1}", "8843d7f92416211de9ebb963ff4ce28125932878" },
{ "*%{sha1}*", "*8843d7f92416211de9ebb963ff4ce28125932878*" },
{ "*%{sha1:8}*", "*88*" },
static void test_ioloop_find_fd_conditions(void)
{
- struct {
+ static struct {
enum io_condition condition;
int fd[2];
struct io *io;
#include "istream-private.h"
#include "istream-base64.h"
-struct {
+static const struct {
const char *input;
const char *output;
} tests[] = {
#include "istream-private.h"
#include "istream-base64.h"
-static struct test {
+static const struct test {
const char *input;
unsigned int chars_per_line;
bool crlf;
"\"key12\": [ \"foo\" , 5.24,[true],{\"aobj\":[]}]"
"}\n";
-static struct {
+static const struct {
enum json_type type;
const char *value;
} json_output[] = {
static void test_json_parser_primitive_values(void)
{
- static struct {
+ static const struct {
const char *str;
int ret;
} test_inputs[] = {
if (argc > 2 && strcmp(argv[1], "--match") == 0)
match = argv[2];
- static struct named_test test_functions[] = {
+ static const struct named_test test_functions[] = {
#define TEST(x) TEST_NAMED(x)
#define FATAL(x)
#include "test-lib.inc"
#undef FATAL
{ NULL, NULL }
};
- static struct named_fatal fatal_functions[] = {
+ static const struct named_fatal fatal_functions[] = {
#define TEST(x)
#define FATAL(x) FATAL_NAMED(x)
#include "test-lib.inc"
static void test_malloc_overflow_multiply(void)
{
- const struct {
+ static const struct {
size_t a, b;
} tests[] = {
{ 0, SIZE_MAX },
static void test_malloc_overflow_add(void)
{
- const struct {
+ static const struct {
size_t a, b;
} tests[] = {
{ 0, SIZE_MAX },
static void test_net_is_in_network(void)
{
- static struct test_net_is_in_network_input input[] = {
+ static const struct test_net_is_in_network_input input[] = {
{ "1.2.3.4", "1.2.3.4", 32, TRUE },
{ "1.2.3.4", "1.2.3.3", 32, FALSE },
{ "1.2.3.4", "1.2.3.5", 32, FALSE },
#include "numpack.h"
-static struct test {
+static const struct test {
uint64_t input;
uint8_t output[10];
unsigned int output_size;
{ 0xffffffffffffffff, { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 1 }, 10 },
{ 0xfffffffe, { 0xfe, 0xff, 0xff, 0xff, 0xf }, 5 },
};
-static struct fail {
+static const struct fail {
uint8_t input[11];
unsigned int input_size;
} dec_fails[] = {
static void test_seq_range_array_invert_edges(void)
{
- const struct {
+ static const struct {
int64_t a_seq1, a_seq2, b_seq1, b_seq2;
int64_t resa_seq1, resa_seq2, resb_seq1, resb_seq2;
} tests[] = {
void test_str_sanitize(void)
{
- static struct str_sanitize_test tests[] = {
+ static const struct str_sanitize_test tests[] = {
{ NULL, 2, NULL },
{ "", 2, NULL },
{ "a", 2, NULL },
static void test_str_escape(void)
{
- static struct strinput unesc[] = {
+ static const struct strinput unesc[] = {
{ "foo", "foo" },
{ "\\\\\\\\\\\"\\\"\\\'\\\'", "\\\\\"\"\'\'" },
{ "\\a\\n\\r\\", "anr" }
};
- static struct strinput tabesc[] = {
+ static const struct strinput tabesc[] = {
{ "foo", "foo" },
{ "\001", "\0011" },
{ "\t", "\001t" },
static const char *const test_strarray_input[] = {
"", "hello", "world", "", "yay", "", NULL
};
-static struct {
+static const struct {
const char *separator;
const char *output;
} test_strarray_outputs[] = {
static void test_timeval_cmp(void)
{
- static struct timeval input[] = {
+ static const struct timeval input[] = {
{ 0, 0 }, { 0, 0 },
{ INT_MAX, 999999 }, { INT_MAX, 999999 },
{ 0, 0 }, { 0, 1 },
static void test_timeval_diff(void)
{
- static struct timeval input[] = {
+ static const struct timeval input[] = {
{ 1, 0 }, { 0, 999999 },
{ 1, 0 }, { 0, 999001 },
{ 1, 1 }, { 0, 999001 },
void test_utc_mktime(void)
{
- static struct test_utc_mktime_input input[] = {
+ static const struct test_utc_mktime_input input[] = {
#ifdef TIME_T_SIGNED
{ 1969, 12, 31, 23, 59, 59 },
{ 1901, 12, 13, 20, 45, 53 },
static void test_var_expand_ranges(void)
{
- static struct var_expand_test tests[] = {
+ static const struct var_expand_test tests[] = {
{ "%v", "value1234", 1 },
{ "%3v", "val", 1 },
{ "%3.2v", "ue", 1 },
{ "%0.-1v", "value123", 1 },
{ "%-4.-1v", "123", 1 }
};
- static struct var_expand_table table[] = {
+ static const struct var_expand_table table[] = {
{ 'v', "value1234", NULL },
{ '\0', NULL, NULL }
};
{ "%{nonexistent}", "UNSUPPORTED_VARIABLE_nonexistent", 0 },
{ "%{nonexistent:default}", "UNSUPPORTED_VARIABLE_nonexistent", 0 },
};
- static struct var_expand_table table[] = {
+ static const struct var_expand_table table[] = {
{ 'v', "value", NULL },
{ 'w', "value2", NULL },
{ '\0', NULL, NULL }
static void test_var_get_key_range(void)
{
- static struct var_get_key_range_test tests[] = {
+ static const struct var_get_key_range_test tests[] = {
{ "", 0, 0 },
{ "{", 1, 0 },
{ "k", 0, 1 },
static void test_var_expand_with_funcs(void)
{
- static struct var_expand_test tests[] = {
+ static const struct var_expand_test tests[] = {
{ "%{func1}", "<>", 1 },
{ "%{func1:foo}", "<foo>", 1 },
{ "%{func2}", "", 1 },
{ "%{func4}%{func5}", "", -1 },
{ "%{func5}%{func4}%{func3}", "", -1 },
};
- static struct var_expand_table table[] = {
+ static const struct var_expand_table table[] = {
{ '\0', NULL, NULL }
};
static const struct var_expand_func_table func_table[] = {
static void test_var_get_key(void)
{
- static struct {
+ static const struct {
const char *str;
char key;
} tests[] = {
static void test_var_has_key(void)
{
- static struct {
+ static const struct {
const char *str;
char key;
const char *long_key;
const char *error;
test_begin("var_expand_hashing");
- static struct var_expand_table table[] = {
+ static const struct var_expand_table table[] = {
{'\0', "example", "value" },
{'\0', "other-example", "other-value" },
{'\0', NULL, NULL}
};
- static struct {
+ static const struct {
const char *in;
const char *out;
} tests[] = {
#include "test-lib.h"
#include "wildcard-match.h"
-static struct {
+static const struct {
const char *data;
const char *mask;
bool result;
static void test_pop3_migration_get_hdr_sha1(void)
{
- struct {
+ static const struct {
const char *input;
const char *sha1;
bool have_eoh;