From: Stephan Bosch Date: Sat, 14 Sep 2019 18:42:24 +0000 (+0200) Subject: lib-smtp: Reformat test-smtp-address.c. X-Git-Tag: 2.3.9~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00c6608ec44371f81a3b19a8f754ac3577a45c06;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: Reformat test-smtp-address.c. --- diff --git a/src/lib-smtp/test-smtp-address.c b/src/lib-smtp/test-smtp-address.c index ad25f08410..3d1efa27bf 100644 --- a/src/lib-smtp/test-smtp-address.c +++ b/src/lib-smtp/test-smtp-address.c @@ -22,83 +22,102 @@ valid_mailbox_parse_tests[] = { .input = "", .flags = SMTP_ADDRESS_PARSE_FLAG_ALLOW_EMPTY, .address = { .localpart = NULL, .domain = NULL }, - },{ + }, + { .input = "user", .flags = SMTP_ADDRESS_PARSE_FLAG_ALLOW_LOCALPART, .address = { .localpart = "user", .domain = NULL }, - },{ + }, + { .input = "user@domain.tld", .address = { .localpart = "user", .domain = "domain.tld" }, - },{ + }, + { .input = "1234567890@domain.tld", .address = { .localpart = "1234567890", .domain = "domain.tld" }, - },{ + }, + { .input = "_______@domain.tld", .address = { .localpart = "_______", .domain = "domain.tld" }, - },{ + }, + { .input = "firstname.lastname@domain.tld", .address = { .localpart = "firstname.lastname", .domain = "domain.tld" }, - },{ + }, + { .input = "firstname+lastname@domain.tld", .address = { .localpart = "firstname+lastname", .domain = "domain.tld" }, - },{ + }, + { .input = "firstname-lastname@domain.tld", .address = { .localpart = "firstname-lastname", .domain = "domain.tld" }, - },{ + }, + { .input = "\"user\"@domain.tld", .address = { .localpart = "user", .domain = "domain.tld" }, .output = "user@domain.tld" - },{ + }, + { .input = "\"user@frop\"@domain.tld", .address = { .localpart = "user@frop", .domain = "domain.tld" }, .output = "\"user@frop\"@domain.tld" - },{ + }, + { .input = "user@127.0.0.1", .address = { .localpart = "user", .domain = "127.0.0.1" }, - },{ + }, + { .input = "user@[127.0.0.1]", .address = { .localpart = "user", .domain = "[127.0.0.1]" }, - },{ + }, + { .input = "user@[IPv6:::1]", .address = { .localpart = "user", .domain = "[IPv6:::1]" }, - },{ + }, + { .input = "user@[IPv6:::127.0.0.1]", .address = { .localpart = "user", .domain = "[IPv6:::127.0.0.1]" }, /* Japanese deviations */ - }, { + }, + { .input = "email@-example.com", .address = { .localpart = "email", .domain = "-example.com" }, - }, { + }, + { .input = ".email@example.com", .output = "\".email\"@example.com", .address = { .localpart = ".email", .domain = "example.com" }, - }, { + }, + { .input = "email.@example.com", .output = "\"email.\"@example.com", .address = { .localpart = "email.", .domain = "example.com" }, - }, { + }, + { .input = "email..email@example.com", .output = "\"email..email\"@example.com", .address = { .localpart = "email..email", .domain = "example.com" }, - }, { + }, + { .input = "Abc..123@example.com", .output = "\"Abc..123\"@example.com", .address = { .localpart = "Abc..123", .domain = "example.com" }, - }, { + }, + { .input = "Abc..@example.com", .output = "\"Abc..\"@example.com", .address = { .localpart = "Abc..", .domain = "example.com" }, - } + }, }; unsigned int valid_mailbox_parse_test_count = @@ -116,39 +135,40 @@ static void test_smtp_mailbox_parse_valid(void) test = &valid_mailbox_parse_tests[i]; ret = smtp_address_parse_mailbox(pool_datastack_create(), - test->input, test->flags, &address, &error); + test->input, test->flags, + &address, &error); test_begin(t_strdup_printf("smtp mailbox valid [%d]", i)); - test_out_reason(t_strdup_printf("parse(\"%s\")", - test->input), ret > 0, error); + test_out_reason(t_strdup_printf("parse(\"%s\")", test->input), + ret > 0, error); if (ret > 0) { if (address->localpart == NULL || test->address.localpart == NULL) { - test_out(t_strdup_printf - ("address->localpart = %s", address->localpart), - (address->localpart == test->address.localpart)); + test_out(t_strdup_printf("address->localpart = %s", + address->localpart), + (address->localpart == test->address.localpart)); } else { - test_out(t_strdup_printf - ("address->localpart = \"%s\"", address->localpart), - strcmp(address->localpart, test->address.localpart) == 0); + test_out(t_strdup_printf("address->localpart = \"%s\"", + address->localpart), + strcmp(address->localpart, test->address.localpart) == 0); } if (address->domain == NULL || - test->address.domain == NULL) { - test_out(t_strdup_printf - ("address->domain = %s", address->domain), - (address->domain == test->address.domain)); + test->address.domain == NULL) { + test_out(t_strdup_printf("address->domain = %s", + address->domain), + (address->domain == test->address.domain)); } else { - test_out(t_strdup_printf - ("address->domain = \"%s\"", address->domain), - strcmp(address->domain, test->address.domain) == 0); + test_out(t_strdup_printf("address->domain = \"%s\"", + address->domain), + strcmp(address->domain, test->address.domain) == 0); } encoded = smtp_address_encode(address); - output = (test->output == NULL ? test->input : test->output); - test_out( - t_strdup_printf("encode() = \"%s\"", encoded), - strcmp(encoded, output) == 0); + output = (test->output == NULL ? + test->input : test->output); + test_out(t_strdup_printf("encode() = \"%s\"", encoded), + strcmp(encoded, output) == 0); } test_end(); } T_END; @@ -171,23 +191,27 @@ valid_path_parse_tests[] = { .input = "<>", .flags = SMTP_ADDRESS_PARSE_FLAG_ALLOW_EMPTY, .address = { .localpart = NULL, .domain = NULL } - },{ + }, + { .input = "", .flags = SMTP_ADDRESS_PARSE_FLAG_ALLOW_LOCALPART, .address = { .localpart = "user", .domain = NULL } - },{ + }, + { .input = "", .address = { .localpart = "user", .domain = "domain.tld" } - },{ + }, + { .input = "<@otherdomain.tld,@yetanotherdomain.tld:user@domain.tld>", .address = { .localpart = "user", .domain = "domain.tld" }, .output = "" - },{ + }, + { .input = "user@domain.tld", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL, .address = { .localpart = "user", .domain = "domain.tld" }, .output = "" - } + }, }; unsigned int valid_path_parse_test_count = @@ -205,41 +229,44 @@ static void test_smtp_path_parse_valid(void) test = &valid_path_parse_tests[i]; ret = smtp_address_parse_path(pool_datastack_create(), - test->input, test->flags, &address, &error); + test->input, test->flags, + &address, &error); test_begin(t_strdup_printf("smtp path valid [%d]", i)); - test_out_reason(t_strdup_printf("parse(\"%s\")", - test->input), ret > 0, error); + test_out_reason(t_strdup_printf("parse(\"%s\")", test->input), + ret > 0, error); if (ret > 0) { if (smtp_address_isnull(address) || - smtp_address_isnull(&test->address)) { + smtp_address_isnull(&test->address)) { test_out("address = <>", - smtp_address_isnull(address) && - smtp_address_isnull(&test->address)); + smtp_address_isnull(address) && + smtp_address_isnull(&test->address)); } else { - test_out(t_strdup_printf - ("address->localpart = \"%s\"", address->localpart), - strcmp(address->localpart, test->address.localpart) == 0); + test_out(t_strdup_printf("address->localpart = \"%s\"", + address->localpart), + strcmp(address->localpart, + test->address.localpart) == 0); } if (smtp_address_isnull(address)) { /* nothing */ } else if (address->domain == NULL || test->address.domain == NULL) { - test_out(t_strdup_printf - ("address->domain = %s", address->domain), + test_out(t_strdup_printf("address->domain = %s", + address->domain), (address->domain == test->address.domain)); } else { - test_out(t_strdup_printf - ("address->domain = \"%s\"", address->domain), - strcmp(address->domain, test->address.domain) == 0); + test_out(t_strdup_printf("address->domain = \"%s\"", + address->domain), + strcmp(address->domain, + test->address.domain) == 0); } encoded = smtp_address_encode_path(address); - output = (test->output == NULL ? test->input : test->output); - test_out( - t_strdup_printf("encode() = \"%s\"", encoded), - strcmp(encoded, output) == 0); + output = (test->output == NULL ? + test->input : test->output); + test_out(t_strdup_printf("encode() = \"%s\"", encoded), + strcmp(encoded, output) == 0); } test_end(); } T_END; @@ -262,66 +289,80 @@ valid_username_parse_tests[] = { .address = { .localpart = "user", .domain = NULL }, - },{ + }, + { .input = "user@domain.tld", .address = { .localpart = "user", .domain = "domain.tld" }, - },{ + }, + { .input = "user@domain.tld", .address = { .localpart = "user", .domain = "domain.tld" }, - },{ + }, + { .input = "1234567890@domain.tld", .address = { .localpart = "1234567890", .domain = "domain.tld" }, - },{ + }, + { .input = "_______@domain.tld", .address = { .localpart = "_______", .domain = "domain.tld" }, - },{ + }, + { .input = "firstname.lastname@domain.tld", .address = { .localpart = "firstname.lastname", .domain = "domain.tld" }, - },{ + }, + { .input = "firstname+lastname@domain.tld", .address = { .localpart = "firstname+lastname", .domain = "domain.tld" }, - },{ + }, + { .input = "firstname-lastname@domain.tld", .address = { .localpart = "firstname-lastname", .domain = "domain.tld" }, - },{ + }, + { .input = "\"user\"@domain.tld", .address = { .localpart = "user", .domain = "domain.tld" }, .output = "user@domain.tld" - },{ + }, + { .input = "\"user@frop\"@domain.tld", .address = { .localpart = "user@frop", .domain = "domain.tld" }, .output = "\"user@frop\"@domain.tld" - },{ + }, + { .input = "user@frop@domain.tld", .address = { .localpart = "user@frop", .domain = "domain.tld" }, .output = "\"user@frop\"@domain.tld" - },{ + }, + { .input = "user@127.0.0.1", .address = { .localpart = "user", .domain = "127.0.0.1" }, - },{ + }, + { .input = "user@[127.0.0.1]", .address = { .localpart = "user", .domain = "[127.0.0.1]" }, - },{ + }, + { .input = "user@[IPv6:::1]", .address = { .localpart = "user", .domain = "[IPv6:::1]" }, - },{ + }, + { .input = "user@[IPv6:::127.0.0.1]", .address = { .localpart = "user", .domain = "[IPv6:::127.0.0.1]" }, - } + }, }; unsigned int valid_username_parse_test_count = @@ -339,41 +380,44 @@ static void test_smtp_username_parse_valid(void) test = &valid_username_parse_tests[i]; ret = smtp_address_parse_username(pool_datastack_create(), - test->input, &address, &error); + test->input, + &address, &error); test_begin(t_strdup_printf("smtp username valid [%d]", i)); - test_out_reason(t_strdup_printf("parse(\"%s\")", - test->input), ret > 0, error); + test_out_reason(t_strdup_printf("parse(\"%s\")", test->input), + ret > 0, error); if (ret > 0) { if (smtp_address_isnull(address) || - smtp_address_isnull(&test->address)) { + smtp_address_isnull(&test->address)) { test_out("address = <>", - smtp_address_isnull(address) && - smtp_address_isnull(&test->address)); + smtp_address_isnull(address) && + smtp_address_isnull(&test->address)); } else { - test_out(t_strdup_printf - ("address->localpart = \"%s\"", address->localpart), - strcmp(address->localpart, test->address.localpart) == 0); + test_out(t_strdup_printf("address->localpart = \"%s\"", + address->localpart), + strcmp(address->localpart, + test->address.localpart) == 0); } if (smtp_address_isnull(address)) { /* nothing */ } else if (address->domain == NULL || - test->address.domain == NULL) { - test_out(t_strdup_printf - ("address->domain = %s", address->domain), - (address->domain == test->address.domain)); + test->address.domain == NULL) { + test_out(t_strdup_printf("address->domain = %s", + address->domain), + (address->domain == test->address.domain)); } else { - test_out(t_strdup_printf - ("address->domain = \"%s\"", address->domain), - strcmp(address->domain, test->address.domain) == 0); + test_out(t_strdup_printf("address->domain = \"%s\"", + address->domain), + strcmp(address->domain, + test->address.domain) == 0); } encoded = smtp_address_encode(address); - output = (test->output == NULL ? test->input : test->output); - test_out( - t_strdup_printf("encode() = \"%s\"", encoded), - strcmp(encoded, output) == 0); + output = (test->output == NULL ? + test->input : test->output); + test_out(t_strdup_printf("encode() = \"%s\"", encoded), + strcmp(encoded, output) == 0); } test_end(); } T_END; @@ -392,79 +436,114 @@ static const struct invalid_mailbox_parse_test invalid_mailbox_parse_tests[] = { { .input = "", - }, { + }, + { .input = "user", - }, { + }, + { .input = "\"user@domain.tld", - }, { + }, + { .input = "us\"er@domain.tld", - }, { + }, + { .input = "user@frop@domain.tld", - }, { + }, + { .input = "user@.tld", - }, { + }, + { .input = "user@a$.tld", - }, { + }, + { .input = "user@a..tld", - }, { + }, + { .input = "user@[]", - }, { + }, + { .input = "user@[", - }, { + }, + { .input = "user@[AA]", - }, { + }, + { .input = "user@[AA", - }, { + }, + { .input = "user@[127.0.0]", - }, { + }, + { .input = "user@[256.256.256.256]", - }, { + }, + { .input = "user@[127.0.0.1", - }, { + }, + { .input = "user@[::1]", - }, { + }, + { .input = "user@[IPv6:flierp]", - }, { + }, + { .input = "user@[IPv6:aa:bb::cc::dd]", - }, { + }, + { .input = "user@[IPv6::1]", - }, { + }, + { .input = "user@[IPv6:::1", - }, { + }, + { .input = "user@[Gen:]", - }, { + }, + { .input = "user@[Gen:Hopsa", - }, { + }, + { .input = "user@[Gen-:Hopsa]", - }, { + }, + { .input = "#@%^%#$@#$@#.com", - }, { + }, + { .input = "@example.com", - }, { + }, + { .input = "Eric Mail ", - }, { + }, + { .input = "email.example.com", - }, { + }, + { .input = "email@example@example.com", - }, { + }, + { .input = "あいうえお@example.com", - }, { + }, + { .input = "email@example.com (Eric Mail)", - }, { + }, + { .input = "email@example..com", #if 0 /* These deviations are allowed (maybe implement strict mode) */ - }, { + }, + { .input = "email@-example.com", - }, { + }, + { .input = ".email@example.com", - }, { + }, + { .input = "email.@example.com", - }, { + }, + { .input = "email..email@example.com", - }, { + }, + { .input = "Abc..123@example.com" #endif - } + }, }; unsigned int invalid_mailbox_parse_test_count = @@ -482,11 +561,12 @@ static void test_smtp_mailbox_parse_invalid(void) test = &invalid_mailbox_parse_tests[i]; ret = smtp_address_parse_mailbox(pool_datastack_create(), - test->input, test->flags, &address, &error); + test->input, test->flags, + &address, &error); test_begin(t_strdup_printf("smtp mailbox invalid [%d]", i)); - test_out_reason(t_strdup_printf - ("parse(\"%s\")", test->input), ret < 0, error); + test_out_reason(t_strdup_printf("parse(\"%s\")", test->input), + ret < 0, error); test_end(); } T_END; } @@ -505,179 +585,248 @@ invalid_path_parse_tests[] = { { .input = "", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "\"user@domain.tld", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "us\"er@domain.tld", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@frop@domain.tld", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@.tld", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@a$.tld", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@a..tld", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[]", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[AA]", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[AA", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[127.0.0]", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[256.256.256.256]", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[127.0.0.1", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[::1]", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[IPv6:flierp]", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[IPv6:aa:bb::cc::dd]", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[IPv6::1]", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[IPv6:::1", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[Gen:]", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[Gen:Hopsa", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "user@[Gen-:Hopsa]", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "#@%^%#$@#$@#.com", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "@example.com", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "Eric Mail ", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "email.example.com", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "email@example@example.com", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "あいうえお@example.com", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "email@example.com (Eric Mail)", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "email@example..com", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "@otherdomain.tld,@yetanotherdomain.tld:user@domain.tld", .flags = SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL - }, { + }, + { .input = "<>", - }, { + }, + { .input = "", - }, { + }, + { .input = "<\"user@domain.tld>", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "<#@%^%#$@#$@#.com>", - }, { + }, + { .input = "<@example.com>", - }, { + }, + { .input = "Eric Mail ", - }, { + }, + { .input = "", - }, { + }, + { .input = "", - }, { + }, + { .input = "<あいうえお@example.com>", - }, { + }, + { .input = " (Eric Mail)", - }, { + }, + { .input = "", - }, { + }, + { .input = "input, test->flags, &address, &error); + test->input, test->flags, + &address, &error); test_begin(t_strdup_printf("smtp path invalid [%d]", i)); - test_out_reason(t_strdup_printf - ("parse(\"%s\")", test->input), ret < 0, error); + test_out_reason(t_strdup_printf("parse(\"%s\")", test->input), + ret < 0, error); test_end(); } T_END; } @@ -717,11 +867,13 @@ static const struct invalid_username_parse_test invalid_username_parse_tests[] = { { .input = "frop@$%^$%^.tld", - }, { + }, + { .input = "fr op@domain.tld", - }, { + }, + { .input = "f r o p@domain.tld", - } + }, }; unsigned int invalid_username_parse_test_count = @@ -739,11 +891,12 @@ static void test_smtp_username_parse_invalid(void) test = &invalid_username_parse_tests[i]; ret = smtp_address_parse_username(pool_datastack_create(), - test->input, &address, &error); + test->input, + &address, &error); test_begin(t_strdup_printf("smtp username invalid [%d]", i)); - test_out_reason(t_strdup_printf - ("parse(\"%s\")", test->input), ret < 0, error); + test_out_reason(t_strdup_printf("parse(\"%s\")", test->input), + ret < 0, error); test_end(); } T_END; } @@ -753,11 +906,11 @@ static void test_smtp_username_parse_invalid(void) */ struct address_detail_parse_test { - const char *delimiters; - const char *address; - const char *username; - const char *detail; - char delim; + const char *delimiters; + const char *address; + const char *username; + const char *detail; + char delim; }; static const struct address_detail_parse_test @@ -765,20 +918,24 @@ address_detail_parse_tests[] = { { "", "test", "test", "", '\0' }, { "", "test+address", "test+address", "", '\0' }, { "", "\"test:address\"", "test:address", "", '\0' }, - { "", "\"test-address:another+delim\"", "test-address:another+delim", "", '\0' }, + { "", "\"test-address:another+delim\"", "test-address:another+delim", + "", '\0' }, { "", "test@domain", "test@domain", "", '\0' }, { "", "test+address@domain", "test+address@domain", "", '\0' }, { "", "\"test:address\"@domain", "test:address@domain", "", '\0' }, - { "", "\"test-address:another+delim\"@domain", "test-address:another+delim@domain", "", '\0' }, + { "", "\"test-address:another+delim\"@domain", + "test-address:another+delim@domain", "", '\0' }, { "+-:", "test", "test", "", '\0' }, { "+-:", "test+address", "test", "address", '+' }, { "+-:", "\"test:address\"", "test", "address", ':' }, - { "+-:", "\"test-address:another+delim\"", "test", "address:another+delim", '-' }, + { "+-:", "\"test-address:another+delim\"", + "test", "address:another+delim", '-' }, { "+-:", "test@domain", "test@domain", "", '\0' }, { "+-:", "test+address@domain", "test@domain", "address", '+' }, { "+-:", "\"test:address\"@domain", "test@domain", "address", ':' }, - { "+-:", "\"test-address:another+delim\"@domain", "test@domain", "address:another+delim", '-' } + { "+-:", "\"test-address:another+delim\"@domain", "test@domain", + "address:another+delim", '-' }, }; unsigned int addresss_detail_parse_test_count = @@ -800,15 +957,17 @@ static void test_smtp_address_detail_parse(void) test_begin(t_strdup_printf( "smtp address detail parsing [%d]", i)); - ret = smtp_address_parse_path(pool_datastack_create(), test->address, + ret = smtp_address_parse_path( + pool_datastack_create(), test->address, SMTP_ADDRESS_PARSE_FLAG_ALLOW_LOCALPART | SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL, &address, &error); test_out_reason("address parse", ret > 0, error); if (!test_has_failed()) { - smtp_address_detail_parse_temp(test->delimiters, address, - &username, &delim, &detail); + smtp_address_detail_parse_temp(test->delimiters, + address, &username, + &delim, &detail); test_assert(strcmp(username, test->username) == 0); test_assert(strcmp(detail, test->detail) == 0); test_assert(delim == test->delim);