[asterisk-commits] mmichelson: branch 1.8 r292741 - /branches/1.8/tests/test_event.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 22 12:09:55 CDT 2010


Author: mmichelson
Date: Fri Oct 22 12:09:52 2010
New Revision: 292741

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=292741
Log:
Prevent multiple runs of event_sub_test from producing false failure results.

The array of test subscriptions was declared "static," meaning that the
data.count field would retain its value between runs of the test. After the
first test run, this would result in false reports of test failures.

I chose to just remove the "static" keyword from the structure since it's not
a huge deal to construct this structure during each run of the test. Another
alternative would have been to zero out the data.count fields of each test
subscription instead.


Modified:
    branches/1.8/tests/test_event.c

Modified: branches/1.8/tests/test_event.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/tests/test_event.c?view=diff&rev=292741&r1=292740&r2=292741
==============================================================================
--- branches/1.8/tests/test_event.c (original)
+++ branches/1.8/tests/test_event.c Fri Oct 22 12:09:52 2010
@@ -253,7 +253,7 @@
 	struct ast_event *event;
 	int i;
 	enum ast_event_subscriber_res sub_res;
-	static struct {
+	struct {
 		struct ast_event_sub *sub;
 		struct event_sub_data data;
 		const unsigned int expected_count;




More information about the asterisk-commits mailing list