Asterisk - The Open Source Telephony Project  21.4.1
Macros | Functions | Variables
test_media_cache.c File Reference

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/monkeys.wav"
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
 AST_TEST_DEFINE (exists_nominal)
 
 AST_TEST_DEFINE (exists_off_nominal)
 
 AST_TEST_DEFINE (create_update_nominal)
 
 AST_TEST_DEFINE (create_update_off_nominal)
 
 AST_TEST_DEFINE (create_update_metadata)
 
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_infoast_module_info = &__mod_info
 
static struct ast_sorcery_wizard bucket_file_test_wizard
 
static struct ast_sorcery_wizard bucket_test_wizard
 

Detailed Description

Tests for the media cache API.

Author
Matt Jordan <mjordan@digium.com> 

Definition in file test_media_cache.c.

Macro Definition Documentation

#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/monkeys.wav"

A 'valid' resource for the test bucket behind the media cache facade

Definition at line 45 of file test_media_cache.c.