Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Unit Tests for utils API. More...
#include "asterisk.h"
#include "asterisk/utils.h"
#include "asterisk/test.h"
#include "asterisk/crypto.h"
#include "asterisk/adsi.h"
#include "asterisk/agi.h"
#include "asterisk/channel.h"
#include "asterisk/module.h"
#include <sys/stat.h>
Go to the source code of this file.
Data Structures | |
struct | quote_set |
Macros | |
#define | INIT_ENCODE_TEST(s, buffer, in, out, dec_out) |
#define | LONG_SIZE 256 |
#define | SHORT_SIZE 4 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (adsi_loaded_test) | |
AST_TEST_DEFINE (agi_loaded_test) | |
AST_TEST_DEFINE (base64_test) | |
AST_TEST_DEFINE (crypt_test) | |
AST_TEST_DEFINE (crypto_loaded_test) | |
AST_TEST_DEFINE (md5_test) | |
AST_TEST_DEFINE (quote_mutation) | |
AST_TEST_DEFINE (quote_unescaping) | |
AST_TEST_DEFINE (quoted_escape_test) | |
AST_TEST_DEFINE (safe_mkdir_test) | |
AST_TEST_DEFINE (sha1_test) | |
AST_TEST_DEFINE (uri_encode_decode_test) | |
static int | handle_noop (struct ast_channel *chan, AGI *agi, int arg, const char *const argv[]) |
static int | load_module (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Utils test module" , .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, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_agi,res_crypto", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
Unit Tests for utils API.
Definition in file test_utils.c.
#define LONG_SIZE 256 |
#define SHORT_SIZE 4 |
|
static |
Definition at line 662 of file test_utils.c.
|
static |
Definition at line 662 of file test_utils.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 662 of file test_utils.c.
AST_TEST_DEFINE | ( | adsi_loaded_test | ) |
Definition at line 333 of file test_utils.c.
References ast_adsi_available(), AST_ADSI_AVAILABLE, ast_channel_adsicpe_set(), ast_channel_unref, ast_dummy_channel_alloc, ast_module_check(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, c, sip_to_pjsip::info(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | agi_loaded_test | ) |
Definition at line 368 of file test_utils.c.
References ast_agi_register(), ast_agi_unregister(), AST_OPTIONAL_API_UNAVAILABLE, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, handle_noop(), sip_to_pjsip::info(), NULL, ast_module_info::self, agi_command::syntax, TEST_EXECUTE, TEST_INIT, and agi_command::usage.
AST_TEST_DEFINE | ( | base64_test | ) |
Definition at line 266 of file test_utils.c.
References ARRAY_LEN, ast_base64decode(), ast_base64encode(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), input(), TEST_EXECUTE, TEST_INIT, and tmp().
AST_TEST_DEFINE | ( | crypt_test | ) |
Definition at line 493 of file test_utils.c.
References ast_crypt_encrypt(), ast_crypt_validate(), ast_free, AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | crypto_loaded_test | ) |
Definition at line 317 of file test_utils.c.
References ast_crypto_loaded(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | md5_test | ) |
Definition at line 179 of file test_utils.c.
References ARRAY_LEN, ast_md5_hash(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), input(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | quote_mutation | ) |
Definition at line 534 of file test_utils.c.
References ARRAY_LEN, ast_escape_quoted(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, ast_unescape_quoted(), sip_to_pjsip::info(), input(), quote_set::output, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | quote_unescaping | ) |
Definition at line 583 of file test_utils.c.
References ARRAY_LEN, ast_free, ast_strdup, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, ast_unescape_quoted(), sip_to_pjsip::info(), input(), quote_set::output, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | quoted_escape_test | ) |
Definition at line 129 of file test_utils.c.
References ARRAY_LEN, ast_alloca, ast_escape_quoted(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, buf, in, sip_to_pjsip::info(), LONG_SIZE, NULL, SHORT_SIZE, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | safe_mkdir_test | ) |
Definition at line 406 of file test_utils.c.
References ast_safe_mkdir(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, errno, sip_to_pjsip::info(), mkdtemp(), NULL, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | sha1_test | ) |
Definition at line 221 of file test_utils.c.
References ARRAY_LEN, ast_sha1_hash(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), input(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | uri_encode_decode_test | ) |
Definition at line 48 of file test_utils.c.
References ARRAY_LEN, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, ast_uri_decode(), ast_uri_encode(), ast_uri_http, ast_uri_http_legacy, ast_uri_sip_user, buf, in, sip_to_pjsip::info(), INIT_ENCODE_TEST, input(), none, out, TEST_EXECUTE, and TEST_INIT.
|
static |
Definition at line 362 of file test_utils.c.
References ast_agi_send(), agi_state::fd, and RESULT_SUCCESS.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 640 of file test_utils.c.
References AST_MODULE_LOAD_SUCCESS, and AST_TEST_REGISTER.
|
static |
Definition at line 623 of file test_utils.c.
References AST_TEST_UNREGISTER.
|
static |
Definition at line 662 of file test_utils.c.
|
static |
Definition at line 662 of file test_utils.c.