[asterisk-commits] kmoore: branch kmoore/cel_cleanup r393409 - in /team/kmoore/cel_cleanup: incl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 2 08:47:29 CDT 2013


Author: kmoore
Date: Tue Jul  2 08:47:25 2013
New Revision: 393409

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393409
Log:
Update comments and shuffle things around

Modified:
    team/kmoore/cel_cleanup/include/asterisk/cel.h
    team/kmoore/cel_cleanup/tests/test_cel.c

Modified: team/kmoore/cel_cleanup/include/asterisk/cel.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_cleanup/include/asterisk/cel.h?view=diff&rev=393409&r1=393408&r2=393409
==============================================================================
--- team/kmoore/cel_cleanup/include/asterisk/cel.h (original)
+++ team/kmoore/cel_cleanup/include/asterisk/cel.h Tue Jul  2 08:47:25 2013
@@ -270,7 +270,10 @@
 	);
 	int enable;			/*!< Whether CEL is enabled */
 	int64_t events;			/*!< The events to be logged */
-	struct ao2_container *apps;	/*!< The apps for which to log app start and end events */
+	/*! The apps for which to log app start and end events. This is
+	 * ast_str_container_alloc()ed and filled with ao2-allocated
+	 * char* which are all-lowercase application names. */
+	struct ao2_container *apps;
 };
 
 /*!

Modified: team/kmoore/cel_cleanup/tests/test_cel.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_cleanup/tests/test_cel.c?view=diff&rev=393409&r1=393408&r2=393409
==============================================================================
--- team/kmoore/cel_cleanup/tests/test_cel.c (original)
+++ team/kmoore/cel_cleanup/tests/test_cel.c Tue Jul  2 08:47:25 2013
@@ -1298,9 +1298,12 @@
 }
 
 /*!
- * \internal \brief Callback function called after each test executes
+ * \internal \brief Callback function called after each test executes.
+ * In addition to cleanup, this function also performs verification
+ * that the events received during a test match the events that were
+ * expected to have been generated during the test.
  */
-static int test_cel_cleanup_cb(struct ast_test_info *info, struct ast_test *test)
+static int cel_verify_and_cleanup_cb(struct ast_test_info *info, struct ast_test *test)
 {
 	struct ast_event *sync;
 	RAII_VAR(struct ao2_container *, local_expected, cel_expected_events, ao2_cleanup);
@@ -1412,6 +1415,13 @@
 	cel_test_config->events |= 1<<AST_CEL_CONF_ENTER;
 	cel_test_config->events |= 1<<AST_CEL_CONF_EXIT;
 
+	ast_test_register_init(TEST_CATEGORY, test_cel_init_cb);
+
+	/* Verify received vs expected events and clean things up after every test */
+	ast_test_register_cleanup(TEST_CATEGORY, cel_verify_and_cleanup_cb);
+
+	ast_channel_register(&test_cel_chan_tech);
+
 	AST_TEST_REGISTER(test_cel_channel_creation);
 	AST_TEST_REGISTER(test_cel_unanswered_inbound_call);
 	AST_TEST_REGISTER(test_cel_unanswered_outbound_call);
@@ -1434,11 +1444,6 @@
 	AST_TEST_REGISTER(test_cel_dial_answer_twoparty_bridge_b);
 	AST_TEST_REGISTER(test_cel_dial_answer_multiparty);
 
-	ast_test_register_init(TEST_CATEGORY, test_cel_init_cb);
-	ast_test_register_cleanup(TEST_CATEGORY, test_cel_cleanup_cb);
-
-	ast_channel_register(&test_cel_chan_tech);
-
 	return AST_MODULE_LOAD_SUCCESS;
 }
 




More information about the asterisk-commits mailing list