[asterisk-commits] kmoore: branch kmoore/event_system_strip r395396 - in /team/kmoore/event_syst...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 25 08:37:47 CDT 2013


Author: kmoore
Date: Thu Jul 25 08:37:46 2013
New Revision: 395396

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395396
Log:
Remove bitflags support, finish removing EID IE, and fixup tests

Modified:
    team/kmoore/event_system_strip/include/asterisk/event.h
    team/kmoore/event_system_strip/include/asterisk/event_defs.h
    team/kmoore/event_system_strip/main/event.c
    team/kmoore/event_system_strip/tests/test_cel.c
    team/kmoore/event_system_strip/tests/test_event.c

Modified: team/kmoore/event_system_strip/include/asterisk/event.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/event_system_strip/include/asterisk/event.h?view=diff&rev=395396&r1=395395&r2=395396
==============================================================================
--- team/kmoore/event_system_strip/include/asterisk/event.h (original)
+++ team/kmoore/event_system_strip/include/asterisk/event.h Thu Jul 25 08:37:46 2013
@@ -160,20 +160,6 @@
 	enum ast_event_ie_type ie_type, uint32_t uint);
 
 /*!
- * \brief Append a bitflags parameter to a subscription
- *
- * \param sub the dynamic subscription allocated with ast_event_subscribe_new()
- * \param ie_type the information element type for the parameter
- * \param flags the flags that must be present in the event to match this subscription
- *
- * \retval 0 success
- * \retval non-zero failure
- * \since 1.8
- */
-int ast_event_sub_append_ie_bitflags(struct ast_event_sub *sub,
-	enum ast_event_ie_type ie_type, uint32_t flags);
-
-/*!
  * \brief Append a string parameter to a subscription
  *
  * \param sub the dynamic subscription allocated with ast_event_subscribe_new()
@@ -413,24 +399,6 @@
 	uint32_t data);
 
 /*!
- * \brief Append an information element that has a bitflags payload
- *
- * \param event the event that the IE will be appended to
- * \param ie_type the type of IE to append
- * \param bitflags the flags that are the payload of the IE
- *
- * \retval 0 success
- * \retval -1 failure
- * \since 1.8
- *
- * The pointer to the event will get updated with the new location for the event
- * that now contains the appended information element.  If the re-allocation of
- * the memory for this event fails, it will be set to NULL.
- */
-int ast_event_append_ie_bitflags(struct ast_event **event, enum ast_event_ie_type ie_type,
-	uint32_t bitflags);
-
-/*!
  * \brief Append an information element that has a raw payload
  *
  * \param event the event that the IE will be appended to
@@ -461,18 +429,6 @@
 uint32_t ast_event_get_ie_uint(const struct ast_event *event, enum ast_event_ie_type ie_type);
 
 /*!
- * \brief Get the value of an information element that has a bitflags payload
- *
- * \param event The event to get the IE from
- * \param ie_type the type of information element to retrieve
- *
- * \return This returns the payload of the information element with the given type.
- *         However, an IE with a payload of 0, and the case where no IE is found
- *         yield the same return value.
- */
-uint32_t ast_event_get_ie_bitflags(const struct ast_event *event, enum ast_event_ie_type ie_type);
-
-/*!
  * \brief Get the value of an information element that has a string payload
  *
  * \param event The event to get the IE from
@@ -632,15 +588,6 @@
 uint32_t ast_event_iterator_get_ie_uint(struct ast_event_iterator *iterator);
 
 /*!
- * \brief Get the value of the current IE in the iterator as a bitflags payload
- *
- * \param iterator The iterator instance
- *
- * \return This returns the payload of the information element as bitflags.
- */
-uint32_t ast_event_iterator_get_ie_bitflags(struct ast_event_iterator *iterator);
-
-/*!
  * \brief Get the value of the current IE in the iterator as a string payload
  *
  * \param iterator The iterator instance

Modified: team/kmoore/event_system_strip/include/asterisk/event_defs.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/event_system_strip/include/asterisk/event_defs.h?view=diff&rev=395396&r1=395395&r2=395396
==============================================================================
--- team/kmoore/event_system_strip/include/asterisk/event_defs.h (original)
+++ team/kmoore/event_system_strip/include/asterisk/event_defs.h Thu Jul 25 08:37:46 2013
@@ -217,7 +217,6 @@
 	 * Payload type: RAW
 	 * This IE indicates which server the event originated from
 	 */
-	AST_EVENT_IE_EID                 = 0x0021,
 	AST_EVENT_IE_EVENT_VERSION       = 0x0023,
 	AST_EVENT_IE_SERVICE             = 0x0024,
 	AST_EVENT_IE_MODULE              = 0x0025,
@@ -258,8 +257,6 @@
 	AST_EVENT_IE_PLTYPE_STR,
 	/*! Raw data, compared with memcmp */
 	AST_EVENT_IE_PLTYPE_RAW,
-	/*! Bit flags (unsigned integer, compared using boolean logic) */
-	AST_EVENT_IE_PLTYPE_BITFLAGS,
 };
 
 /*!

Modified: team/kmoore/event_system_strip/main/event.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/event_system_strip/main/event.c?view=diff&rev=395396&r1=395395&r2=395396
==============================================================================
--- team/kmoore/event_system_strip/main/event.c (original)
+++ team/kmoore/event_system_strip/main/event.c Thu Jul 25 08:37:46 2013
@@ -147,7 +147,6 @@
 	[AST_EVENT_IE_EVENTTYPE]           = { AST_EVENT_IE_PLTYPE_UINT, "EventType" },
 	[AST_EVENT_IE_EXISTS]              = { AST_EVENT_IE_PLTYPE_UINT, "Exists" },
 	[AST_EVENT_IE_CONTEXT]             = { AST_EVENT_IE_PLTYPE_STR,  "Context" },
-	[AST_EVENT_IE_EID]                 = { AST_EVENT_IE_PLTYPE_RAW,  "EntityID" },
 	[AST_EVENT_IE_CEL_EVENT_TYPE]      = { AST_EVENT_IE_PLTYPE_UINT, "CELEventType" },
 	[AST_EVENT_IE_CEL_EVENT_TIME]      = { AST_EVENT_IE_PLTYPE_UINT, "CELEventTime" },
 	[AST_EVENT_IE_CEL_EVENT_TIME_USEC] = { AST_EVENT_IE_PLTYPE_UINT, "CELEventTimeUSec" },
@@ -279,7 +278,6 @@
 		ast_free(ie_val->payload.raw);
 		break;
 	case AST_EVENT_IE_PLTYPE_UINT:
-	case AST_EVENT_IE_PLTYPE_BITFLAGS:
 	case AST_EVENT_IE_PLTYPE_EXISTS:
 	case AST_EVENT_IE_PLTYPE_UNKNOWN:
 		break;
@@ -330,13 +328,6 @@
 	switch (sub_ie_val->ie_pltype) {
 	case AST_EVENT_IE_PLTYPE_UINT:
 		res = (sub_ie_val->payload.uint == event_ie_val->payload.uint);
-		break;
-	case AST_EVENT_IE_PLTYPE_BITFLAGS:
-		/*
-		 * If the subscriber has requested *any* of the bitflags we are providing,
-		 * then it's a match.
-		 */
-		res = (sub_ie_val->payload.uint & event_ie_val->payload.uint);
 		break;
 	case AST_EVENT_IE_PLTYPE_STR:
 	{
@@ -397,10 +388,6 @@
 		ie_value->ie_pltype = va_arg(ap, enum ast_event_ie_pltype);
 		switch (ie_value->ie_pltype) {
 		case AST_EVENT_IE_PLTYPE_UINT:
-			ie_value->payload.uint = va_arg(ap, uint32_t);
-			insert = 1;
-			break;
-		case AST_EVENT_IE_PLTYPE_BITFLAGS:
 			ie_value->payload.uint = va_arg(ap, uint32_t);
 			insert = 1;
 			break;
@@ -486,17 +473,6 @@
 		return (val == ast_event_get_ie_uint(event, ie_val->ie_type)) ? 1 : 0;
 	}
 
-	case AST_EVENT_IE_PLTYPE_BITFLAGS:
-	{
-		uint32_t flags = event2 ? ast_event_get_ie_uint(event2, ie_val->ie_type) : ie_val->payload.uint;
-
-		/*
-		 * If the subscriber has requested *any* of the bitflags that this event provides,
-		 * then it's a match.
-		 */
-		return (flags & ast_event_get_ie_bitflags(event, ie_val->ie_type)) ? 1 : 0;
-	}
-
 	case AST_EVENT_IE_PLTYPE_STR:
 	{
 		const char *str;
@@ -566,9 +542,6 @@
 		case AST_EVENT_IE_PLTYPE_UINT:
 			ast_event_append_ie_uint(&event, ie_val->ie_type, ie_val->payload.uint);
 			break;
-		case AST_EVENT_IE_PLTYPE_BITFLAGS:
-			ast_event_append_ie_bitflags(&event, ie_val->ie_type, ie_val->payload.uint);
-			break;
 		case AST_EVENT_IE_PLTYPE_STR:
 			ast_event_append_ie_str(&event, ie_val->ie_type, ie_val->payload.str);
 			break;
@@ -660,28 +633,6 @@
 	ie_val->ie_type = ie_type;
 	ie_val->payload.uint = unsigned_int;
 	ie_val->ie_pltype = AST_EVENT_IE_PLTYPE_UINT;
-
-	AST_LIST_INSERT_TAIL(&sub->ie_vals, ie_val, entry);
-
-	return 0;
-}
-
-int ast_event_sub_append_ie_bitflags(struct ast_event_sub *sub,
-	enum ast_event_ie_type ie_type, uint32_t flags)
-{
-	struct ast_event_ie_val *ie_val;
-
-	if (ie_type <= 0 || ie_type >= AST_EVENT_IE_TOTAL) {
-		return -1;
-	}
-
-	if (!(ie_val = ast_calloc(1, sizeof(*ie_val)))) {
-		return -1;
-	}
-
-	ie_val->ie_type = ie_type;
-	ie_val->payload.uint = flags;
-	ie_val->ie_pltype = AST_EVENT_IE_PLTYPE_BITFLAGS;
 
 	AST_LIST_INSERT_TAIL(&sub->ie_vals, ie_val, entry);
 
@@ -815,12 +766,6 @@
 		{
 			uint32_t unsigned_int = va_arg(ap, uint32_t);
 			ast_event_sub_append_ie_uint(sub, ie_type, unsigned_int);
-			break;
-		}
-		case AST_EVENT_IE_PLTYPE_BITFLAGS:
-		{
-			uint32_t unsigned_int = va_arg(ap, uint32_t);
-			ast_event_sub_append_ie_bitflags(sub, ie_type, unsigned_int);
 			break;
 		}
 		case AST_EVENT_IE_PLTYPE_STR:
@@ -908,11 +853,6 @@
 	return ntohl(get_unaligned_uint32(iterator->ie->ie_payload));
 }
 
-uint32_t ast_event_iterator_get_ie_bitflags(struct ast_event_iterator *iterator)
-{
-	return ntohl(get_unaligned_uint32(iterator->ie->ie_payload));
-}
-
 const char *ast_event_iterator_get_ie_str(struct ast_event_iterator *iterator)
 {
 	const struct ast_event_ie_str_payload *str_payload;
@@ -938,15 +878,6 @@
 }
 
 uint32_t ast_event_get_ie_uint(const struct ast_event *event, enum ast_event_ie_type ie_type)
-{
-	const uint32_t *ie_val;
-
-	ie_val = ast_event_get_ie_raw(event, ie_type);
-
-	return ie_val ? ntohl(get_unaligned_uint32(ie_val)) : 0;
-}
-
-uint32_t ast_event_get_ie_bitflags(const struct ast_event *event, enum ast_event_ie_type ie_type)
 {
 	const uint32_t *ie_val;
 
@@ -1021,13 +952,6 @@
 {
 	data = htonl(data);
 	return ast_event_append_ie_raw(event, ie_type, &data, sizeof(data));
-}
-
-int ast_event_append_ie_bitflags(struct ast_event **event, enum ast_event_ie_type ie_type,
-	uint32_t flags)
-{
-	flags = htonl(flags);
-	return ast_event_append_ie_raw(event, ie_type, &flags, sizeof(flags));
 }
 
 int ast_event_append_ie_raw(struct ast_event **event, enum ast_event_ie_type ie_type,
@@ -1082,10 +1006,6 @@
 		ie_value->ie_pltype = va_arg(ap, enum ast_event_ie_pltype);
 		switch (ie_value->ie_pltype) {
 		case AST_EVENT_IE_PLTYPE_UINT:
-			ie_value->payload.uint = va_arg(ap, uint32_t);
-			insert = 1;
-			break;
-		case AST_EVENT_IE_PLTYPE_BITFLAGS:
 			ie_value->payload.uint = va_arg(ap, uint32_t);
 			insert = 1;
 			break;
@@ -1130,9 +1050,6 @@
 			break;
 		case AST_EVENT_IE_PLTYPE_UINT:
 			ast_event_append_ie_uint(&event, ie_val->ie_type, ie_val->payload.uint);
-			break;
-		case AST_EVENT_IE_PLTYPE_BITFLAGS:
-			ast_event_append_ie_bitflags(&event, ie_val->ie_type, ie_val->payload.uint);
 			break;
 		case AST_EVENT_IE_PLTYPE_RAW:
 			ast_event_append_ie_raw(&event, ie_val->ie_type,

Modified: team/kmoore/event_system_strip/tests/test_cel.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/event_system_strip/tests/test_cel.c?view=diff&rev=395396&r1=395395&r2=395396
==============================================================================
--- team/kmoore/event_system_strip/tests/test_cel.c (original)
+++ team/kmoore/event_system_strip/tests/test_cel.c Thu Jul 25 08:37:46 2013
@@ -1745,10 +1745,8 @@
 
 	for (res = ast_event_iterator_init(&iterator, received); !res; res = ast_event_iterator_next(&iterator)) {
 		/* XXX ignore sec/usec for now */
-		/* ignore EID */
 		int ie_type = ast_event_iterator_get_ie_type(&iterator);
 		if (ie_type != AST_EVENT_IE_CEL_EVENT_TIME_USEC
-			&& ie_type != AST_EVENT_IE_EID
 			&& ie_type != AST_EVENT_IE_CEL_EVENT_TIME
 			&& !match_ie_val(received, expected, ie_type)) {
 			ast_log(LOG_ERROR, "Failed matching on field %s\n", ast_event_get_ie_type_name(ie_type));
@@ -1793,9 +1791,6 @@
 			ast_log(LOG_ERROR, "%.30s: %u\n", ie_type_name,
 					ast_event_iterator_get_ie_uint(&i));
 			break;
-		case AST_EVENT_IE_PLTYPE_BITFLAGS:
-			ast_log(LOG_ERROR, "%.30s: %u\n", ie_type_name,
-					ast_event_iterator_get_ie_bitflags(&i));
 		default:
 			break;
 		}

Modified: team/kmoore/event_system_strip/tests/test_event.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/event_system_strip/tests/test_event.c?view=diff&rev=395396&r1=395395&r2=395396
==============================================================================
--- team/kmoore/event_system_strip/tests/test_event.c (original)
+++ team/kmoore/event_system_strip/tests/test_event.c Thu Jul 25 08:37:46 2013
@@ -34,7 +34,6 @@
  *   - ast_event_iterator_next()
  *   - ast_event_iterator_get_ie_type()
  *   - ast_event_iterator_get_ie_uint()
- *   - ast_event_iterator_get_ie_bitflags()
  *   - ast_event_iterator_get_ie_str()
  *   - ast_event_iterator_get_ie_raw()
  */
@@ -55,7 +54,7 @@
 
 static int check_event(struct ast_event *event, struct ast_test *test,
 		enum ast_event_type expected_type, const char *type_name,
-		const char *str, uint32_t uint, uint32_t bitflags)
+		const char *str, uint32_t uint)
 {
 	enum ast_event_type type;
 	const void *foo;
@@ -75,37 +74,25 @@
 		return -1;
 	}
 
-	/* Check #3: Check for automatically included EID */
-	if (memcmp(&ast_eid_default, ast_event_get_ie_raw(event, AST_EVENT_IE_EID), sizeof(ast_eid_default))) {
-		ast_test_status_update(test, "Failed to get EID\n");
-		return -1;
-	}
-
-	/* Check #4: Check for the string IE */
+	/* Check #3: Check for the string IE */
 	if (strcmp(str, ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME))) {
 		ast_test_status_update(test, "Failed to get string IE.\n");
 		return -1;
 	}
 
-	/* Check #5: Check for the uint IE */
+	/* Check #4: Check for the uint IE */
 	if (uint != ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_AMAFLAGS)) {
 		ast_test_status_update(test, "Failed to get uint IE.\n");
 		return -1;
 	}
 
-	/* Check #6: Check for the bitflags IE */
-	if (bitflags != ast_event_get_ie_bitflags(event, AST_EVENT_IE_UNIQUEID)) {
-		ast_test_status_update(test, "Failed to get bitflags IE.\n");
-		return -1;
-	}
-
-	/* Check #7: Check if a check for a str IE that isn't there works */
+	/* Check #5: Check if a check for a str IE that isn't there works */
 	if ((foo = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_CIDNAME))) {
 		ast_test_status_update(test, "CEL_CIDNAME IE check returned non-NULL %p\n", foo);
 		return -1;
 	}
 
-	/* Check #8: Check if a check for a uint IE that isn't there returns 0 */
+	/* Check #6: Check if a check for a uint IE that isn't there returns 0 */
 	if (ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC)) {
 		ast_test_status_update(test, "UNIQUEID IE should be 0\n");
 		return -1;
@@ -127,7 +114,6 @@
 	static const enum ast_event_type type = AST_EVENT_CUSTOM;
 	static const char str[] = "SIP/alligatormittens";
 	static const uint32_t uint = 0xb00bface;
-	static const uint32_t bitflags = 0x12488421;
 
 	switch (cmd) {
 	case TEST_INIT:
@@ -169,13 +155,7 @@
 		goto return_cleanup;
 	}
 
-	if (ast_event_append_ie_bitflags(&event, AST_EVENT_IE_UNIQUEID, bitflags)) {
-		ast_test_status_update(test, "Failed to append bitflags IE\n");
-		res = AST_TEST_FAIL;
-		goto return_cleanup;
-	}
-
-	if (check_event(event, test, type, "Custom", str, uint, bitflags)) {
+	if (check_event(event, test, type, "Custom", str, uint)) {
 		ast_test_status_update(test, "Dynamically generated event broken\n");
 		res = AST_TEST_FAIL;
 		goto return_cleanup;
@@ -184,7 +164,6 @@
 	event2 = ast_event_new(type,
 			AST_EVENT_IE_CEL_USEREVENT_NAME, AST_EVENT_IE_PLTYPE_STR, str,
 			AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_UINT, uint,
-			AST_EVENT_IE_UNIQUEID, AST_EVENT_IE_PLTYPE_BITFLAGS, bitflags,
 			AST_EVENT_IE_END);
 
 	if (!event2) {
@@ -193,7 +172,7 @@
 		goto return_cleanup;
 	}
 
-	if (check_event(event2, test, type, "Custom", str, uint, bitflags)) {
+	if (check_event(event2, test, type, "Custom", str, uint)) {
 		ast_test_status_update(test, "Statically generated event broken\n");
 		res = AST_TEST_FAIL;
 		goto return_cleanup;
@@ -237,7 +216,6 @@
 	TEST_SUBS_CUSTOM_STR,
 	TEST_SUBS_CUSTOM_RAW,
 	TEST_SUBS_CUSTOM_UINT,
-	TEST_SUBS_CUSTOM_BITFLAGS,
 	TEST_SUBS_CUSTOM_EXISTS,
 	TEST_SUBS_CUSTOM_DYNAMIC,
 	TEST_SUBS_CUSTOM_ANY,
@@ -265,8 +243,6 @@
 		return "TEST_SUBS_CUSTOM_RAW";
 	case TEST_SUBS_CUSTOM_UINT:
 		return "TEST_SUBS_CUSTOM_UINT";
-	case TEST_SUBS_CUSTOM_BITFLAGS:
-		return "TEST_SUBS_CUSTOM_BITFLAGS";
 	case TEST_SUBS_CUSTOM_EXISTS:
 		return "TEST_SUBS_CUSTOM_EXISTS";
 	case TEST_SUBS_CUSTOM_DYNAMIC:
@@ -309,9 +285,6 @@
 		[TEST_SUBS_CUSTOM_UINT] = {
 			.expected_count = 1,
 		},
-		[TEST_SUBS_CUSTOM_BITFLAGS] = {
-			.expected_count = 4,
-		},
 		[TEST_SUBS_CUSTOM_EXISTS] = {
 			.expected_count = 2,
 		},
@@ -319,7 +292,7 @@
 			.expected_count = 1,
 		},
 		[TEST_SUBS_CUSTOM_ANY] = {
-			.expected_count = 6,
+			.expected_count = 5,
 		},
 	};
 
@@ -451,30 +424,6 @@
 	}
 
 	/*
-	 * Subscription TEST_SUBS_CUSTOM_BITFLAGS:
-	 *  - allocate normally
-	 *  - subscribe to CUSTOM events with a CEL_AMAFLAGS BITFLAGS IE check
-	 */
-	ast_test_status_update(test, "Adding TEST_SUBS_CUSTOM_BITFLAGS subscription\n");
-	test_subs[TEST_SUBS_CUSTOM_BITFLAGS].sub = ast_event_subscribe(AST_EVENT_CUSTOM, event_sub_cb,
-		test_subs_class_type_str(TEST_SUBS_CUSTOM_BITFLAGS), &test_subs[TEST_SUBS_CUSTOM_BITFLAGS].data,
-		AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_BITFLAGS, 0x06,
-		AST_EVENT_IE_END);
-	if (!test_subs[TEST_SUBS_CUSTOM_BITFLAGS].sub) {
-		ast_test_status_update(test, "Failed to create TEST_SUBS_CUSTOM_BITFLAGS subscription\n");
-		res = AST_TEST_FAIL;
-		goto return_cleanup;
-	}
-
-	if (strcmp(ast_event_subscriber_get_description(test_subs[TEST_SUBS_CUSTOM_BITFLAGS].sub),
-		test_subs_class_type_str(TEST_SUBS_CUSTOM_BITFLAGS))) {
-		ast_test_status_update(test,
-			"Unexpected subscription description on TEST_SUBS_CUSTOM_BITFLAGS subscription\n");
-		res = AST_TEST_FAIL;
-		goto return_cleanup;
-	}
-
-	/*
 	 * Subscription TEST_SUBS_CUSTOM_EXISTS:
 	 *  - allocate normally
 	 *  - subscribe to CUSTOM events with a CEL_AMAFLAGS UINT and UNIQUEID EXISTS IE check
@@ -542,14 +491,6 @@
 		goto return_cleanup;
 	}
 
-	if (ast_event_sub_append_ie_bitflags(test_subs[TEST_SUBS_CUSTOM_DYNAMIC].sub, AST_EVENT_IE_UNIQUEID, 1)) {
-		ast_event_sub_destroy(test_subs[TEST_SUBS_CUSTOM_DYNAMIC].sub);
-		test_subs[TEST_SUBS_CUSTOM_DYNAMIC].sub = NULL;
-		ast_test_status_update(test, "Failed to append BITFLAGS IE to TEST_SUBS_CUSTOM_DYNAMIC subscription\n");
-		res = AST_TEST_FAIL;
-		goto return_cleanup;
-	}
-
 	if (ast_event_sub_append_ie_str(test_subs[TEST_SUBS_CUSTOM_DYNAMIC].sub, AST_EVENT_IE_CEL_CIDNAME, "FOO/bar")) {
 		ast_event_sub_destroy(test_subs[TEST_SUBS_CUSTOM_DYNAMIC].sub);
 		test_subs[TEST_SUBS_CUSTOM_DYNAMIC].sub = NULL;
@@ -597,25 +538,6 @@
 		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_CEL_CIDNAME, 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_CEL_CIDNAME, 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_CEL_CIDNAME, AST_EVENT_IE_PLTYPE_STR, "Money",
 		AST_EVENT_IE_END);
@@ -666,24 +588,6 @@
 		AST_EVENT_IE_END);
 	if (sub_res != AST_EVENT_SUB_NONE) {
 		ast_test_status_update(test, "UINT=1 subscription should not exist! (%d)\n",
-			sub_res);
-		res = AST_TEST_FAIL;
-	}
-
-	/* Check BITFLAGS matching. */
-	sub_res = ast_event_check_subscriber(AST_EVENT_CUSTOM,
-		AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_BITFLAGS, 2,
-		AST_EVENT_IE_END);
-	if (sub_res != AST_EVENT_SUB_EXISTS) {
-		ast_test_status_update(test, "BITFLAGS=2 subscription did not exist\n");
-		res = AST_TEST_FAIL;
-	}
-
-	sub_res = ast_event_check_subscriber(AST_EVENT_CUSTOM,
-		AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_BITFLAGS, 8,
-		AST_EVENT_IE_END);
-	if (sub_res != AST_EVENT_SUB_NONE) {
-		ast_test_status_update(test, "BITFLAGS=8 subscription should not exist! (%d)\n",
 			sub_res);
 		res = AST_TEST_FAIL;
 	}
@@ -817,7 +721,6 @@
 	 *
 	 * Matching subscriptions:
 	 * TEST_SUBS_CUSTOM_UINT
-	 * TEST_SUBS_CUSTOM_BITFLAGS
 	 * TEST_SUBS_CUSTOM_ANY
 	 */
 	event = ast_event_new(AST_EVENT_CUSTOM,
@@ -837,14 +740,15 @@
 	}
 
 	/*
-	 * Event to check BITFLAGS matching.
+	 * Event to check EXISTS matching.
 	 *
 	 * Matching subscriptions:
-	 * TEST_SUBS_CUSTOM_BITFLAGS
+	 * TEST_SUBS_CUSTOM_EXISTS
 	 * TEST_SUBS_CUSTOM_ANY
 	 */
 	event = ast_event_new(AST_EVENT_CUSTOM,
 		AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_UINT, 4,
+		AST_EVENT_IE_UNIQUEID, AST_EVENT_IE_PLTYPE_UINT, 4,
 		AST_EVENT_IE_END);
 	if (!event) {
 		ast_test_status_update(test, "Failed to create event\n");
@@ -860,36 +764,10 @@
 	}
 
 	/*
-	 * Event to check EXISTS matching.
-	 *
-	 * Matching subscriptions:
-	 * TEST_SUBS_CUSTOM_EXISTS
-	 * TEST_SUBS_CUSTOM_BITFLAGS
-	 * TEST_SUBS_CUSTOM_ANY
-	 */
-	event = ast_event_new(AST_EVENT_CUSTOM,
-		AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_UINT, 4,
-		AST_EVENT_IE_UNIQUEID, AST_EVENT_IE_PLTYPE_UINT, 4,
-		AST_EVENT_IE_END);
-	if (!event) {
-		ast_test_status_update(test, "Failed to create event\n");
-		res = AST_TEST_FAIL;
-		goto return_cleanup;
-	}
-	if (ast_event_queue(event)) {
-		ast_event_destroy(event);
-		event = NULL;
-		ast_test_status_update(test, "Failed to queue event\n");
-		res = AST_TEST_FAIL;
-		goto return_cleanup;
-	}
-
-	/*
 	 * Event to get dynamic subscription to have an event.
 	 *
 	 * Matching subscriptions:
 	 * TEST_SUBS_CUSTOM_DYNAMIC
-	 * TEST_SUBS_CUSTOM_BITFLAGS
 	 * TEST_SUBS_CUSTOM_EXISTS
 	 * TEST_SUBS_ALL_STR
 	 * TEST_SUBS_CUSTOM_STR




More information about the asterisk-commits mailing list