aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_event.c
AgeCommit message (Collapse)AuthorFilesLines
2011-06-16Merged revisions 323990 via svnmerge from rmudgett1-0/+3
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r323990 | rmudgett | 2011-06-16 13:12:32 -0500 (Thu, 16 Jun 2011) | 5 lines The test_event unit test is occasionally failing. Wait for the special posted event to process before adding a new subscription. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@323991 f38db490-d61c-443f-a65b-d21fe96a405b
2011-06-15Merged revisions 323669-323670 via svnmerge from rmudgett1-22/+65
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r323669 | rmudgett | 2011-06-15 11:43:18 -0500 (Wed, 15 Jun 2011) | 21 lines [regression] Voicemail MWI is no longer sent. When leaving a voicemail, the MWI message is never sent. The same thing happens when checking a voicemail and marking it as read. If you restart Asterisk, everything comes up at that state correctly, but changes to the messages in voicemail causes the light to not be set appropriately. Very easy to reproduce. * Made ast_event_check_subscriber() return TRUE if there are ANY subscribers to an event type when there are no restricting ie values passed. This allows an event being queued to be queued. (closes issue ASTERISK-18002) Reported by: lmadsen Tested by: lmadsen, irroot Patches: jira_asterisk_18002_v1.8.patch uploaded by rmudgett (License #5621) (closes issue ASTERISK-18019) ........ r323670 | rmudgett | 2011-06-15 11:43:31 -0500 (Wed, 15 Jun 2011) | 7 lines Add a test to the event unit tests to catch ASTERISK-18002. The new tests check to see if there are ANY subscribers to the event type when ast_event_check_subscriber() is not passed any specific ie values. (issue ASTERISK-18002) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@323671 f38db490-d61c-443f-a65b-d21fe96a405b
2011-06-03Merged revisions 321871 via svnmerge from rmudgett1-93/+472
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r321871 | rmudgett | 2011-06-03 15:58:13 -0500 (Fri, 03 Jun 2011) | 27 lines Event subscription fixes. Must commit the subscription fixes together with the integration subscription tests. The subscription fixes cause an erroneously passing test to fail. The new subscription tests detect errors without the subscription fixes. * Added missing event_names[] table entry. * Reworked ast_event_check_subscriber()/match_sub_ie_val_to_event() to correctly detect if a subscriber exists for the proposed event. * Made match_ie_val() and match_sub_ie_val_to_event() check the buffer length for RAW payload types. * Fixed error handling memory leak in ast_event_sub_activate(), ast_event_unsubscribe(), and ast_event_queue(). * Made ast_event_new() and ast_event_check_subscriber() better protect themselves from an invalid payload type. * Added container lock protection between removing old cache events and adding the new cached event in ast_event_queue_and_cache()/event_update_cache(). * Added new event subscription tests. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@321872 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-22Merged revisions 292741 via svnmerge from mmichelson1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r292741 | mmichelson | 2010-10-22 12:09:52 -0500 (Fri, 22 Oct 2010) | 12 lines 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. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@292742 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09Kill some startup warnings and errors and make some messages more helpful in ↵tilghman1-2/+2
tracking down the source. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@275105 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-22Add ast_event subscription unit test and fix some ast_event API bugs.russell1-16/+363
This patch introduces another test in test_event.c that exercises most of the subscription related ast_event API calls. I made some minor additions to the existing event allocation test to increase API coverage by the test code. Finally, I made a list in a comment of API calls not yet touched by the test module as a to-do list for future test development. During the development of this test code, I discovered a number of bugs in the event API. 1) subscriptions to AST_EVENT_ALL were not handled appropriately in a couple of different places. The API allows a subscription to all event types, but with IE parameters, just as if it was a subscription to a specific event type. However, the parameters were being ignored. This affected ast_event_check_subscriber() and event distribution to subscribers. 2) Some of the logic in ast_event_check_subscriber() for checking subscriptions against query parameters was wrong. Review: https://reviewboard.asterisk.org/r/617/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258632 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-11fixes some test description formatting inconsistencies so log file looks nicedvossel1-2/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246338 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-10Add a test module for the event API, test_event.c.russell1-0/+194
This module includes a single test so far that creates events using two different methods and does some verification on the result to make sure the correct data can be retrieved from the event that was created. One bug was found in the event API while developing this test, which makes me happy. :-) Review: https://reviewboard.asterisk.org/r/495/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246260 f38db490-d61c-443f-a65b-d21fe96a405b