[asterisk-commits] kmoore: branch 10 r366884 - in /branches/10: ./ channels/sip/config_parser.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 18 09:18:51 CDT 2012


Author: kmoore
Date: Fri May 18 09:18:47 2012
New Revision: 366884

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=366884
Log:
Reorder and renumber tests appropriately

It appears that a patch did not apply properly when adding tests 12 and
13 and test 11 was duplicated.  These tests have been reordered and
renumbered such that they make sense.
........

Merged revisions 366882 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/channels/sip/config_parser.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/channels/sip/config_parser.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/sip/config_parser.c?view=diff&rev=366884&r1=366883&r2=366884
==============================================================================
--- branches/10/channels/sip/config_parser.c (original)
+++ branches/10/channels/sip/config_parser.c Fri May 18 09:18:47 2012
@@ -530,7 +530,48 @@
 	ast_string_field_free_memory(reg);
 	ast_free(reg);
 
-	/* ---Test reg12, add domain port --- */
+	/* ---Test reg 9, missing domain, expected to fail --- */
+	if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
+		goto alloc_fail;
+	} else if (!sip_parse_register_line(reg, default_expiry, reg9, 1)) {
+		ast_test_status_update(test,
+				"Test 9, missing domain, expected to fail but did not.\n");
+		res = AST_TEST_FAIL;
+	}
+	ast_string_field_free_memory(reg);
+	ast_free(reg);
+
+	/* ---Test reg 10,  missing user, expected to fail --- */
+	if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
+		goto alloc_fail;
+	} else if (!sip_parse_register_line(reg, default_expiry, reg10, 1)) {
+		ast_test_status_update(test,
+				"Test 10, missing user expected to fail but did not\n");
+		res = AST_TEST_FAIL;
+	}
+	ast_string_field_free_memory(reg);
+	ast_free(reg);
+
+	/* ---Test reg 11, no registry object, expected to fail--- */
+	if (!sip_parse_register_line(NULL, default_expiry, reg1, 1)) {
+		ast_test_status_update(test,
+				"Test 11, no registry object, expected to fail but did not.\n");
+		res = AST_TEST_FAIL;
+	}
+
+	/* ---Test reg 12,  no registry line, expected to fail --- */
+	if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
+		goto alloc_fail;
+	} else if (!sip_parse_register_line(reg, default_expiry, NULL, 1)) {
+
+		ast_test_status_update(test,
+				"Test 12, NULL register line expected to fail but did not.\n");
+		res = AST_TEST_FAIL;
+	}
+	ast_string_field_free_memory(reg);
+	ast_free(reg);
+
+	/* ---Test reg13, add domain port --- */
 	if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
 		goto alloc_fail;
 	} else if (
@@ -553,13 +594,13 @@
 		reg->callid_valid != FALSE          ||
 		reg->ocseq != INITIAL_CSEQ) {
 
-		ast_test_status_update(test, "Test 12, add domain port failed.\n");
-		res = AST_TEST_FAIL;
-	}
-	ast_string_field_free_memory(reg);
-	ast_free(reg);
-
-	/* ---Test reg13, domain port without secret --- */
+		ast_test_status_update(test, "Test 13, add domain port failed.\n");
+		res = AST_TEST_FAIL;
+	}
+	ast_string_field_free_memory(reg);
+	ast_free(reg);
+
+	/* ---Test reg14, domain port without secret --- */
 	if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
 		goto alloc_fail;
 	} else if (
@@ -582,48 +623,7 @@
 		reg->callid_valid != FALSE          ||
 		reg->ocseq != INITIAL_CSEQ) {
 
-		ast_test_status_update(test, "Test 13, domain port without secret failed.\n");
-		res = AST_TEST_FAIL;
-	}
-	ast_string_field_free_memory(reg);
-	ast_free(reg);
-
-	/* ---Test reg 9, missing domain, expected to fail --- */
-	if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
-		goto alloc_fail;
-	} else if (!sip_parse_register_line(reg, default_expiry, reg9, 1)) {
-		ast_test_status_update(test,
-				"Test 9, missing domain, expected to fail but did not.\n");
-		res = AST_TEST_FAIL;
-	}
-	ast_string_field_free_memory(reg);
-	ast_free(reg);
-
-	/* ---Test reg 10,  missing user, expected to fail --- */
-	if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
-		goto alloc_fail;
-	} else if (!sip_parse_register_line(reg, default_expiry, reg10, 1)) {
-		ast_test_status_update(test,
-				"Test 10, missing user expected to fail but did not\n");
-		res = AST_TEST_FAIL;
-	}
-	ast_string_field_free_memory(reg);
-	ast_free(reg);
-
-	/* ---Test reg 11, no registry object, expected to fail--- */
-	if (!sip_parse_register_line(NULL, default_expiry, reg1, 1)) {
-		ast_test_status_update(test,
-				"Test 11, no registry object, expected to fail but did not.\n");
-		res = AST_TEST_FAIL;
-	}
-
-	/* ---Test reg 11,  no registry line, expected to fail --- */
-	if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
-		goto alloc_fail;
-	} else if (!sip_parse_register_line(reg, default_expiry, NULL, 1)) {
-
-		ast_test_status_update(test,
-				"Test 11, NULL register line expected to fail but did not.\n");
+		ast_test_status_update(test, "Test 14, domain port without secret failed.\n");
 		res = AST_TEST_FAIL;
 	}
 	ast_string_field_free_memory(reg);




More information about the asterisk-commits mailing list