[asterisk-commits] kmoore: branch kmoore/microfilm r396991 - in /team/kmoore/microfilm: main/ te...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 19 22:05:37 CDT 2013


Author: kmoore
Date: Mon Aug 19 22:05:36 2013
New Revision: 396991

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=396991
Log:
Fix a logic error and get the tests working again

Modified:
    team/kmoore/microfilm/main/cel.c
    team/kmoore/microfilm/tests/test_cel.c

Modified: team/kmoore/microfilm/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/microfilm/main/cel.c?view=diff&rev=396991&r1=396990&r2=396991
==============================================================================
--- team/kmoore/microfilm/main/cel.c (original)
+++ team/kmoore/microfilm/main/cel.c Mon Aug 19 22:05:36 2013
@@ -1101,7 +1101,7 @@
 	}
 
 	extra = ast_json_pack("{s: s}", "bridge_id", snapshot->uniqueid);
-	if (extra) {
+	if (!extra) {
 		return;
 	}
 

Modified: team/kmoore/microfilm/tests/test_cel.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/microfilm/tests/test_cel.c?view=diff&rev=396991&r1=396990&r2=396991
==============================================================================
--- team/kmoore/microfilm/tests/test_cel.c (original)
+++ team/kmoore/microfilm/tests/test_cel.c Mon Aug 19 22:05:36 2013
@@ -400,10 +400,11 @@
 
 	do_sleep();
 	ast_bridge_impart(bridge, chan, NULL, NULL, 0);
-
-	do_sleep();
-
-	ast_bridge_depart(chan);
+	CONF_ENTER_EVENT(chan, bridge);
+
+	do_sleep();
+
+	CONF_EXIT(chan, bridge);
 
 	HANGUP_CHANNEL(chan, AST_CAUSE_NORMAL, "");
 
@@ -438,10 +439,11 @@
 
 	do_sleep();
 	ast_bridge_impart(bridge, chan, NULL, NULL, 0);
-
-	do_sleep();
-
-	ast_bridge_depart(chan);
+	CONF_ENTER_EVENT(chan, bridge);
+
+	do_sleep();
+
+	CONF_EXIT(chan, bridge);
 
 	EMULATE_APP_DATA(chan, 3, "Wait", "");
 
@@ -482,6 +484,7 @@
 	ANSWER_CHANNEL(chan_alice);
 	EMULATE_APP_DATA(chan_alice, 2, "Bridge", "");
 
+	CONF_ENTER_EVENT(chan_alice, bridge);
 	ast_bridge_impart(bridge, chan_alice, NULL, NULL, 0);
 	do_sleep();
 
@@ -490,11 +493,10 @@
 
 	ast_bridge_impart(bridge, chan_bob, NULL, NULL, 0);
 	do_sleep();
-	APPEND_EVENT(chan_alice, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_bob));
-
-	ast_bridge_depart(chan_alice);
-	ast_bridge_depart(chan_bob);
-	APPEND_EVENT(chan_alice, AST_CEL_BRIDGE_END, NULL, NULL, ast_channel_name(chan_bob));
+	CONF_ENTER_EVENT(chan_bob, bridge);
+
+	CONF_EXIT(chan_alice, bridge);
+	CONF_EXIT(chan_bob, bridge);
 
 	HANGUP_CHANNEL(chan_alice, AST_CAUSE_NORMAL, "");
 	HANGUP_CHANNEL(chan_bob, AST_CAUSE_NORMAL, "");
@@ -537,16 +539,16 @@
 	EMULATE_APP_DATA(chan_bob, 2, "Bridge", "");
 	do_sleep();
 
+	CONF_ENTER_EVENT(chan_bob, bridge);
 	ast_bridge_impart(bridge, chan_bob, NULL, NULL, 0);
 	do_sleep();
 
 	ast_bridge_impart(bridge, chan_alice, NULL, NULL, 0);
 	do_sleep();
-	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_alice));
-
-	ast_bridge_depart(chan_alice);
-	ast_bridge_depart(chan_bob);
-	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_END, NULL, NULL, ast_channel_name(chan_alice));
+	CONF_ENTER_EVENT(chan_alice, bridge);
+
+	CONF_EXIT(chan_alice, bridge);
+	CONF_EXIT(chan_bob, bridge);
 
 	HANGUP_CHANNEL(chan_alice, AST_CAUSE_NORMAL, "");
 	HANGUP_CHANNEL(chan_bob, AST_CAUSE_NORMAL, "");
@@ -594,6 +596,8 @@
 	do_sleep();
 
 	ast_bridge_impart(bridge, chan_alice, NULL, NULL, 0);
+	do_sleep();
+	CONF_ENTER_EVENT(chan_alice, bridge);
 
 	ANSWER_CHANNEL(chan_bob);
 	EMULATE_APP_DATA(chan_bob, 2, "Bridge", "");
@@ -601,14 +605,14 @@
 
 	ast_bridge_impart(bridge, chan_bob, NULL, NULL, 0);
 	do_sleep();
-	APPEND_EVENT(chan_alice, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_bob));
+	CONF_ENTER_EVENT(chan_bob, bridge);
 
 	ANSWER_CHANNEL(chan_charlie);
 	EMULATE_APP_DATA(chan_charlie, 2, "Bridge", "");
 	do_sleep();
 	ast_bridge_impart(bridge, chan_charlie, NULL, NULL, 0);
 	do_sleep();
-	BRIDGE_TO_CONF(chan_alice, chan_bob, chan_charlie, bridge);
+	CONF_ENTER_EVENT(chan_charlie, bridge);
 
 	CONF_EXIT(chan_alice, bridge);
 	CONF_EXIT(chan_bob, bridge);
@@ -948,13 +952,14 @@
 
 	ast_bridge_impart(bridge, chan_caller, NULL, NULL, 0);
 	do_sleep();
+	CONF_ENTER_EVENT(chan_caller, bridge);
+
 	ast_bridge_impart(bridge, chan_callee, NULL, NULL, 0);
 	do_sleep();
-	APPEND_EVENT(chan_caller, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_callee));
-
-	ast_bridge_depart(chan_caller);
-	ast_bridge_depart(chan_callee);
-	APPEND_EVENT(chan_caller, AST_CEL_BRIDGE_END, NULL, NULL, ast_channel_name(chan_callee));
+	CONF_ENTER_EVENT(chan_callee, bridge);
+
+	CONF_EXIT(chan_caller, bridge);
+	CONF_EXIT(chan_callee, bridge);
 
 	HANGUP_CHANNEL(chan_caller, AST_CAUSE_NORMAL, "ANSWER");
 	HANGUP_CHANNEL(chan_callee, AST_CAUSE_NORMAL, "");
@@ -998,13 +1003,14 @@
 	do_sleep();
 	ast_bridge_impart(bridge, chan_callee, NULL, NULL, 0);
 	do_sleep();
+	CONF_ENTER_EVENT(chan_callee, bridge);
+
 	ast_bridge_impart(bridge, chan_caller, NULL, NULL, 0);
 	do_sleep();
-	APPEND_EVENT(chan_callee, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_caller));
-
-	ast_bridge_depart(chan_caller);
-	ast_bridge_depart(chan_callee);
-	APPEND_EVENT(chan_callee, AST_CEL_BRIDGE_END, NULL, NULL, ast_channel_name(chan_caller));
+	CONF_ENTER_EVENT(chan_caller, bridge);
+
+	CONF_EXIT(chan_caller, bridge);
+	CONF_EXIT(chan_callee, bridge);
 
 	HANGUP_CHANNEL(chan_caller, AST_CAUSE_NORMAL, "ANSWER");
 	HANGUP_CHANNEL(chan_callee, AST_CAUSE_NORMAL, "");
@@ -1072,13 +1078,14 @@
 	do_sleep();
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge, chan_charlie, NULL, NULL, 0));
 	do_sleep();
+	CONF_ENTER_EVENT(chan_charlie, bridge);
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge, chan_david, NULL, NULL, 0));
 	do_sleep();
-	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_david));
+	CONF_ENTER_EVENT(chan_david, bridge);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge, chan_bob, NULL, NULL, 0));
 	do_sleep();
-	BRIDGE_TO_CONF(chan_charlie, chan_david, chan_bob, bridge);
+	CONF_ENTER_EVENT(chan_bob, bridge);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge, chan_alice, NULL, NULL, 0));
 	do_sleep();
@@ -1130,10 +1137,11 @@
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge, chan_bob, NULL, NULL, 0));
 	do_sleep();
+	CONF_ENTER_EVENT(chan_bob, bridge);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge, chan_alice, NULL, NULL, 0));
 	do_sleep();
-	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_alice));
+	CONF_ENTER_EVENT(chan_alice, bridge);
 
 	pair.bridge = bridge;
 	pair.channel = chan_alice;
@@ -1141,10 +1149,8 @@
 		&pair, "transfer_context", "transfer_extension");
 	BLINDTRANSFER_EVENT(chan_alice, bridge, "transfer_extension", "transfer_context");
 
-	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_END, NULL, NULL, ast_channel_name(chan_alice));
-	ast_test_validate(test, 0 == ast_bridge_depart(chan_alice));
-
-	ast_test_validate(test, 0 == ast_bridge_depart(chan_bob));
+	CONF_EXIT(chan_alice, bridge);
+	CONF_EXIT(chan_bob, bridge);
 
 	HANGUP_CHANNEL(chan_alice, AST_CAUSE_NORMAL, "");
 	do_sleep();
@@ -1190,10 +1196,11 @@
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_bob, NULL, NULL, 0));
 	do_sleep();
+	CONF_ENTER_EVENT(chan_bob, bridge1);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_alice, NULL, NULL, 0));
 	do_sleep();
-	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_alice));
+	CONF_ENTER_EVENT(chan_alice, bridge1);
 
 	/* Create second set of bridged parties */
 	bridge2 = ast_bridge_basic_new();
@@ -1206,19 +1213,22 @@
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_charlie, NULL, NULL, 0));
 	do_sleep();
+	CONF_ENTER_EVENT(chan_charlie, bridge2);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_david, NULL, NULL, 0));
 	do_sleep();
-	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_david));
+	CONF_ENTER_EVENT(chan_david, bridge2);
+	CONF_EXIT_EVENT(chan_bob, bridge1);
+	do_sleep();
 
 	/* Perform attended transfer */
-	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_END, NULL, NULL, ast_channel_name(chan_alice));
-
 	ast_bridge_transfer_attended(chan_alice, chan_david);
 	do_sleep();
+	CONF_ENTER_EVENT(chan_bob, bridge2);
+
 	CONF_EXIT_EVENT(chan_david, bridge2);
-
 	ATTENDEDTRANSFER_BRIDGE(chan_alice, bridge1, chan_david, bridge2);
+	CONF_EXIT_EVENT(chan_alice, bridge1);
 
 	do_sleep();
 	CONF_EXIT(chan_bob, bridge2);
@@ -1274,10 +1284,11 @@
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_bob, NULL, NULL, 0));
 	do_sleep();
+	CONF_ENTER_EVENT(chan_bob, bridge1);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_alice, NULL, NULL, 0));
 	do_sleep();
-	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_alice));
+	CONF_ENTER_EVENT(chan_alice, bridge1);
 
 	/* Create second set of bridged parties */
 	bridge2 = ast_bridge_base_new(AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE | AST_BRIDGE_CAPABILITY_MULTIMIX,
@@ -1291,16 +1302,18 @@
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_charlie, NULL, NULL, 0));
 	do_sleep();
+	CONF_ENTER_EVENT(chan_charlie, bridge2);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_david, NULL, NULL, 0));
 	do_sleep();
-	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_david));
+	CONF_ENTER_EVENT(chan_david, bridge2);
 
 	/* Perform attended transfer */
-	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_END, NULL, NULL, ast_channel_name(chan_david));
-
 	ast_bridge_transfer_attended(chan_alice, chan_david);
 	do_sleep();
+	CONF_EXIT_EVENT(chan_charlie, bridge2);
+	CONF_ENTER_EVENT(chan_charlie, bridge1);
+	CONF_EXIT_EVENT(chan_david, bridge2);
 	CONF_EXIT_EVENT(chan_alice, bridge1);
 
 	ATTENDEDTRANSFER_BRIDGE(chan_alice, bridge1, chan_david, bridge2);
@@ -1361,10 +1374,11 @@
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_bob, NULL, NULL, 0));
 	do_sleep();
+	CONF_ENTER_EVENT(chan_bob, bridge1);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge1, chan_alice, NULL, NULL, 0));
 	do_sleep();
-	APPEND_EVENT(chan_bob, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_alice));
+	CONF_ENTER_EVENT(chan_alice, bridge1);
 
 	/* Create second set of bridged parties */
 	bridge2 = ast_bridge_base_new(AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE | AST_BRIDGE_CAPABILITY_MULTIMIX,
@@ -1380,10 +1394,11 @@
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_charlie, NULL, NULL, 0));
 	do_sleep();
+	CONF_ENTER_EVENT(chan_charlie, bridge2);
 
 	ast_test_validate(test, 0 == ast_bridge_impart(bridge2, chan_david, NULL, NULL, 0));
 	do_sleep();
-	APPEND_EVENT(chan_charlie, AST_CEL_BRIDGE_START, NULL, NULL, ast_channel_name(chan_david));
+	CONF_ENTER_EVENT(chan_david, bridge2);
 
 	/* Perform attended transfer */
 
@@ -1396,22 +1411,16 @@
 
 	ATTENDEDTRANSFER_BRIDGE(chan_alice, bridge1, chan_david, bridge2);
 
-	/* The two BRIDGE_TO_CONFs and CONF_EXITs are all racing to be first */
-
-	/* BRIDGE_TO_CONF with primary charlie, peer david, and trigger channel ;2 */
+	ast_bridge_transfer_attended(chan_alice, chan_david);
+	do_sleep();
+
+	/* ;1 and ;2 BRIDGE_ENTER and ;1 ANSWER */
 	APPEND_DUMMY_EVENT();
-
-	ast_bridge_transfer_attended(chan_alice, chan_david);
-	do_sleep();
-
-	/* BRIDGE_TO_CONF with primary bob, peer alice, and trigger channel ;1 */
+	APPEND_DUMMY_EVENT();
 	APPEND_DUMMY_EVENT();
 
 	/* CONF_EXIT alice and david */
 	APPEND_DUMMY_EVENT();
-	APPEND_DUMMY_EVENT();
-
-	/* ANSWER ;1 */
 	APPEND_DUMMY_EVENT();
 
 	do_sleep();




More information about the asterisk-commits mailing list