Asterisk - The Open Source Telephony Project
21.4.1
|
#include "asterisk.h"
#include "asterisk/utils.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/astobj2.h"
Go to the source code of this file.
Data Structures | |
struct | test_obj |
Macros | |
#define | ITERATIONS 100000 |
#define | OBJS 73 |
Enumerations | |
enum | test_container_type { TEST_CONTAINER_LIST, TEST_CONTAINER_HASH, TEST_CONTAINER_RBTREE } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | all_but_one_cb (void *obj, void *arg, int flag) |
static | AO2_GLOBAL_OBJ_STATIC (astobj2_holder) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (astobj2_test_1) | |
AST_TEST_DEFINE (astobj2_test_2) | |
AST_TEST_DEFINE (astobj2_test_3) | |
AST_TEST_DEFINE (astobj2_test_4) | |
AST_TEST_DEFINE (astobj2_test_perf) | |
static int | astobj2_test_1_helper (int tst_num, enum test_container_type type, int use_sort, unsigned int lim, struct ast_test *test) |
static int | increment_cb (void *obj, void *arg, int flag) |
static int | insert_test_duplicates (struct ao2_container *container, int *destroy_counter, int number, const char *prefix, struct ast_test *test) |
static int | insert_test_vector (struct ao2_container *container, int *destroy_counter, const int *vector, int count, const char *prefix, struct ast_test *test) |
static int | load_module (void) |
static int | multiple_cb (void *obj, void *arg, int flag) |
static int | test_ao2_callback_traversal (int res, struct ao2_container *container, enum search_flags flags, ao2_callback_fn *cmp_fn, void *arg, const int *vector, int count, const char *prefix, struct ast_test *test) |
static int | test_ao2_find_w_no_flags (int res, struct ao2_container *look_in, int limit, struct ast_test *test) |
static int | test_ao2_find_w_OBJ_KEY (int res, struct ao2_container *look_in, int limit, struct ast_test *test) |
static int | test_ao2_find_w_OBJ_PARTIAL_KEY (int res, struct ao2_container *look_in, int limit, struct ast_test *test) |
static int | test_ao2_find_w_OBJ_POINTER (int res, struct ao2_container *look_in, int limit, struct ast_test *test) |
static int | test_ao2_iteration (int res, struct ao2_container *container, enum ao2_iterator_flags flags, const int *vector, int count, const char *prefix, struct ast_test *test) |
static int | test_cmp_cb (void *obj, void *arg, int flags) |
static const char * | test_container2str (enum test_container_type type) |
static int | test_container_clone (int res, struct ao2_container *orig, struct ast_test *test) |
static int | test_expected_duplicates (int res, struct ao2_container *container, enum search_flags flags, int number, const int *vector, int count, const char *prefix, struct ast_test *test) |
static int | test_hash_cb (const void *obj, const int flags) |
static struct ao2_container * | test_make_nonsorted (enum test_container_type type, int options) |
static struct ao2_container * | test_make_sorted (enum test_container_type type, int options) |
static void | test_obj_destructor (void *v_obj) |
static enum ast_test_result_state | test_performance (struct ast_test *test, enum test_container_type type, unsigned int copt) |
static int | test_sort_cb (const void *obj_left, const void *obj_right, int flags) |
static int | test_traversal_nonsorted (int res, int tst_num, enum test_container_type type, struct ast_test *test) |
static int | test_traversal_sorted (int res, int tst_num, enum test_container_type type, struct ast_test *test) |
static enum ast_test_result_state | testloop (struct ast_test *test, enum test_container_type type, int copt, int iterations) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "ASTOBJ2 Unit 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 |
int | partial_key_match_range |
astobj2 test module
Definition in file test_astobj2.c.
AST_TEST_DEFINE | ( | astobj2_test_perf | ) |
The number of iteration of testloop to be performed.
Definition at line 2011 of file test_astobj2.c.
|
static |
The number of objects inserted and searched for in the container under test.
Definition at line 1923 of file test_astobj2.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_container_alloc_list, ao2_container_alloc_rbtree, ao2_link, ao2_ref, and test_obj::i.
|
static |
Container object insertion vector.
Container object insertion vector reversed.
Definition at line 1346 of file test_astobj2.c.
References AO2_CONTAINER_ALLOC_OPT_INSERT_BEGIN, AO2_ITERATOR_DESCENDING, OBJ_ORDER_ASCENDING, and OBJ_ORDER_DESCENDING.
|
static |
Container object insertion vector.
Container forward traversal/iteration.
Container backward traversal/iteration.
Definition at line 1552 of file test_astobj2.c.
References AO2_CONTAINER_ALLOC_OPT_DUPS_ALLOW, AO2_CONTAINER_ALLOC_OPT_DUPS_OBJ_REJECT, AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT, AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE, AO2_CONTAINER_ALLOC_OPT_INSERT_BEGIN, ao2_container_dump(), ao2_container_stats(), AO2_ITERATOR_DESCENDING, OBJ_ORDER_ASCENDING, and OBJ_ORDER_DESCENDING.
int partial_key_match_range |
Partial search key +/- matching range.
Definition at line 85 of file test_astobj2.c.