dovecot-2.2: auth: Fixed test-auth-request-var-expand unit test ...

dovecot at dovecot.org dovecot at dovecot.org
Fri Nov 27 12:42:51 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/cf956e34dc11
changeset: 19425:cf956e34dc11
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Nov 27 14:39:32 2015 +0200
description:
auth: Fixed test-auth-request-var-expand unit test on big endian CPUs

diffstat:

 src/auth/test-auth-request-var-expand.c |  20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diffs (61 lines):

diff -r 9bebd787450f -r cf956e34dc11 src/auth/test-auth-request-var-expand.c
--- 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 at +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 at +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 at -masterdomain1@-masterdomain2",
@@ -88,7 +88,7 @@
 	static const char *test_output =
 		/* %{home} is intentionally always expanding to empty */
 		"+user at +domain1@+domain2\n+user\n+domain1 at +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 at +logindomain1@+logindomain2\n+loginuser\n+logindomain1 at +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 at +masterdomain1@+masterdomain2\n5000\n"
 		"+origuser at +origdomain1@+origdomain2\n+origuser\n+origdomain1 at +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);
 }


More information about the dovecot-cvs mailing list