Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Test JSON API. More...
#include "asterisk.h"
#include "asterisk/config.h"
#include "asterisk/json.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/file.h"
#include <stdio.h>
#include <unistd.h>
Go to the source code of this file.
Macros | |
#define | CATEGORY "/main/json/" |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (json_test_array_append) | |
AST_TEST_DEFINE (json_test_array_clear) | |
AST_TEST_DEFINE (json_test_array_create) | |
AST_TEST_DEFINE (json_test_array_extend) | |
AST_TEST_DEFINE (json_test_array_inset) | |
AST_TEST_DEFINE (json_test_array_null) | |
AST_TEST_DEFINE (json_test_array_remove) | |
AST_TEST_DEFINE (json_test_array_set) | |
AST_TEST_DEFINE (json_test_bool0) | |
AST_TEST_DEFINE (json_test_bool1) | |
AST_TEST_DEFINE (json_test_cep) | |
AST_TEST_DEFINE (json_test_circular_array) | |
AST_TEST_DEFINE (json_test_circular_object) | |
AST_TEST_DEFINE (json_test_clever_circle) | |
AST_TEST_DEFINE (json_test_copy) | |
AST_TEST_DEFINE (json_test_copy_null) | |
AST_TEST_DEFINE (json_test_deep_copy) | |
AST_TEST_DEFINE (json_test_dump_load_file) | |
AST_TEST_DEFINE (json_test_dump_load_new_file) | |
AST_TEST_DEFINE (json_test_dump_load_null) | |
AST_TEST_DEFINE (json_test_dump_load_str) | |
AST_TEST_DEFINE (json_test_dump_load_string) | |
AST_TEST_DEFINE (json_test_dump_str_fail) | |
AST_TEST_DEFINE (json_test_false) | |
AST_TEST_DEFINE (json_test_int) | |
AST_TEST_DEFINE (json_test_load_buffer) | |
AST_TEST_DEFINE (json_test_name_number) | |
AST_TEST_DEFINE (json_test_non_int) | |
AST_TEST_DEFINE (json_test_null) | |
AST_TEST_DEFINE (json_test_null_val) | |
AST_TEST_DEFINE (json_test_object_alloc) | |
AST_TEST_DEFINE (json_test_object_clear) | |
AST_TEST_DEFINE (json_test_object_create_vars) | |
AST_TEST_DEFINE (json_test_object_del) | |
AST_TEST_DEFINE (json_test_object_get) | |
AST_TEST_DEFINE (json_test_object_iter) | |
AST_TEST_DEFINE (json_test_object_iter_null) | |
AST_TEST_DEFINE (json_test_object_merge_all) | |
AST_TEST_DEFINE (json_test_object_merge_existing) | |
AST_TEST_DEFINE (json_test_object_merge_missing) | |
AST_TEST_DEFINE (json_test_object_null) | |
AST_TEST_DEFINE (json_test_object_set) | |
AST_TEST_DEFINE (json_test_object_set_overwrite) | |
AST_TEST_DEFINE (json_test_pack) | |
AST_TEST_DEFINE (json_test_pack_errors) | |
AST_TEST_DEFINE (json_test_pack_ownership) | |
AST_TEST_DEFINE (json_test_parse_errors) | |
AST_TEST_DEFINE (json_test_string) | |
AST_TEST_DEFINE (json_test_string_null) | |
AST_TEST_DEFINE (json_test_stringf) | |
AST_TEST_DEFINE (json_test_timeval) | |
AST_TEST_DEFINE (json_test_true) | |
static int | load_module (void) |
static int | safe_fclose (FILE *f) |
fclose isn't NULL safe. More... | |
static int | test_name_number (const char *name, const char *number) |
static int | unload_module (void) |
static void | json_debug_free (void *p) |
static void * | json_debug_malloc (size_t size) |
static int | json_test_cleanup (struct ast_test_info *info, struct ast_test *test) |
static int | json_test_init (struct ast_test_info *info, struct ast_test *test) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = 0 , .description = "JSON testing" , .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, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module } |
static size_t | alloc_count |
static const struct ast_module_info * | ast_module_info = &__mod_info |
Test JSON API.
While some of these tests are actually testing our JSON library wrapper, the bulk of them are exploratory tests to determine what the behavior of the underlying JSON library is. This also gives us a good indicator if that behavior changes between Jansson revisions.
Definition in file test_json.c.
#define CATEGORY "/main/json/" |
Definition at line 49 of file test_json.c.
|
static |
Definition at line 1868 of file test_json.c.
|
static |
Definition at line 1868 of file test_json.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1868 of file test_json.c.
AST_TEST_DEFINE | ( | json_test_array_append | ) |
Definition at line 461 of file test_json.c.
References ast_json_array_append(), ast_json_array_create(), ast_json_array_get(), ast_json_array_size(), ast_json_string_create(), ast_json_string_get(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_array_clear | ) |
Definition at line 571 of file test_json.c.
References ast_json_array_clear(), ast_json_array_size(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_array_create | ) |
Definition at line 437 of file test_json.c.
References AST_JSON_ARRAY, ast_json_array_create(), ast_json_array_size(), ast_json_typeof(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_array_extend | ) |
Definition at line 596 of file test_json.c.
References ast_json_array_append(), ast_json_array_create(), ast_json_array_extend(), ast_json_array_size(), ast_json_equal(), ast_json_integer_create(), ast_json_string_create(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_array_inset | ) |
Definition at line 490 of file test_json.c.
References ast_json_array_get(), ast_json_array_insert(), ast_json_array_size(), ast_json_pack(), ast_json_string_create(), ast_json_string_get(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_array_null | ) |
Definition at line 642 of file test_json.c.
References ast_json_array_append(), ast_json_array_clear(), ast_json_array_create(), ast_json_array_extend(), ast_json_array_get(), ast_json_array_insert(), ast_json_array_remove(), ast_json_array_set(), ast_json_array_size(), ast_json_null(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_array_remove | ) |
Definition at line 544 of file test_json.c.
References ast_json_array_remove(), ast_json_equal(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_array_set | ) |
Definition at line 517 of file test_json.c.
References ast_json_array_get(), ast_json_array_set(), ast_json_array_size(), ast_json_integer_create(), ast_json_integer_get(), ast_json_pack(), ast_json_string_get(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_bool0 | ) |
Definition at line 148 of file test_json.c.
References ast_json_boolean(), ast_json_equal(), AST_JSON_FALSE, ast_json_false(), ast_json_is_false(), ast_json_is_null(), ast_json_is_true(), ast_json_true(), ast_json_typeof(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_bool1 | ) |
Definition at line 175 of file test_json.c.
References ast_json_boolean(), ast_json_equal(), ast_json_false(), ast_json_is_false(), ast_json_is_null(), ast_json_is_true(), AST_JSON_TRUE, ast_json_true(), ast_json_typeof(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_cep | ) |
Definition at line 1705 of file test_json.c.
References ast_json_dialplan_cep_app(), ast_json_equal(), ast_json_null(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_circular_array | ) |
Definition at line 1580 of file test_json.c.
References ast_json_array_append(), ast_json_array_create(), ast_json_array_size(), ast_json_ref(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_circular_object | ) |
Definition at line 1554 of file test_json.c.
References ast_json_object_create(), ast_json_object_set(), ast_json_object_size(), ast_json_ref(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_clever_circle | ) |
Definition at line 1605 of file test_json.c.
References ast_json_dump_string, ast_json_object_clear(), ast_json_object_create(), ast_json_object_set(), ast_json_ref(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), json_debug_free(), NULL, RAII_VAR, str, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_copy | ) |
Definition at line 1479 of file test_json.c.
References ast_json_copy(), ast_json_equal(), ast_json_object_get(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_copy_null | ) |
Definition at line 1534 of file test_json.c.
References ast_json_copy(), ast_json_deep_copy(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_deep_copy | ) |
Definition at line 1505 of file test_json.c.
References ast_json_deep_copy(), ast_json_equal(), ast_json_integer_set(), ast_json_object_get(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_dump_load_file | ) |
Definition at line 1273 of file test_json.c.
References ast_file_mkftemp(), ast_json_dump_file, ast_json_equal(), ast_json_load_file(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, make_ari_stubs::file, sip_to_pjsip::info(), NULL, RAII_VAR, safe_fclose(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_dump_load_new_file | ) |
Definition at line 1308 of file test_json.c.
References ast_file_mkftemp(), ast_json_dump_new_file, ast_json_equal(), ast_json_load_new_file(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, make_ari_stubs::file, sip_to_pjsip::info(), NULL, RAII_VAR, safe_fclose(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_dump_load_null | ) |
Definition at line 1340 of file test_json.c.
References ast_file_mkftemp(), ast_json_dump_file, ast_json_dump_new_file, ast_json_dump_string, ast_json_load_buf(), ast_json_load_file(), ast_json_load_new_file(), ast_json_load_string(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, make_ari_stubs::file, sip_to_pjsip::info(), NULL, RAII_VAR, safe_fclose(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_dump_load_str | ) |
Definition at line 1181 of file test_json.c.
References ast_free, ast_json_dump_str, ast_json_equal(), ast_json_load_str(), ast_json_pack(), ast_json_unref(), ast_str_create, AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_dump_load_string | ) |
Definition at line 1152 of file test_json.c.
References ast_json_dump_string, ast_json_equal(), ast_json_load_string(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), json_debug_free(), NULL, RAII_VAR, str, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_dump_str_fail | ) |
Definition at line 1211 of file test_json.c.
References ast_json_dump_str, ast_json_pack(), ast_json_unref(), ast_str_alloca, AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_false | ) |
Definition at line 98 of file test_json.c.
References AST_JSON_FALSE, ast_json_false(), ast_json_is_false(), ast_json_is_null(), ast_json_is_true(), ast_json_typeof(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_int | ) |
Definition at line 358 of file test_json.c.
References AST_JSON_INTEGER, ast_json_integer_create(), ast_json_integer_get(), ast_json_integer_set(), ast_json_typeof(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), LLONG_MAX, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_load_buffer | ) |
Definition at line 1238 of file test_json.c.
References ast_json_load_buf(), ast_json_load_string(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, str, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_name_number | ) |
Definition at line 1656 of file test_json.c.
References AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, TEST_EXECUTE, TEST_INIT, and test_name_number().
AST_TEST_DEFINE | ( | json_test_non_int | ) |
Definition at line 399 of file test_json.c.
References ast_json_array_size(), ast_json_false(), ast_json_integer_create(), ast_json_integer_get(), ast_json_integer_set(), ast_json_null(), ast_json_string_create(), ast_json_string_get(), ast_json_true(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_null | ) |
Definition at line 202 of file test_json.c.
References ast_json_is_false(), ast_json_is_null(), ast_json_is_true(), AST_JSON_NULL, ast_json_null(), ast_json_typeof(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_null_val | ) |
Definition at line 227 of file test_json.c.
References ast_json_is_false(), ast_json_is_null(), ast_json_is_true(), ast_json_ref(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_alloc | ) |
Definition at line 673 of file test_json.c.
References AST_JSON_OBJECT, ast_json_object_create(), ast_json_object_size(), ast_json_typeof(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_clear | ) |
Definition at line 807 of file test_json.c.
References ast_json_integer_create(), ast_json_object_clear(), ast_json_object_create(), ast_json_object_set(), ast_json_object_size(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_create_vars | ) |
Definition at line 1095 of file test_json.c.
References ast_json_object_create_vars(), ast_json_object_string_get, ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, ast_variable_list_append, ast_variable_new, ast_variables_destroy(), CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and value.
AST_TEST_DEFINE | ( | json_test_object_del | ) |
Definition at line 778 of file test_json.c.
References ast_json_equal(), ast_json_object_create(), ast_json_object_del(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_get | ) |
Definition at line 754 of file test_json.c.
References ast_json_integer_get(), ast_json_object_get(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_iter | ) |
Definition at line 1003 of file test_json.c.
References ast_json_integer_create(), ast_json_integer_get(), ast_json_object_get(), ast_json_object_iter(), ast_json_object_iter_at(), ast_json_object_iter_key(), ast_json_object_iter_next(), ast_json_object_iter_set(), ast_json_object_iter_value(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_iter_null | ) |
Definition at line 1066 of file test_json.c.
References ast_json_null(), ast_json_object_create(), ast_json_object_iter(), ast_json_object_iter_at(), ast_json_object_iter_key(), ast_json_object_iter_next(), ast_json_object_iter_set(), ast_json_object_iter_value(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_merge_all | ) |
Definition at line 835 of file test_json.c.
References ast_json_equal(), ast_json_integer_create(), ast_json_object_create(), ast_json_object_set(), ast_json_object_size(), ast_json_object_update(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_merge_existing | ) |
Definition at line 880 of file test_json.c.
References ast_json_equal(), ast_json_integer_create(), ast_json_object_create(), ast_json_object_set(), ast_json_object_size(), ast_json_object_update_existing(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_merge_missing | ) |
Definition at line 923 of file test_json.c.
References ast_json_equal(), ast_json_integer_create(), ast_json_object_create(), ast_json_object_set(), ast_json_object_size(), ast_json_object_update_missing(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_null | ) |
Definition at line 968 of file test_json.c.
References ast_json_null(), ast_json_object_clear(), ast_json_object_create(), ast_json_object_del(), ast_json_object_get(), ast_json_object_set(), ast_json_object_size(), ast_json_object_update(), ast_json_object_update_existing(), ast_json_object_update_missing(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_set | ) |
Definition at line 697 of file test_json.c.
References ast_json_equal(), ast_json_integer_create(), ast_json_object_create(), ast_json_object_get(), ast_json_object_set(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_object_set_overwrite | ) |
Definition at line 729 of file test_json.c.
References ast_json_integer_create(), ast_json_integer_get(), ast_json_object_get(), ast_json_object_set(), ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_pack | ) |
Definition at line 1406 of file test_json.c.
References ast_json_array_append(), ast_json_array_create(), ast_json_array_get(), ast_json_equal(), ast_json_integer_create(), ast_json_object_create(), ast_json_object_set(), ast_json_pack(), ast_json_true(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_pack_errors | ) |
Definition at line 1456 of file test_json.c.
References ast_json_pack(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_pack_ownership | ) |
Definition at line 1436 of file test_json.c.
References ast_json_pack(), ast_json_string_create(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_parse_errors | ) |
Definition at line 1378 of file test_json.c.
References ast_json_load_string(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_string | ) |
Definition at line 253 of file test_json.c.
References AST_JSON_STRING, ast_json_string_create(), ast_json_string_get(), ast_json_string_set(), ast_json_typeof(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_string_null | ) |
Definition at line 293 of file test_json.c.
References ast_json_false(), ast_json_null(), ast_json_string_create(), ast_json_string_get(), ast_json_string_set(), ast_json_true(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_stringf | ) |
Definition at line 325 of file test_json.c.
References ast_json_equal(), ast_json_string_create(), ast_json_stringf(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_timeval | ) |
Definition at line 1677 of file test_json.c.
References ast_json_equal(), ast_json_string_create(), ast_json_timeval(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_true | ) |
Definition at line 123 of file test_json.c.
References ast_json_is_false(), ast_json_is_null(), ast_json_is_true(), AST_JSON_TRUE, ast_json_true(), ast_json_typeof(), ast_json_unref(), AST_TEST_NOT_RUN, AST_TEST_PASS, CATEGORY, sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.
|
static |
Definition at line 70 of file test_json.c.
References alloc_count, and ast_json_free().
Referenced by AST_TEST_DEFINE(), and json_test_init().
|
static |
JSON library has its own reference counting, so we'll provide our own allocators to test that everything gets freed as expected.
Definition at line 61 of file test_json.c.
References alloc_count, and ast_json_malloc().
Referenced by json_test_init().
|
static |
Definition at line 85 of file test_json.c.
References alloc_count, ast_json_reset_alloc_funcs(), and ast_test_status_update.
Referenced by load_module().
|
static |
Definition at line 78 of file test_json.c.
References alloc_count, ast_json_set_alloc_funcs(), json_debug_free(), and json_debug_malloc().
Referenced by load_module().
|
static |
Definition at line 1803 of file test_json.c.
References AST_MODULE_LOAD_SUCCESS, AST_TEST_REGISTER, CATEGORY, json_test_cleanup(), and json_test_init().
|
static |
fclose isn't NULL safe.
Definition at line 1265 of file test_json.c.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 1638 of file test_json.c.
References ast_json_equal(), ast_json_name_number(), ast_json_pack(), ast_json_unref(), and name.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 1746 of file test_json.c.
References AST_TEST_UNREGISTER.
|
static |
Definition at line 1868 of file test_json.c.
|
static |
Number of allocations from JSON library that have not yet been freed.
Definition at line 54 of file test_json.c.
Referenced by json_debug_free(), json_debug_malloc(), json_test_cleanup(), and json_test_init().
|
static |
Definition at line 1868 of file test_json.c.