summaryrefslogtreecommitdiff
path: root/main/test.c
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-05-15 02:37:22 +0000
committerDavid M. Lee <dlee@digium.com>2013-05-15 02:37:22 +0000
commit9648e258c76a24c5a24e16c634fcda73829e5d30 (patch)
treea0dc5b31ee73a83a7799413929a40436a1526293 /main/test.c
parente8f4ac6c610265b46014da9259062bb74d3892d1 (diff)
Refactored the rest of the message types to use the STASIS_MESSAGE_TYPE_*
macros. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/test.c')
-rw-r--r--main/test.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/main/test.c b/main/test.c
index 12df75dd0..3a13d4d39 100644
--- a/main/test.c
+++ b/main/test.c
@@ -57,7 +57,7 @@ struct stasis_topic *test_suite_topic;
/*! \since 12
* \brief The message type for test suite messages
*/
-static struct stasis_message_type *test_suite_type;
+STASIS_MESSAGE_TYPE_DEFN(ast_test_suite_message_type);
/*! This array corresponds to the values defined in the ast_test_state enum */
static const char * const test_result2str[] = {
@@ -927,11 +927,6 @@ struct stasis_topic *ast_test_suite_topic(void)
return test_suite_topic;
}
-struct stasis_message_type *ast_test_suite_message_type(void)
-{
- return test_suite_type;
-}
-
/*!
* \since 12
* \brief A wrapper object that can be ao2 ref counted around an \ref ast_json blob
@@ -1002,8 +997,7 @@ static void test_cleanup(void)
{
ao2_cleanup(test_suite_topic);
test_suite_topic = NULL;
- ao2_cleanup(test_suite_type);
- test_suite_type = NULL;
+ STASIS_MESSAGE_TYPE_CLEANUP(ast_test_suite_message_type);
}
#endif
@@ -1013,10 +1007,14 @@ int ast_test_init(void)
#ifdef TEST_FRAMEWORK
/* Create stasis topic */
test_suite_topic = stasis_topic_create("test_suite_topic");
- test_suite_type = stasis_message_type_create("test_suite_type");
- if (!test_suite_topic || !test_suite_type) {
+ if (!test_suite_topic) {
return -1;
}
+
+ if (STASIS_MESSAGE_TYPE_INIT(ast_test_suite_message_type) != 0) {
+ return -1;
+ }
+
/* Register cli commands */
ast_cli_register_multiple(test_cli, ARRAY_LEN(test_cli));
ast_register_atexit(test_cleanup);