Asterisk - The Open Source Telephony Project GIT-master-b023714
|
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 = ASTERISK_GPL_KEY , .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, NULL, PATH_MAX, TEST_EXECUTE, TEST_INIT, 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, 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, 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, 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, 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().