Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include "asterisk/astobj2.h"
#include "asterisk/conversions.h"
#include "asterisk/module.h"
#include "asterisk/stasis_state.h"
#include "asterisk/test.h"
Go to the source code of this file.
Data Structures | |
struct | foo_data |
Macros | |
#define | MANAGER_TOPIC "foo" |
#define | test_category "/stasis/core/state/" |
#define | TOPIC_COUNT 500 |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Stasis state testing" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static int | expect_null |
struct stasis_state_observer | foo_observer |
static size_t | running_total |
static size_t | sum_total |
#define MANAGER_TOPIC "foo" |
Definition at line 36 of file test_stasis_state.c.
Referenced by AST_TEST_DEFINE().
#define test_category "/stasis/core/state/" |
Definition at line 32 of file test_stasis_state.c.
Referenced by AST_TEST_DEFINE().
#define TOPIC_COUNT 500 |
Definition at line 34 of file test_stasis_state.c.
Referenced by publishers_create(), publishers_destroy(), and subscriptions_create().
|
static |
Definition at line 466 of file test_stasis_state.c.
|
static |
Definition at line 466 of file test_stasis_state.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 466 of file test_stasis_state.c.
AST_TEST_DEFINE | ( | implicit_publish | ) |
Definition at line 356 of file test_stasis_state.c.
References ao2_cleanup, ao2_ref, ast_log, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, cleanup(), implicit_publish_cb(), sip_to_pjsip::info(), LOG_ERROR, MANAGER_TOPIC, NULL, publish(), publishers_destroy(), RAII_VAR, stasis_state_manager_create(), subscriptions_create(), subscriptions_destroy(), test_category, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | explicit_publish | ) |
Definition at line 399 of file test_stasis_state.c.
References ao2_cleanup, ao2_ref, ast_log, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, cleanup(), explicit_publish_cb(), sip_to_pjsip::info(), LOG_ERROR, MANAGER_TOPIC, NULL, publish(), publishers, publishers_create(), publishers_destroy(), RAII_VAR, stasis_state_manager_create(), subscriptions_create(), subscriptions_destroy(), test_category, TEST_EXECUTE, and TEST_INIT.
AST_VECTOR | ( | subscriptions | , |
struct stasis_state_subscriber * | |||
) |
AST_VECTOR | ( | publishers | , |
struct stasis_state_publisher * | |||
) |
|
static |
Definition at line 246 of file test_stasis_state.c.
References ao2_alloc, ao2_ref, ast_log, ast_str_to_umax(), foo_data::bar, foo_type(), LOG_ERROR, NULL, and stasis_message_create_full().
Referenced by explicit_publish_cb(), and implicit_publish_cb().
|
static |
Definition at line 293 of file test_stasis_state.c.
References ao2_ref, ast_log, AST_VECTOR_GET, AST_VECTOR_SIZE, CMP_STOP, create_foo_type_message(), LOG_ERROR, NULL, publishers, stasis_message_data(), stasis_state_publish(), stasis_state_publisher_id(), and validate_data().
Referenced by AST_TEST_DEFINE().
struct stasis_message_type* foo_type | ( | void | ) |
Referenced by create_foo_type_message(), load_module(), and unload_module().
|
static |
Definition at line 108 of file test_stasis_state.c.
Referenced by subscriptions_create().
|
static |
Definition at line 96 of file test_stasis_state.c.
References ao2_cleanup, stasis_state_subscriber_data(), and validate_data().
|
static |
Definition at line 272 of file test_stasis_state.c.
References ao2_ref, CMP_STOP, create_foo_type_message(), NULL, stasis_message_data(), stasis_state_publish_by_id(), and validate_data().
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 454 of file test_stasis_state.c.
References AST_MODULE_LOAD_SUCCESS, AST_TEST_REGISTER, foo_type(), and STASIS_MESSAGE_TYPE_INIT.
|
static |
Definition at line 328 of file test_stasis_state.c.
References ast_log, expect_null, LOG_ERROR, running_total, stasis_state_callback_all(), and sum_total.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 205 of file test_stasis_state.c.
References ao2_ref, ast_log, AST_VECTOR_APPEND, AST_VECTOR_INIT, LOG_ERROR, publishers_destroy(), stasis_state_add_publisher(), and TOPIC_COUNT.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 179 of file test_stasis_state.c.
References ao2_cleanup, ast_log, AST_VECTOR_CALLBACK_VOID, AST_VECTOR_FREE, LOG_ERROR, NULL, stasis_state_remove_publish_by_id(), and TOPIC_COUNT.
Referenced by AST_TEST_DEFINE(), and publishers_create().
STASIS_MESSAGE_TYPE_DEFN | ( | foo_type | ) |
foo stasis message type
|
static |
Definition at line 131 of file test_stasis_state.c.
References ao2_ref, ast_log, AST_VECTOR_APPEND, AST_VECTOR_INIT, expect_null, foo_type_cb(), LOG_ERROR, NULL, running_total, stasis_state_add_observer(), stasis_state_subscribe_pool(), sub, subscriptions_destroy(), sum_total, and TOPIC_COUNT.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 113 of file test_stasis_state.c.
References ast_log, AST_VECTOR_CALLBACK_VOID, AST_VECTOR_FREE, expect_null, LOG_ERROR, running_total, stasis_state_remove_observer(), stasis_state_unsubscribe_and_join(), and sum_total.
Referenced by AST_TEST_DEFINE(), and subscriptions_create().
|
static |
Definition at line 444 of file test_stasis_state.c.
References AST_TEST_UNREGISTER, foo_type(), and STASIS_MESSAGE_TYPE_CLEANUP.
|
static |
Definition at line 63 of file test_stasis_state.c.
References ast_log, ast_str_to_umax(), foo_data::bar, expect_null, LOG_ERROR, and running_total.
Referenced by explicit_publish_cb(), handle_validate(), and implicit_publish_cb().
|
static |
Definition at line 466 of file test_stasis_state.c.
|
static |
Definition at line 466 of file test_stasis_state.c.
|
static |
This value is set to check if state data is NULL before publishing
Definition at line 61 of file test_stasis_state.c.
Referenced by publish(), subscriptions_create(), subscriptions_destroy(), and validate_data().
struct stasis_state_observer foo_observer |
Definition at line 103 of file test_stasis_state.c.
|
static |
Test variable that tracks the running total of state ids
Definition at line 58 of file test_stasis_state.c.
Referenced by publish(), subscriptions_create(), subscriptions_destroy(), and validate_data().
|
static |
For testing purposes each subscribed state's id is a number. This value is the summation of all id's.
Definition at line 55 of file test_stasis_state.c.
Referenced by publish(), subscriptions_create(), and subscriptions_destroy().