| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
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 = ASTERISK_GPL_KEY , .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, 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(), 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, TEST_EXECUTE, and TEST_INIT.
| 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, 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, 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, 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(), quote_set::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(), quote_set::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, 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, 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, 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, INIT_ENCODE_TEST, 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.