Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Tests for the media cache API. More...
#include "asterisk.h"
#include "asterisk/utils.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/bucket.h"
#include "asterisk/media_cache.h"
Go to the source code of this file.
Macros | |
#define | CATEGORY "/main/media_cache/" |
#define | INVALID_RESOURCE "httptest://localhost:8088/test_media_cache/bad.wav" |
#define | INVALID_SCHEME "foo://localhost:8088/test_media_cache/monkeys.wav" |
#define | NO_SCHEME "localhost:8088/test_media_cache/monkeys.wav" |
#define | VALID_RESOURCE "httptest://localhost:8088/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/monkeys.wav" |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (create_update_metadata) | |
AST_TEST_DEFINE (create_update_nominal) | |
AST_TEST_DEFINE (create_update_off_nominal) | |
AST_TEST_DEFINE (exists_nominal) | |
AST_TEST_DEFINE (exists_off_nominal) | |
static int | bucket_http_test_wizard_create (const struct ast_sorcery *sorcery, void *data, void *object) |
static int | bucket_http_test_wizard_delete (const struct ast_sorcery *sorcery, void *data, void *object) |
static void * | bucket_http_test_wizard_retrieve_id (const struct ast_sorcery *sorcery, void *data, const char *type, const char *id) |
static int | bucket_http_test_wizard_update (const struct ast_sorcery *sorcery, void *data, void *object) |
static int | load_module (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Media Cache Tests" , .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 struct ast_sorcery_wizard | bucket_file_test_wizard |
static struct ast_sorcery_wizard | bucket_test_wizard |
Tests for the media cache API.
Definition in file test_media_cache.c.
#define CATEGORY "/main/media_cache/" |
The unit test category
Definition at line 42 of file test_media_cache.c.
#define INVALID_RESOURCE "httptest://localhost:8088/test_media_cache/bad.wav" |
An 'invalid' resource for the test bucket behind the media cache facade
Definition at line 48 of file test_media_cache.c.
#define INVALID_SCHEME "foo://localhost:8088/test_media_cache/monkeys.wav" |
An 'invalid' scheme, not mapping to a valid bucket backend
Definition at line 51 of file test_media_cache.c.
#define NO_SCHEME "localhost:8088/test_media_cache/monkeys.wav" |
A URI with no scheme
Definition at line 54 of file test_media_cache.c.
#define VALID_RESOURCE "httptest://localhost:8088/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/test_media_cache/monkeys.wav" |
A 'valid' long resource for the test bucket behind the media cache facade
Definition at line 45 of file test_media_cache.c.
|
static |
Definition at line 416 of file test_media_cache.c.
|
static |
Definition at line 416 of file test_media_cache.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 416 of file test_media_cache.c.
AST_TEST_DEFINE | ( | create_update_metadata | ) |
Definition at line 314 of file test_media_cache.c.
References ast_media_cache_create_or_update(), ast_media_cache_retrieve(), ast_media_cache_retrieve_metadata(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, ast_variable_list_append, ast_variable_new, CATEGORY, sip_to_pjsip::info(), NULL, PATH_MAX, TEST_EXECUTE, TEST_INIT, tmp(), and VALID_RESOURCE.
AST_TEST_DEFINE | ( | create_update_nominal | ) |
Definition at line 195 of file test_media_cache.c.
References ast_media_cache_create_or_update(), ast_media_cache_delete(), ast_media_cache_retrieve(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, CATEGORY, ast_sorcery_wizard::close, sip_to_pjsip::info(), NULL, PATH_MAX, TEST_EXECUTE, TEST_INIT, and VALID_RESOURCE.
AST_TEST_DEFINE | ( | create_update_off_nominal | ) |
Definition at line 262 of file test_media_cache.c.
References ast_media_cache_create_or_update(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, CATEGORY, ast_sorcery_wizard::close, sip_to_pjsip::info(), INVALID_RESOURCE, INVALID_SCHEME, NO_SCHEME, NULL, PATH_MAX, TEST_EXECUTE, TEST_INIT, and VALID_RESOURCE.
AST_TEST_DEFINE | ( | exists_nominal | ) |
Definition at line 135 of file test_media_cache.c.
References ast_media_cache_exists(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), INVALID_RESOURCE, TEST_EXECUTE, TEST_INIT, and VALID_RESOURCE.
AST_TEST_DEFINE | ( | exists_off_nominal | ) |
Definition at line 163 of file test_media_cache.c.
References ast_media_cache_exists(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), INVALID_SCHEME, NO_SCHEME, NULL, TEST_EXECUTE, and TEST_INIT.
|
static |
Definition at line 60 of file test_media_cache.c.
References ast_sorcery_object_get_id(), and VALID_RESOURCE.
|
static |
Definition at line 109 of file test_media_cache.c.
References ast_media_cache_delete(), ast_sorcery_object_get_id(), and VALID_RESOURCE.
|
static |
Definition at line 88 of file test_media_cache.c.
References ast_bucket_file_alloc(), ast_bucket_file_temporary_create(), NULL, type, and VALID_RESOURCE.
|
static |
Definition at line 74 of file test_media_cache.c.
References ast_sorcery_object_get_id(), and VALID_RESOURCE.
|
static |
Definition at line 398 of file test_media_cache.c.
References ast_bucket_scheme_register, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_TEST_REGISTER, bucket_file_test_wizard, bucket_test_wizard, LOG_ERROR, and NULL.
|
static |
Definition at line 386 of file test_media_cache.c.
References AST_TEST_UNREGISTER.
|
static |
Definition at line 416 of file test_media_cache.c.
|
static |
Definition at line 416 of file test_media_cache.c.
|
static |
Definition at line 127 of file test_media_cache.c.
Referenced by load_module().
|
static |
Definition at line 120 of file test_media_cache.c.
Referenced by load_module().