]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Prevent multiple runs of event_sub_test from producing false failure results.
authorMark Michelson <mmichelson@digium.com>
Fri, 22 Oct 2010 17:09:52 +0000 (17:09 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 22 Oct 2010 17:09:52 +0000 (17:09 +0000)
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.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292741 65c4cc65-6c06-0410-ace0-fbb531ad65f3

tests/test_event.c

index 82ef29bb3716178fdc0622948eb090adb6798892..4331d742f3ee0375d83848346aa349d246fc050a 100644 (file)
@@ -253,7 +253,7 @@ AST_TEST_DEFINE(event_sub_test)
        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;