[asterisk-commits] branch russell/codetest r8723 - /team/russell/codetest/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jan 26 11:44:24 MST 2006


Author: russell
Date: Thu Jan 26 12:44:22 2006
New Revision: 8723

URL: http://svn.digium.com/view/asterisk?rev=8723&view=rev
Log:
remove old test that causes chan_sip not to load

Modified:
    team/russell/codetest/channels/chan_sip.c

Modified: team/russell/codetest/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/codetest/channels/chan_sip.c?rev=8723&r1=8722&r2=8723&view=diff
==============================================================================
--- team/russell/codetest/channels/chan_sip.c (original)
+++ team/russell/codetest/channels/chan_sip.c Thu Jan 26 12:44:22 2006
@@ -13156,54 +13156,7 @@
 }
 #endif
 
-#ifdef ENABLE_CODE_TEST
-/* Test call ID generation */
-/* Generate 10.000 call id:s and check if they are identical */
-static int test_callid_uniqueness_func(int fd, int argc, char * const argv[])
-{
-	char *call_ids[10000];
-	char *our_ip="192.168.40.1";
-	char buf[BUFSIZ];
-	int i, j;
-	int errors = 0, localerrors;
-	struct sockaddr_in our_ip_addr;
-	ast_get_ip(&our_ip_addr, our_ip);
-	
-	for (i=0; i < 10000; i++) {
-		localerrors = 0;
-		build_callid(buf, sizeof(buf), our_ip_addr.sin_addr, "edvina.net");
-		for (j = 0; j < i; j++) {
-			if (ast_strlen_zero(buf)) {
-				localerrors++;
-				if (option_debug)
-					ast_log(LOG_DEBUG, "  No call ID generated ?? \n");
-			} else if (!strcmp(buf, call_ids[j])) {
-				localerrors++;
-				if (option_debug)
-					ast_log(LOG_DEBUG, "  Duplicate call ID found. Bad! Now %d errors.\n", localerrors);
-			}
-		}
-		call_ids[i] = strdup(buf);
-		if (localerrors && option_debug)
-			ast_log(LOG_DEBUG, "-- Found %d duplicates for call ID #%d\n", localerrors, i);
-		errors += localerrors;
-	}
-	
-	/* clean up memory allocations */
-	for (i=0; i < 10000; i++) {
-		if (call_ids[i])
-			free(call_ids[i]);
-	}
-
-
-	if (errors && option_debug)
-		ast_log(LOG_DEBUG, "Found %d duplicates among 10.000 generated call IDs\n", errors);
-	return errors;
-}
-#endif
-
 AST_DEFINE_CODE_TEST(test_tags, "tags", test_tags_func);
-AST_DEFINE_CODE_TEST(test_callid_uniqueness, "callid_uniqueness", test_callid_uniqueness_func);
 
 /*! \brief  sip_do_reload: Reload module */
 static int sip_do_reload(enum channelreloadreason reason)
@@ -13360,7 +13313,6 @@
 
 	/* Register code tests */
 	ast_register_codetest(&test_tags);
-	ast_register_codetest(&test_callid_uniqueness);
 
 	sip_poke_all_peers();	
 	sip_send_all_registers();
@@ -13400,7 +13352,6 @@
 
 	/* Unregister Code Tests */
 	ast_unregister_codetest(&test_tags);
-	ast_unregister_codetest(&test_callid_uniqueness);
 
 	if (!ast_mutex_lock(&iflock)) {
 		/* Hangup all interfaces if they have an owner */



More information about the asterisk-commits mailing list