[asterisk-commits] dvossel: branch dvossel/sip_uri_encode_decode r242402 - in /team/dvossel/sip_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 22 12:07:30 CST 2010


Author: dvossel
Date: Fri Jan 22 12:07:26 2010
New Revision: 242402

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242402
Log:
addition of error str messages to encode/decode unit tests

Modified:
    team/dvossel/sip_uri_encode_decode/channels/chan_sip.c
    team/dvossel/sip_uri_encode_decode/main/test_utils.c

Modified: team/dvossel/sip_uri_encode_decode/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/sip_uri_encode_decode/channels/chan_sip.c?view=diff&rev=242402&r1=242401&r2=242402
==============================================================================
--- team/dvossel/sip_uri_encode_decode/channels/chan_sip.c (original)
+++ team/dvossel/sip_uri_encode_decode/channels/chan_sip.c Fri Jan 22 12:07:26 2010
@@ -14662,6 +14662,7 @@
 	ast_test_status_update(&args->status_update, "display-name1: %s\nafter: %s\n", dname, after_dname);
 	if (strcmp(dname, " quoted-text internal \" quote ")) {
 		ast_test_status_update(&args->status_update, "display-name1 test failed\n");
+		ast_str_append(&args->ast_test_error_str, 0, "quoted-text with internal backslash decode failed: \n");
 		res = AST_TEST_FAIL;
 	}
 
@@ -14670,6 +14671,7 @@
 	ast_test_status_update(&args->status_update, "display-name2: %s\nafter: %s\n", dname, after_dname);
 	if (strcmp(dname, "token text with no quotes")) {
 		ast_test_status_update(&args->status_update, "display-name2 test failed\n");
+		ast_str_append(&args->ast_test_error_str, 0, "token text with decode failed: \n");
 		res = AST_TEST_FAIL;
 	}
 
@@ -14678,6 +14680,7 @@
 	ast_test_status_update(&args->status_update, "overflow display-name1: %s\nafter: %s\n", dname, after_dname);
 	if (*dname != '\0' && after_dname != overflow1) {
 		ast_test_status_update(&args->status_update, "overflow display-name1 test failed\n");
+		ast_str_append(&args->ast_test_error_str, 0, "quoted-text buffer overflow check failed: \n");
 		res = AST_TEST_FAIL;
 	}
 
@@ -14686,6 +14689,7 @@
 	ast_test_status_update(&args->status_update, "noendquote display-name1: %s\nafter: %s\n", dname, after_dname);
 	if (*dname != '\0' && after_dname != noendquote) {
 		ast_test_status_update(&args->status_update, "no end quote for quoted-text display-name failed\n");
+		ast_str_append(&args->ast_test_error_str, 0, "quoted-text buffer check no terminating end quote failed. \n");
 		res = AST_TEST_FAIL;
 	}
 	return res;

Modified: team/dvossel/sip_uri_encode_decode/main/test_utils.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/sip_uri_encode_decode/main/test_utils.c?view=diff&rev=242402&r1=242401&r2=242402
==============================================================================
--- team/dvossel/sip_uri_encode_decode/main/test_utils.c (original)
+++ team/dvossel/sip_uri_encode_decode/main/test_utils.c Fri Jan 22 12:07:26 2010
@@ -59,6 +59,7 @@
 	ast_test_status_update(&args->status_update, "Output after enabling do_special_char:\n%s\n", out);
 	if (strcmp(expected1, out)) {
 		ast_test_status_update(&args->status_update, "ENCODE DOES NOT MATCH EXPECTED, FAIL\n");
+		ast_str_append(&args->ast_test_error_str, 0, "enable do_special_char test encode failed: \n");
 		res = AST_TEST_FAIL;
 	}
 
@@ -66,6 +67,7 @@
 	ast_uri_decode(out);
 	if (strcmp(in, out)) {
 		ast_test_status_update(&args->status_update, "Decoded string did not match original input\n\n");
+		ast_str_append(&args->ast_test_error_str, 0, "enable do_special_char test decode failed: \n");
 		res = AST_TEST_FAIL;
 	} else {
 		ast_test_status_update(&args->status_update, "Decoded string matched original input\n\n");
@@ -77,6 +79,7 @@
 	ast_test_status_update(&args->status_update, "Output after disabling do_special_char:\n%s\n", out);
 	if (strcmp(expected2, out)) {
 		ast_test_status_update(&args->status_update, "ENCODE DOES NOT MATCH EXPECTED, FAIL\n");
+		ast_str_append(&args->ast_test_error_str, 0, "no do_special_char test encode failed: \n");
 		res = AST_TEST_FAIL;
 	}
 
@@ -84,6 +87,7 @@
 	ast_uri_decode(out);
 	if (strcmp(in, out)) {
 		ast_test_status_update(&args->status_update, "Decoded string did not match original input\n\n");
+		ast_str_append(&args->ast_test_error_str, 0, "no do_special_char test decode failed\n");
 		res = AST_TEST_FAIL;
 	} else {
 		ast_test_status_update(&args->status_update, "Decoded string matched original input\n\n");




More information about the asterisk-commits mailing list