Asterisk - The Open Source Telephony Project GIT-master-b023714
|
Bucket Unit Tests. More...
#include "asterisk.h"
#include <sys/stat.h>
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/bucket.h"
#include "asterisk/logger.h"
#include "asterisk/json.h"
#include "asterisk/file.h"
Go to the source code of this file.
Data Structures | |
struct | bucket_test_state |
Test state structure for scheme wizards. More... | |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (bucket_alloc) | |
AST_TEST_DEFINE (bucket_clone) | |
AST_TEST_DEFINE (bucket_create) | |
AST_TEST_DEFINE (bucket_delete) | |
AST_TEST_DEFINE (bucket_file_alloc) | |
AST_TEST_DEFINE (bucket_file_clone) | |
AST_TEST_DEFINE (bucket_file_copy) | |
AST_TEST_DEFINE (bucket_file_create) | |
AST_TEST_DEFINE (bucket_file_delete) | |
AST_TEST_DEFINE (bucket_file_is_stale) | |
AST_TEST_DEFINE (bucket_file_json) | |
AST_TEST_DEFINE (bucket_file_metadata_get) | |
AST_TEST_DEFINE (bucket_file_metadata_set) | |
AST_TEST_DEFINE (bucket_file_metadata_unset) | |
AST_TEST_DEFINE (bucket_file_retrieve) | |
AST_TEST_DEFINE (bucket_file_update) | |
AST_TEST_DEFINE (bucket_is_stale) | |
AST_TEST_DEFINE (bucket_json) | |
AST_TEST_DEFINE (bucket_retrieve) | |
AST_TEST_DEFINE (bucket_scheme_register) | |
static void | bucket_test_wizard_clear (void) |
static int | bucket_test_wizard_create (const struct ast_sorcery *sorcery, void *data, void *object) |
static int | bucket_test_wizard_delete (const struct ast_sorcery *sorcery, void *data, void *object) |
static int | bucket_test_wizard_is_stale (const struct ast_sorcery *sorcery, void *data, void *object) |
static void * | bucket_test_wizard_retrieve_id (const struct ast_sorcery *sorcery, void *data, const char *type, const char *id) |
static int | bucket_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 = "Bucket test module" , .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 |
static struct bucket_test_state | bucket_test_wizard_state |
Global scope structure for testing bucket wizards. | |
Bucket Unit Tests.
Definition in file test_bucket.c.
|
static |
Definition at line 1041 of file test_bucket.c.
|
static |
Definition at line 1041 of file test_bucket.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1041 of file test_bucket.c.
AST_TEST_DEFINE | ( | bucket_alloc | ) |
Definition at line 160 of file test_bucket.c.
References ao2_cleanup, ast_bucket_alloc(), ast_sorcery_object_get_id(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_clone | ) |
Definition at line 244 of file test_bucket.c.
References ao2_cleanup, ast_bucket_alloc(), ast_bucket_clone(), ast_bucket_create(), ast_sorcery_object_get_id(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, bucket_test_wizard_clear(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_create | ) |
Definition at line 201 of file test_bucket.c.
References ao2_cleanup, ast_bucket_alloc(), ast_bucket_create(), ast_sorcery_object_get_id(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, bucket_test_wizard_clear(), bucket_test_wizard_state, bucket_test_state::created, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_delete | ) |
Definition at line 288 of file test_bucket.c.
References ao2_cleanup, ast_bucket_alloc(), ast_bucket_delete(), ast_sorcery_object_get_id(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, bucket_test_wizard_clear(), bucket_test_wizard_state, bucket_test_state::deleted, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_alloc | ) |
Definition at line 438 of file test_bucket.c.
References ao2_cleanup, ast_bucket_file_alloc(), ast_sorcery_object_get_id(), ast_strlen_zero(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_clone | ) |
Definition at line 527 of file test_bucket.c.
References ao2_cleanup, ao2_container_count(), ast_bucket_file_alloc(), ast_bucket_file_clone(), ast_bucket_file_create(), ast_bucket_file_metadata_set(), ast_sorcery_object_get_id(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, bucket_test_wizard_clear(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_copy | ) |
Definition at line 573 of file test_bucket.c.
References ao2_cleanup, ao2_container_count(), ast_bucket_file_alloc(), ast_bucket_file_copy(), ast_bucket_file_metadata_get(), ast_bucket_file_metadata_set(), ast_sorcery_object_get_id(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, copy(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_create | ) |
Definition at line 484 of file test_bucket.c.
References ao2_cleanup, ast_bucket_file_alloc(), ast_bucket_file_create(), ast_sorcery_object_get_id(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, bucket_test_wizard_clear(), bucket_test_wizard_state, bucket_test_state::created, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_delete | ) |
Definition at line 715 of file test_bucket.c.
References ao2_cleanup, ast_bucket_file_alloc(), ast_bucket_file_delete(), ast_sorcery_object_get_id(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, bucket_test_wizard_clear(), bucket_test_wizard_state, bucket_test_state::deleted, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_is_stale | ) |
Definition at line 758 of file test_bucket.c.
References ao2_cleanup, ast_bucket_file_alloc(), ast_bucket_file_is_stale(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, bucket_test_wizard_clear(), bucket_test_wizard_state, bucket_test_state::is_stale, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_json | ) |
Definition at line 937 of file test_bucket.c.
References ao2_cleanup, ast_bucket_file_alloc(), ast_bucket_file_json(), ast_bucket_file_metadata_set(), ast_json_equal(), ast_json_pack(), ast_json_unref(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_metadata_get | ) |
Definition at line 896 of file test_bucket.c.
References ao2_cleanup, ast_bucket_file_alloc(), ast_bucket_file_metadata_get(), ast_bucket_file_metadata_set(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_metadata_set | ) |
Definition at line 790 of file test_bucket.c.
References ao2_cleanup, ao2_container_count(), ao2_find, ast_bucket_file_alloc(), ast_bucket_file_metadata_set(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, NULL, OBJ_KEY, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_metadata_unset | ) |
Definition at line 856 of file test_bucket.c.
References ao2_cleanup, ao2_find, ast_bucket_file_alloc(), ast_bucket_file_metadata_set(), ast_bucket_file_metadata_unset(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, NULL, OBJ_KEY, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_retrieve | ) |
Definition at line 648 of file test_bucket.c.
References ao2_cleanup, ast_bucket_file_retrieve(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_file_update | ) |
Definition at line 672 of file test_bucket.c.
References ao2_cleanup, ast_bucket_file_alloc(), ast_bucket_file_update(), ast_sorcery_object_get_id(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, bucket_test_wizard_clear(), bucket_test_wizard_state, NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and bucket_test_state::updated.
AST_TEST_DEFINE | ( | bucket_is_stale | ) |
Definition at line 331 of file test_bucket.c.
References ao2_cleanup, ast_bucket_alloc(), ast_bucket_is_stale(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, bucket_test_wizard_clear(), bucket_test_wizard_state, bucket_test_state::is_stale, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_json | ) |
Definition at line 363 of file test_bucket.c.
References ao2_cleanup, ast_bucket_alloc(), ast_bucket_json(), ast_json_equal(), ast_json_pack(), ast_json_unref(), ast_str_container_add(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_retrieve | ) |
Definition at line 414 of file test_bucket.c.
References ao2_cleanup, ast_bucket_retrieve(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | bucket_scheme_register | ) |
Definition at line 133 of file test_bucket.c.
References ast_bucket_scheme_register, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, bucket_file_test_wizard, bucket_test_wizard, NULL, TEST_EXECUTE, and TEST_INIT.
|
static |
Definition at line 58 of file test_bucket.c.
References bucket_test_wizard_state, bucket_test_state::created, bucket_test_state::deleted, bucket_test_state::is_stale, and bucket_test_state::updated.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), and AST_TEST_DEFINE().
|
static |
Definition at line 66 of file test_bucket.c.
References bucket_test_wizard_state, and bucket_test_state::created.
|
static |
Definition at line 100 of file test_bucket.c.
References bucket_test_wizard_state, and bucket_test_state::deleted.
|
static |
Definition at line 111 of file test_bucket.c.
References bucket_test_wizard_state, and bucket_test_state::is_stale.
|
static |
Definition at line 88 of file test_bucket.c.
References ast_bucket_alloc(), ast_bucket_file_alloc(), NULL, and type.
|
static |
Definition at line 77 of file test_bucket.c.
References bucket_test_wizard_state, and bucket_test_state::updated.
|
static |
Definition at line 1010 of file test_bucket.c.
References ast_bucket_file_temporary_create(), ast_bucket_file_temporary_destroy(), ast_bucket_scheme_register, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_TEST_REGISTER, bucket_alloc(), bucket_file_alloc(), bucket_file_test_wizard, bucket_test_wizard, and LOG_ERROR.
|
static |
Definition at line 987 of file test_bucket.c.
References AST_TEST_UNREGISTER, bucket_alloc(), and bucket_file_alloc().
|
static |
Definition at line 1041 of file test_bucket.c.
|
static |
Definition at line 1041 of file test_bucket.c.
|
static |
Definition at line 124 of file test_bucket.c.
Referenced by AST_TEST_DEFINE(), and load_module().
|
static |
Definition at line 116 of file test_bucket.c.
Referenced by AST_TEST_DEFINE(), and load_module().
|
static |
Global scope structure for testing bucket wizards.
Definition at line 56 of file test_bucket.c.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), bucket_test_wizard_clear(), bucket_test_wizard_create(), bucket_test_wizard_delete(), bucket_test_wizard_is_stale(), and bucket_test_wizard_update().