Add red-black tree container type to astobj2.

* Add red-black tree container type.

* Add CLI command "astobj2 container dump <name>"

* Added ao2_container_dump() so the container could be dumped by other
modules for debugging purposes.

* Changed ao2_container_stats() so it can be used by other modules like
ao2_container_check() for debugging purposes.

* Updated the unit tests to check red-black tree containers.

(closes issue ASTERISK-19970)
Reported by: rmudgett
Tested by: rmudgett

Review: https://reviewboard.asterisk.org/r/2110/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2012-11-21 18:33:16 +00:00
parent cc01a79463
commit 4ccf2c7aa5
7 changed files with 2644 additions and 52 deletions

View File

@@ -100,6 +100,27 @@ static int test_insert(struct ast_test *test);
static struct ast_test *test_remove(ast_test_cb_t *cb);
static int test_cat_cmp(const char *cat1, const char *cat2);
void ast_test_debug(struct ast_test *test, const char *fmt, ...)
{
struct ast_str *buf = NULL;
va_list ap;
buf = ast_str_create(128);
if (!buf) {
return;
}
va_start(ap, fmt);
ast_str_set_va(&buf, 0, fmt, ap);
va_end(ap);
if (test->cli) {
ast_cli(test->cli->fd, "%s", ast_str_buffer(buf));
}
ast_free(buf);
}
int __ast_test_status_update(const char *file, const char *func, int line,
struct ast_test *test, const char *fmt, ...)
{