summaryrefslogtreecommitdiff
path: root/tests/test_event.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-03-02 21:06:12 +0000
committerKinsey Moore <kmoore@digium.com>2012-03-02 21:06:12 +0000
commit8d1bde49a9255ddf5738aa453cb1daf83e7566bb (patch)
treecad2e4977b3fabd2356d7b69e2ec6ee73e46e34f /tests/test_event.c
parent9926662aba1ed9410461cb5eb127a72477ae7fcd (diff)
Fix case-sensitivity for device-specific event subscriptions and CCSS
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
Diffstat (limited to 'tests/test_event.c')
-rw-r--r--tests/test_event.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_event.c b/tests/test_event.c
index 4924e3f20..92fb4ec78 100644
--- a/tests/test_event.c
+++ b/tests/test_event.c
@@ -606,6 +606,25 @@ AST_TEST_DEFINE(event_sub_test)
res = AST_TEST_FAIL;
}
+ /* Make sure that the tech portion of the device string is case-insensitive */
+ sub_res = ast_event_check_subscriber(AST_EVENT_CUSTOM,
+ AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, "foo/bar",
+ AST_EVENT_IE_END);
+ if (sub_res != AST_EVENT_SUB_EXISTS) {
+ ast_test_status_update(test, "Str FOO/bar subscription lacks proper case-sensitivity for device strings\n");
+ res = AST_TEST_FAIL;
+ }
+
+ /* Make sure that the non-tech portion of the device string is case-sensitive
+ * and fails to match appropriately */
+ sub_res = ast_event_check_subscriber(AST_EVENT_CUSTOM,
+ AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, "FOO/BAR",
+ AST_EVENT_IE_END);
+ if (sub_res == AST_EVENT_SUB_EXISTS) {
+ ast_test_status_update(test, "Str FOO/bar subscription lacks proper case-sensitivity for device strings\n");
+ res = AST_TEST_FAIL;
+ }
+
sub_res = ast_event_check_subscriber(AST_EVENT_CUSTOM,
AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, "Money",
AST_EVENT_IE_END);