Index: pjproject/trunk/pjnath/src/pjnath-test/ice_test.c
===================================================================
--- pjproject/trunk/pjnath/src/pjnath-test/ice_test.c	(revision 4412)
+++ pjproject/trunk/pjnath/src/pjnath-test/ice_test.c	(revision 4728)
@@ -1,4 +1,4 @@
 /* $Id$ */
-/* 
+/*
  * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
@@ -16,5 +16,5 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include "test.h"
@@ -113,9 +113,9 @@
 
 static void ice_on_rx_data(pj_ice_strans *ice_st,
-			   unsigned comp_id, 
+			   unsigned comp_id,
 			   void *pkt, pj_size_t size,
 			   const pj_sockaddr_t *src_addr,
 			   unsigned src_addr_len);
-static void ice_on_ice_complete(pj_ice_strans *ice_st, 
+static void ice_on_ice_complete(pj_ice_strans *ice_st,
 			        pj_ice_strans_op op,
 			        pj_status_t status);
@@ -202,5 +202,5 @@
     return PJ_SUCCESS;
 }
-			     
+
 /* Create test session */
 static int create_sess(pj_stun_config *stun_cfg,
@@ -239,5 +239,5 @@
 	return -10;
     }
-    sess->server->turn_respond_allocate = 
+    sess->server->turn_respond_allocate =
 	sess->server->turn_respond_refresh = PJ_TRUE;
 
@@ -319,5 +319,5 @@
 
 static void ice_on_rx_data(pj_ice_strans *ice_st,
-			   unsigned comp_id, 
+			   unsigned comp_id,
 			   void *pkt, pj_size_t size,
 			   const pj_sockaddr_t *src_addr,
@@ -336,5 +336,5 @@
 
 
-static void ice_on_ice_complete(pj_ice_strans *ice_st, 
+static void ice_on_ice_complete(pj_ice_strans *ice_st,
 			        pj_ice_strans_op op,
 			        pj_status_t status)
@@ -437,5 +437,5 @@
     for (; i<max_cnt; ++i) {
 	if (ept1->cfg.comp_cnt>i &&
-	    pj_ice_strans_get_valid_pair(ept1->ice, i+1) != NULL) 
+	    pj_ice_strans_get_valid_pair(ept1->ice, i+1) != NULL)
 	{
 	    PJ_LOG(3,(THIS_FILE, INDENT "err: ice1 shouldn't have valid pair "
@@ -444,5 +444,5 @@
 	}
 	if (ept2->cfg.comp_cnt>i &&
-	    pj_ice_strans_get_valid_pair(ept2->ice, i+1) != NULL) 
+	    pj_ice_strans_get_valid_pair(ept2->ice, i+1) != NULL)
 	{
 	    PJ_LOG(3,(THIS_FILE, INDENT "err: ice2 shouldn't have valid pair "
@@ -464,5 +464,5 @@
 				    pj_gettimeofday(&t); \
 				    if (expr) { \
-					rc = PJ_SUCCESS; \
+					RC = PJ_SUCCESS; \
 					break; \
 				    } \
@@ -478,5 +478,5 @@
     struct test_sess *sess = (struct test_sess *) data;
     pj_stun_config *stun_cfg = sess->stun_cfg;
-    
+
     /* Wait until negotiation is complete on both endpoints */
 #define ALL_DONE    (sess->param->worker_quit || \
@@ -484,5 +484,5 @@
 			 sess->callee.result.nego_status!=PJ_EPENDING))
     WAIT_UNTIL(sess->param->worker_timeout, ALL_DONE, rc);
-    
+    PJ_UNUSED_ARG(rc);
     return 0;
 }
@@ -539,5 +539,5 @@
     }
     /* Init ICE on caller */
-    rc = pj_ice_strans_init_ice(sess->caller.ice, sess->caller.cfg.role, 
+    rc = pj_ice_strans_init_ice(sess->caller.ice, sess->caller.cfg.role,
 				&sess->caller.ufrag, &sess->caller.pass);
     if (rc != PJ_SUCCESS) {
@@ -548,5 +548,5 @@
 
     /* Init ICE on callee */
-    rc = pj_ice_strans_init_ice(sess->callee.ice, sess->callee.cfg.role, 
+    rc = pj_ice_strans_init_ice(sess->callee.ice, sess->callee.cfg.role,
 				&sess->callee.ufrag, &sess->callee.pass);
     if (rc != PJ_SUCCESS) {
@@ -597,5 +597,5 @@
 	goto on_destroy;
     }
-    
+
     WAIT_UNTIL(30000, ALL_DONE, rc);
     if (!ALL_DONE) {
@@ -691,5 +691,5 @@
 	struct test_cfg	 ua1;
 	struct test_cfg	 ua2;
-    } sess_cfg[] = 
+    } sess_cfg[] =
     {
 	/*  Role    comp#   host?   stun?   turn?   flag?  ans_del snd_del des_del */
@@ -741,5 +741,5 @@
     /* Simple test first with host candidate */
     if (1) {
-	struct sess_cfg_t cfg = 
+	struct sess_cfg_t cfg =
 	{
 	    "Basic with host candidates",
@@ -750,5 +750,5 @@
 	};
 
-	rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 
+	rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag,
 			  &cfg.ua1, &cfg.ua2);
 	if (rc != 0)
@@ -757,14 +757,14 @@
 	cfg.ua1.comp_cnt = 2;
 	cfg.ua2.comp_cnt = 2;
-	rc = perform_test("Basic with host candidates, 2 components", 
-			  &stun_cfg, cfg.server_flag, 
-			  &cfg.ua1, &cfg.ua2);
-	if (rc != 0)
-	    goto on_return;
-    }
-    
+	rc = perform_test("Basic with host candidates, 2 components",
+			  &stun_cfg, cfg.server_flag,
+			  &cfg.ua1, &cfg.ua2);
+	if (rc != 0)
+	    goto on_return;
+    }
+
     /* Simple test first with srflx candidate */
     if (1) {
-	struct sess_cfg_t cfg = 
+	struct sess_cfg_t cfg =
 	{
 	    "Basic with srflx candidates",
@@ -775,5 +775,5 @@
 	};
 
-	rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 
+	rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag,
 			  &cfg.ua1, &cfg.ua2);
 	if (rc != 0)
@@ -783,6 +783,6 @@
 	cfg.ua2.comp_cnt = 2;
 
-	rc = perform_test("Basic with srflx candidates, 2 components", 
-			  &stun_cfg, cfg.server_flag, 
+	rc = perform_test("Basic with srflx candidates, 2 components",
+			  &stun_cfg, cfg.server_flag,
 			  &cfg.ua1, &cfg.ua2);
 	if (rc != 0)
@@ -792,5 +792,5 @@
     /* Simple test with relay candidate */
     if (1) {
-	struct sess_cfg_t cfg = 
+	struct sess_cfg_t cfg =
 	{
 	    "Basic with relay candidates",
@@ -801,5 +801,5 @@
 	};
 
-	rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 
+	rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag,
 			  &cfg.ua1, &cfg.ua2);
 	if (rc != 0)
@@ -809,6 +809,6 @@
 	cfg.ua2.comp_cnt = 2;
 
-	rc = perform_test("Basic with relay candidates, 2 components", 
-			  &stun_cfg, cfg.server_flag, 
+	rc = perform_test("Basic with relay candidates, 2 components",
+			  &stun_cfg, cfg.server_flag,
 			  &cfg.ua1, &cfg.ua2);
 	if (rc != 0)
@@ -818,5 +818,5 @@
     /* Failure test with STUN resolution */
     if (1) {
-	struct sess_cfg_t cfg = 
+	struct sess_cfg_t cfg =
 	{
 	    "STUN resolution failure",
@@ -835,6 +835,6 @@
 	cfg.ua2.client_flag |= DEL_ON_ERR;
 
-	rc = perform_test("STUN resolution failure with destroy on callback", 
-			  &stun_cfg, cfg.server_flag, 
+	rc = perform_test("STUN resolution failure with destroy on callback",
+			  &stun_cfg, cfg.server_flag,
 			  &cfg.ua1, &cfg.ua2);
 	if (rc != 0)
@@ -844,5 +844,5 @@
     /* Failure test with TURN resolution */
     if (1) {
-	struct sess_cfg_t cfg = 
+	struct sess_cfg_t cfg =
 	{
 	    "TURN allocation failure",
@@ -853,5 +853,5 @@
 	};
 
-	rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 
+	rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag,
 			  &cfg.ua1, &cfg.ua2);
 	if (rc != 0)
@@ -861,6 +861,6 @@
 	cfg.ua2.client_flag |= DEL_ON_ERR;
 
-	rc = perform_test("TURN allocation failure with destroy on callback", 
-			  &stun_cfg, cfg.server_flag, 
+	rc = perform_test("TURN allocation failure with destroy on callback",
+			  &stun_cfg, cfg.server_flag,
 			  &cfg.ua1, &cfg.ua2);
 	if (rc != 0)
@@ -871,5 +871,5 @@
     /* STUN failure, testing TURN deallocation */
     if (1) {
-	struct sess_cfg_t cfg = 
+	struct sess_cfg_t cfg =
 	{
 	    "STUN failure, testing TURN deallocation",
@@ -888,6 +888,6 @@
 	cfg.ua2.client_flag |= DEL_ON_ERR;
 
-	rc = perform_test("STUN failure, testing TURN deallocation (cb)", 
-			  &stun_cfg, cfg.server_flag, 
+	rc = perform_test("STUN failure, testing TURN deallocation (cb)",
+			  &stun_cfg, cfg.server_flag,
 			  &cfg.ua1, &cfg.ua2);
 	if (rc != 0)
@@ -909,5 +909,5 @@
 		pj_ice_sess_role	ua1;
 		pj_ice_sess_role	ua2;
-	    } role[] = 
+	    } role[] =
 	    {
 		{ ROLE1, ROLE2},
@@ -937,6 +937,6 @@
 			char title[120];
 
-			sprintf(title, 
-				"%s/%s, %dms answer delay, %d vs %d components", 
+			sprintf(title,
+				"%s/%s, %dms answer delay, %d vs %d components",
 				pj_ice_sess_role_name(role[j].ua1),
 				pj_ice_sess_role_name(role[j].ua2),
@@ -944,5 +944,5 @@
 
 			cfg->ua2.comp_cnt = k2;
-			rc = perform_test(title, &stun_cfg, cfg->server_flag, 
+			rc = perform_test(title, &stun_cfg, cfg->server_flag,
 					  &cfg->ua1, &cfg->ua2);
 			if (rc != 0)
@@ -1022,5 +1022,5 @@
     unsigned i;
     int rc;
-    
+
     pool = pj_pool_create(mem, NULL, 512, 512, NULL);
     rc = create_stun_config(pool, &stun_cfg);
@@ -1029,5 +1029,5 @@
 	return -7;
     }
-    
+
     for (i = 0; i < LOOP; i++) {
 	PJ_LOG(3,(THIS_FILE, INDENT "Test %d of %d", i+1, LOOP));
@@ -1039,5 +1039,5 @@
     /* Avoid compiler warning */
     goto on_return;
-    
+
 on_return:
     destroy_stun_config(&stun_cfg);
