Mercurial > dovecot > core-2.2
changeset 19425:cf956e34dc11
auth: Fixed test-auth-request-var-expand unit test on big endian CPUs
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 27 Nov 2015 14:39:32 +0200 |
parents | 9bebd787450f |
children | 2ddbdf05b19b |
files | src/auth/test-auth-request-var-expand.c |
diffstat | 1 files changed, 13 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auth/test-auth-request-var-expand.c Fri Nov 27 14:24:23 2015 +0200 +++ b/src/auth/test-auth-request-var-expand.c Fri Nov 27 14:39:32 2015 +0200 @@ -22,12 +22,12 @@ .userdb = &test_userdb }; -static const struct auth_request default_test_request = { +static struct auth_request default_test_request = { .user = "-user@+domain1@+domain2", .service = "-service", - .local_ip = { .family = AF_INET, .u.ip4.s_addr = 123456789 }, - .remote_ip = { .family = AF_INET, .u.ip4.s_addr = 1234567890 }, + .local_ip = { .family = AF_INET }, + .remote_ip = { .family = AF_INET }, .client_pid = 54321, .mech_password = "-password", .mech_name = "-mech", @@ -38,8 +38,8 @@ .requested_login_user = "-loginuser@+logindomain1@+logindomain2", .session_id = "-session", - .real_local_ip = { .family = AF_INET, .u.ip4.s_addr = 223456788 }, - .real_remote_ip = { .family = AF_INET, .u.ip4.s_addr = 223456789 }, + .real_local_ip = { .family = AF_INET }, + .real_remote_ip = { .family = AF_INET }, .real_local_port = 200, .real_remote_port = 201, .master_user = "-masteruser@-masterdomain1@-masterdomain2", @@ -88,7 +88,7 @@ static const char *test_output = /* %{home} is intentionally always expanding to empty */ "+user@+domain1@+domain2\n+user\n+domain1@+domain2\n+service\n\n" - "21.205.91.7\n210.2.150.73\n54321\n+password\n+mech\nsecured\n" + "7.91.205.21\n73.150.2.210\n54321\n+password\n+mech\nsecured\n" "21\n210\nvalid\n"; string_t *str = t_str_new(256); @@ -146,7 +146,7 @@ "%{orig_user}\n%{orig_username}\n%{orig_domain}\n"; static const char *test_output = "+loginuser@+logindomain1@+logindomain2\n+loginuser\n+logindomain1@+logindomain2\n+session\n" - "20.174.81.13\n21.174.81.13\n200\n201\n" + "13.81.174.20\n13.81.174.21\n200\n201\n" "+masteruser@+masterdomain1@+masterdomain2\n5000\n" "+origuser@+origdomain1@+origdomain2\n+origuser\n+origdomain1@+origdomain2\n"; string_t *str = t_str_new(256); @@ -234,6 +234,12 @@ test_auth_request_var_expand_funcs, NULL }; + + default_test_request.local_ip.u.ip4.s_addr = htonl(123456789); + default_test_request.remote_ip.u.ip4.s_addr = htonl(1234567890); + default_test_request.real_local_ip.u.ip4.s_addr = htonl(223456788); + default_test_request.real_remote_ip.u.ip4.s_addr = htonl(223456789); + test_request = default_test_request; return test_run(test_functions); }