dovecot-2.2: lib-imap: test-imap-url - quieten successful sub-tests

dovecot at dovecot.org dovecot at dovecot.org
Thu Jul 3 09:46:38 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/55bf79d2e69d
changeset: 17572:55bf79d2e69d
user:      Phil Carmody <phil at dovecot.fi>
date:      Thu Jul 03 12:42:11 2014 +0300
description:
lib-imap: test-imap-url - quieten successful sub-tests
Every sub-component of a URL doesn't need its own successful log, so use the
only-print-on-error test_out_quiet() function instead. All failures are just
as explicit as before.

Signed-off-by: Phil Carmody <phil at dovecot.fi>

diffstat:

 src/lib-imap/test-imap-url.c |  60 ++++++++++++++++++++++----------------------
 1 files changed, 30 insertions(+), 30 deletions(-)

diffs (161 lines):

diff -r 36d07648cec8 -r 55bf79d2e69d src/lib-imap/test-imap-url.c
--- a/src/lib-imap/test-imap-url.c	Thu Jul 03 12:42:11 2014 +0300
+++ b/src/lib-imap/test-imap-url.c	Thu Jul 03 12:42:11 2014 +0300
@@ -630,119 +630,119 @@
 			valid_url_tests[i].url), urlp != NULL, error);
 		if (urlp != NULL) {
 			if (urlp->host_name == NULL || urlt->host_name == NULL) {
-				test_out(t_strdup_printf("url->host_name = %s", urlp->host_name),
+				test_out_quiet(t_strdup_printf("url->host_name = %s", urlp->host_name),
 					urlp->host_name == urlt->host_name);
 			} else {
-				test_out(t_strdup_printf("url->host_name = %s", urlp->host_name),
+				test_out_quiet(t_strdup_printf("url->host_name = %s", urlp->host_name),
 					strcmp(urlp->host_name, urlt->host_name) == 0);
 			}
 			if (urlp->userid == NULL || urlt->userid == NULL) {
-				test_out(t_strdup_printf("url->userid = %s", urlp->userid),
+				test_out_quiet(t_strdup_printf("url->userid = %s", urlp->userid),
 					urlp->userid == urlt->userid);
 			} else {
-				test_out(t_strdup_printf("url->userid = %s", urlp->userid),
+				test_out_quiet(t_strdup_printf("url->userid = %s", urlp->userid),
 					strcmp(urlp->userid, urlt->userid) == 0);
 			}
 			if (urlp->auth_type == NULL || urlt->auth_type == NULL) {
-				test_out(t_strdup_printf("url->auth_type = %s", urlp->auth_type),
+				test_out_quiet(t_strdup_printf("url->auth_type = %s", urlp->auth_type),
 					urlp->auth_type == urlt->auth_type);
 			} else {
-				test_out(t_strdup_printf("url->auth_type = %s", urlp->auth_type),
+				test_out_quiet(t_strdup_printf("url->auth_type = %s", urlp->auth_type),
 					strcmp(urlp->auth_type, urlt->auth_type) == 0);
 			}
 			if (!urlp->have_port) {
-				test_out("url->port = (unspecified)",
+				test_out_quiet("url->port = (unspecified)",
 					urlp->have_port == urlt->have_port);
 			} else {
-				test_out(t_strdup_printf("url->port = %u", urlp->port),
+				test_out_quiet(t_strdup_printf("url->port = %u", urlp->port),
 					urlp->have_port == urlt->have_port && urlp->port == urlt->port);
 			}
 			if (!urlp->have_host_ip) {
-				test_out("url->host_ip = (unspecified)",
+				test_out_quiet("url->host_ip = (unspecified)",
 					urlp->have_host_ip == urlt->have_host_ip);
 			} else {
-				test_out("url->host_ip = (valid)",
+				test_out_quiet("url->host_ip = (valid)",
 					urlp->have_host_ip == urlt->have_host_ip);
 			}
 			if (urlp->mailbox == NULL || urlt->mailbox == NULL) {
-				test_out(t_strdup_printf("url->mailbox = %s", urlp->mailbox),
+				test_out_quiet(t_strdup_printf("url->mailbox = %s", urlp->mailbox),
 					urlp->mailbox == urlt->mailbox);
 			} else {
-				test_out(t_strdup_printf("url->mailbox = %s", urlp->mailbox),
+				test_out_quiet(t_strdup_printf("url->mailbox = %s", urlp->mailbox),
 					strcmp(urlp->mailbox, urlt->mailbox) == 0);
 			}
-			test_out(t_strdup_printf("url->uidvalidity = %u", urlp->uidvalidity),
+			test_out_quiet(t_strdup_printf("url->uidvalidity = %u", urlp->uidvalidity),
 				urlp->uidvalidity == urlt->uidvalidity);
-			test_out(t_strdup_printf("url->uid = %u", urlp->uid),
+			test_out_quiet(t_strdup_printf("url->uid = %u", urlp->uid),
 				urlp->uid == urlt->uid);
 			if (urlp->section == NULL || urlt->section == NULL) {
-				test_out(t_strdup_printf("url->section = %s", urlp->section),
+				test_out_quiet(t_strdup_printf("url->section = %s", urlp->section),
 					urlp->section == urlt->section);
 			} else {
-				test_out(t_strdup_printf("url->section = %s", urlp->section),
+				test_out_quiet(t_strdup_printf("url->section = %s", urlp->section),
 					strcmp(urlp->section, urlt->section) == 0);
 			}
-			test_out(t_strdup_printf("url->partial = %"PRIuUOFF_T".%"PRIuUOFF_T,
+			test_out_quiet(t_strdup_printf("url->partial = %"PRIuUOFF_T".%"PRIuUOFF_T,
 					urlp->partial_offset, urlp->partial_size),
 				urlp->partial_offset == urlt->partial_offset &&
 					urlp->partial_size == urlt->partial_size);
 			if (urlp->search_program == NULL || urlt->search_program == NULL) {
-				test_out(t_strdup_printf(
+				test_out_quiet(t_strdup_printf(
 						"url->search_program = %s", urlp->search_program),
 					urlp->search_program == urlt->search_program);
 			} else {
-				test_out(t_strdup_printf(
+				test_out_quiet(t_strdup_printf(
 						"url->search_program = %s", urlp->search_program),
 					strcmp(urlp->search_program, urlt->search_program) == 0);
 			}
 			if (urlt->uauth_rumpurl != NULL) {
 				if (urlp->uauth_rumpurl == NULL) {
-					test_out(t_strdup_printf(
+					test_out_quiet(t_strdup_printf(
 							"url->uauth_rumpurl = %s", urlp->uauth_rumpurl), FALSE);				
 				} else {
-					test_out(t_strdup_printf(
+					test_out_quiet(t_strdup_printf(
 							"url->uauth_rumpurl = %s", urlp->uauth_rumpurl),
 						strcmp(urlp->uauth_rumpurl, urlt->uauth_rumpurl) == 0);				
 				}
 				if (urlp->uauth_access_application == NULL ||
 					urlt->uauth_access_application == NULL) {
-					test_out(t_strdup_printf("url->uauth_access_application = %s",
+					test_out_quiet(t_strdup_printf("url->uauth_access_application = %s",
 							urlp->uauth_access_application),
 						urlp->uauth_access_application == urlt->uauth_access_application);				
 				} else {
-					test_out(t_strdup_printf("url->uauth_access_application = %s",
+					test_out_quiet(t_strdup_printf("url->uauth_access_application = %s",
 							urlp->uauth_access_application),
 						strcmp(urlp->uauth_access_application,
 							urlt->uauth_access_application) == 0);				
 				}
 				if (urlp->uauth_access_user == NULL ||
 					urlt->uauth_access_user == NULL) {
-					test_out(t_strdup_printf("url->uauth_access_user = %s",
+					test_out_quiet(t_strdup_printf("url->uauth_access_user = %s",
 							urlp->uauth_access_user),
 						urlp->uauth_access_user == urlt->uauth_access_user);				
 				} else {
-					test_out(t_strdup_printf("url->uauth_access_user = %s",
+					test_out_quiet(t_strdup_printf("url->uauth_access_user = %s",
 							urlp->uauth_access_user),
 						strcmp(urlp->uauth_access_user,
 							urlt->uauth_access_user) == 0);				
 				}
 				if (urlp->uauth_mechanism == NULL || urlt->uauth_mechanism == NULL) {
-					test_out(t_strdup_printf(
+					test_out_quiet(t_strdup_printf(
 							"url->uauth_mechanism = %s", urlp->uauth_mechanism),
 						urlp->uauth_mechanism == urlt->uauth_mechanism);				
 				} else {
-					test_out(t_strdup_printf(
+					test_out_quiet(t_strdup_printf(
 							"url->uauth_mechanism = %s", urlp->uauth_mechanism),
 						strcmp(urlp->uauth_mechanism, urlt->uauth_mechanism) == 0);				
 				}
 				if (urlp->uauth_token == NULL || urlt->uauth_token == NULL) {
-					test_out(t_strdup_printf(
+					test_out_quiet(t_strdup_printf(
 							"url->uauth_token = %s", urlp->uauth_token),
 						urlp->uauth_token == urlt->uauth_token);				
 				} else {
 					bool equal = urlp->uauth_token_size == urlt->uauth_token_size;
 					size_t i;
-					test_out(t_strdup_printf(
+					test_out_quiet(t_strdup_printf(
 							"url->uauth_token_size = %"PRIuSIZE_T, urlp->uauth_token_size),
 						equal);
 
@@ -753,7 +753,7 @@
 								break;
 							}
 						}
-						test_out(t_strdup_printf("url->uauth_token [index=%d]", (int)i),
+						test_out_quiet(t_strdup_printf("url->uauth_token [index=%d]", (int)i),
 							equal);
 					}
 				}


More information about the dovecot-cvs mailing list