summaryrefslogtreecommitdiff
path: root/tests/test_event.c
AgeCommit message (Collapse)Author
2016-10-27Remove ASTERISK_REGISTER_FILE.Corey Farrell
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes all traces of it. Previously exported symbols removed: * __ast_register_file * __ast_unregister_file * ast_complete_source_filename This also removes the mtx_prof static variable that was declared when MTX_PROFILE was enabled. This variable was only used in lock.c so it is now initialized in that file only. ASTERISK-26480 #close Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2015-04-13git migration: Refactor the ASTERISK_FILE_VERSION macroMatt Jordan
Git does not support the ability to replace a token with a version string during check-in. While it does have support for replacing a token on clone, this is somewhat sub-optimal: the token is replaced with the object hash, which is not particularly easy for human consumption. What's more, in practice, the source file version was often not terribly useful. Generally, when triaging bugs, the overall version of Asterisk is far more useful than an individual SVN version of a file. As a result, this patch removes Asterisk's support for showing source file versions. Specifically, it does the following: * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and remove passing the version in with the macro. Other facilities than 'core show file version' make use of the file names, such as setting a debug level only on a specific file. As such, the act of registering source files with the Asterisk core still has use. The macro rename now reflects the new macro purpose. * main/asterisk: - Refactor the file_version structure to reflect that it no longer tracks a version field. - Remove the "core show file version" CLI command. Without the file version, it is no longer useful. - Remove the ast_file_version_find function. The file version is no longer tracked. - Rename ast_register_file_version/ast_unregister_file_version to ast_register_file/ast_unregister_file, respectively. * main/manager: Remove value from the Version key of the ModuleCheck Action. The actual key itself has not been removed, as doing so would absolutely constitute a backwards incompatible change. However, since the file version is no longer tracked, there is no need to attempt to include it in the Version key. * UPGRADE: Add notes for: - Modification to the ModuleCheck AMI Action - Removal of the "core show file version" CLI command Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2014-07-22Fix more dev-mode build issuesKinsey Moore
........ Merged revisions 419129 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 419162 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 419163 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17Refactor CEL to avoid using the event system coreKinsey Moore
This removes usage of the event system for CEL backend data distribution and strips unused pieces out of the event system. Review: https://reviewboard.asterisk.org/r/2732/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17Strip down the old event systemKinsey Moore
This removes unused code, event types, IE pltypes, and event IE types where possible and makes several functions private that were once public. This includes a renumbering of the remaining event and IE types which breaks binary compatibility with previous versions. The last remaining consumers of the old event system (or parts thereof) are main/security_events.c, res/res_security_log.c, tests/test_cel.c, tests/test_event.c, main/cel.c, and the CEL backends. Review: https://reviewboard.asterisk.org/r/2703/ (closes issue ASTERISK-22139) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-30Fix ast_event_new unit test.Russell Bryant
One of my recent commits broke this test. The error was: [test_event.c:event_new_test:214]: Events expected to be identical have different size: 69 != 59 The difference in size occurred because the first event had the EID IE added to the event twice. ast_event_new() now always adds it automatically. Previously it only added it if there were no IEs specified, which was kind of weird. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02Fix case-sensitivity for device-specific event subscriptions and CCSSKinsey Moore
This change fixes case-sensitivity for device-specific subscriptions such that the technology identifier is case-insensitive while the remainder of the device string is still case-sensitive. This should also preserve the original case of the device string as passed in to the event system. CCSS is the only feature affected as it is the only consumer of device-specific event subscriptions. The second part of this patch addresses similar case-sensitivity issues within CCSS itself that prevented it from functioning correctly after the fix to the events system. This adds a unit test to verify that the event system works as expected. (closes issue ASTERISK-19422) Review: https://reviewboard.asterisk.org/r/1780/ ........ Merged revisions 357940 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 357941 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-16Merged revisions 332177 via svnmerge from Paul Belanger
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r332177 | pabelanger | 2011-08-16 16:11:49 -0400 (Tue, 16 Aug 2011) | 11 lines Merged revisions 332176 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r332176 | pabelanger | 2011-08-16 16:10:13 -0400 (Tue, 16 Aug 2011) | 4 lines Flag test modules as 'core' Review: https://reviewboard.asterisk.org/r/1369/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14Merged revisions 328247 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce <support_level> tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-16Merged revisions 323990 via svnmerge from Richard Mudgett
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: https://origsvn.digium.com/svn/asterisk/trunk@323991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-15Merged revisions 323669-323670 via svnmerge from Richard Mudgett
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: https://origsvn.digium.com/svn/asterisk/trunk@323671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-03Merged revisions 321871 via svnmerge from Richard Mudgett
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: https://origsvn.digium.com/svn/asterisk/trunk@321872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22Merged revisions 292741 via svnmerge from Mark Michelson
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: https://origsvn.digium.com/svn/asterisk/trunk@292742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09Kill some startup warnings and errors and make some messages more helpful in ↵Tilghman Lesher
tracking down the source. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-22Add ast_event subscription unit test and fix some ast_event API bugs.Russell Bryant
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: https://origsvn.digium.com/svn/asterisk/trunk@258632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-11fixes some test description formatting inconsistencies so log file looks niceDavid Vossel
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10Add a test module for the event API, test_event.c.Russell Bryant
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: https://origsvn.digium.com/svn/asterisk/trunk@246260 65c4cc65-6c06-0410-ace0-fbb531ad65f3