Asterisk - The Open Source Telephony Project
18.5.0
|
Test JSON API. More...
#include "asterisk.h"
#include "asterisk/json.h"
#include "asterisk/module.h"
#include "asterisk/test.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_false) | |
AST_TEST_DEFINE (json_test_true) | |
AST_TEST_DEFINE (json_test_bool0) | |
AST_TEST_DEFINE (json_test_bool1) | |
AST_TEST_DEFINE (json_test_null) | |
AST_TEST_DEFINE (json_test_null_val) | |
AST_TEST_DEFINE (json_test_string) | |
AST_TEST_DEFINE (json_test_string_null) | |
AST_TEST_DEFINE (json_test_stringf) | |
AST_TEST_DEFINE (json_test_int) | |
AST_TEST_DEFINE (json_test_non_int) | |
AST_TEST_DEFINE (json_test_array_create) | |
AST_TEST_DEFINE (json_test_array_append) | |
AST_TEST_DEFINE (json_test_array_inset) | |
AST_TEST_DEFINE (json_test_array_set) | |
AST_TEST_DEFINE (json_test_array_remove) | |
AST_TEST_DEFINE (json_test_array_clear) | |
AST_TEST_DEFINE (json_test_array_extend) | |
AST_TEST_DEFINE (json_test_array_null) | |
AST_TEST_DEFINE (json_test_object_alloc) | |
AST_TEST_DEFINE (json_test_object_set) | |
AST_TEST_DEFINE (json_test_object_set_overwrite) | |
AST_TEST_DEFINE (json_test_object_get) | |
AST_TEST_DEFINE (json_test_object_del) | |
AST_TEST_DEFINE (json_test_object_clear) | |
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_iter) | |
AST_TEST_DEFINE (json_test_object_iter_null) | |
AST_TEST_DEFINE (json_test_dump_load_string) | |
AST_TEST_DEFINE (json_test_dump_load_str) | |
AST_TEST_DEFINE (json_test_dump_str_fail) | |
AST_TEST_DEFINE (json_test_load_buffer) | |
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_parse_errors) | |
AST_TEST_DEFINE (json_test_pack) | |
AST_TEST_DEFINE (json_test_pack_ownership) | |
AST_TEST_DEFINE (json_test_pack_errors) | |
AST_TEST_DEFINE (json_test_copy) | |
AST_TEST_DEFINE (json_test_deep_copy) | |
AST_TEST_DEFINE (json_test_copy_null) | |
AST_TEST_DEFINE (json_test_circular_object) | |
AST_TEST_DEFINE (json_test_circular_array) | |
AST_TEST_DEFINE (json_test_clever_circle) | |
AST_TEST_DEFINE (json_test_name_number) | |
AST_TEST_DEFINE (json_test_timeval) | |
AST_TEST_DEFINE (json_test_cep) | |
static int | load_module (void) |
static FILE * | mkstemp_file (char *template, const char *mode) |
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_malloc (size_t size) |
static void | json_debug_free (void *p) |
static int | json_test_init (struct ast_test_info *info, struct ast_test *test) |
static int | json_test_cleanup (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 47 of file test_json.c.
Referenced by AST_TEST_DEFINE(), and load_module().
|
static |
Definition at line 1828 of file test_json.c.
|
static |
Definition at line 1828 of file test_json.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1828 of file test_json.c.
AST_TEST_DEFINE | ( | json_test_false | ) |
Definition at line 96 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_true | ) |
Definition at line 121 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.
AST_TEST_DEFINE | ( | json_test_bool0 | ) |
Definition at line 146 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 173 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_null | ) |
Definition at line 200 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 225 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_string | ) |
Definition at line 251 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 291 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 323 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_int | ) |
Definition at line 356 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_non_int | ) |
Definition at line 397 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_array_create | ) |
Definition at line 435 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_append | ) |
Definition at line 459 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_inset | ) |
Definition at line 488 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_set | ) |
Definition at line 515 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_array_remove | ) |
Definition at line 542 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_clear | ) |
Definition at line 569 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_extend | ) |
Definition at line 594 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_null | ) |
Definition at line 640 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_object_alloc | ) |
Definition at line 671 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_set | ) |
Definition at line 695 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 727 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_object_get | ) |
Definition at line 752 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_del | ) |
Definition at line 776 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_clear | ) |
Definition at line 805 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_merge_all | ) |
Definition at line 833 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 878 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 921 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 966 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_iter | ) |
Definition at line 1001 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 1064 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_dump_load_string | ) |
Definition at line 1093 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_load_str | ) |
Definition at line 1122 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_str_fail | ) |
Definition at line 1152 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_load_buffer | ) |
Definition at line 1179 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_dump_load_file | ) |
Definition at line 1235 of file test_json.c.
References 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(), mkstemp_file(), NULL, RAII_VAR, safe_fclose(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_dump_load_new_file | ) |
Definition at line 1270 of file test_json.c.
References 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(), mkstemp_file(), NULL, RAII_VAR, safe_fclose(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_dump_load_null | ) |
Definition at line 1302 of file test_json.c.
References 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(), mkstemp_file(), NULL, RAII_VAR, safe_fclose(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | json_test_parse_errors | ) |
Definition at line 1340 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_pack | ) |
Definition at line 1368 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_ownership | ) |
Definition at line 1398 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_pack_errors | ) |
Definition at line 1418 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_copy | ) |
Definition at line 1441 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_deep_copy | ) |
Definition at line 1467 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_copy_null | ) |
Definition at line 1496 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_circular_object | ) |
Definition at line 1516 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_circular_array | ) |
Definition at line 1542 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_clever_circle | ) |
Definition at line 1567 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_name_number | ) |
Definition at line 1618 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_timeval | ) |
Definition at line 1639 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_cep | ) |
Definition at line 1667 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.
|
static |
Definition at line 68 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 59 of file test_json.c.
References alloc_count, and ast_json_malloc().
Referenced by json_test_init().
|
static |
Definition at line 83 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 76 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 1764 of file test_json.c.
References AST_MODULE_INFO(), AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, AST_TEST_REGISTER, ast_test_register_cleanup(), ast_test_register_init(), ASTERISK_GPL_KEY, CATEGORY, json_test_cleanup(), json_test_init(), and unload_module().
|
static |
Definition at line 1214 of file test_json.c.
References ast_log, errno, make_ari_stubs::file, LOG_ERROR, and NULL.
Referenced by AST_TEST_DEFINE().
|
static |
fclose isn't NULL safe.
Definition at line 1206 of file test_json.c.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 1600 of file test_json.c.
References ast_json_equal(), ast_json_name_number(), ast_json_pack(), and ast_json_unref().
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 1708 of file test_json.c.
References AST_TEST_UNREGISTER.
Referenced by load_module().
|
static |
Definition at line 1828 of file test_json.c.
|
static |
Number of allocations from JSON library that have not yet been freed.
Definition at line 52 of file test_json.c.
Referenced by json_debug_free(), json_debug_malloc(), json_test_cleanup(), and json_test_init().
|
static |
Definition at line 1828 of file test_json.c.