Asterisk - The Open Source Telephony Project  21.4.1
Functions | Variables
test_ari.c File Reference

Test ARI API.

Author
David M. Lee, II <dlee@digium.com> 
.
More...

#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/ari.h"

Go to the source code of this file.

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
 AST_TEST_DEFINE (get_docs)
 
 AST_TEST_DEFINE (get_docs_nohost)
 
 AST_TEST_DEFINE (get_docs_notfound)
 
 AST_TEST_DEFINE (get_docs_hackerz)
 
 AST_TEST_DEFINE (invoke_get)
 
 AST_TEST_DEFINE (invoke_wildcard)
 
 AST_TEST_DEFINE (invoke_delete)
 
 AST_TEST_DEFINE (invoke_post)
 
 AST_TEST_DEFINE (invoke_bad_post)
 
 AST_TEST_DEFINE (invoke_not_found)
 
static int load_module (void)
 
static struct ast_ari_responseresponse_alloc (void)
 
static void response_free (struct ast_ari_response *resp)
 
static void * setup_invocation_test (void)
 
static void tear_down_invocation_test (void *ignore)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "ARI 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, .requires = "res_ari", }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
#define HANDLER(name, response_code)
 
static int invocation_count
 
static struct stasis_rest_handlers bang
 
static struct stasis_rest_handlers bar
 
static struct stasis_rest_handlers bam
 
static struct stasis_rest_handlers test_root
 
static void handler (const char *name, int response_code, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
 

Detailed Description

Test ARI API.

Author
David M. Lee, II <dlee@digium.com> 
.

Definition in file test_ari.c.

Function Documentation

static void* setup_invocation_test ( void  )
static

\ internal Setup test fixture for invocation tests.

Definition at line 181 of file test_ari.c.

References ast_ari_add_handler().

181  {
182  int r;
183  invocation_count = 0;
184  r = ast_ari_add_handler(&test_root);
185  ast_assert(r == 0);
186  return &invocation_count;
187 }
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
Definition: res_ari.c:179
static void tear_down_invocation_test ( void *  ignore)
static

\ internal Tear down test fixture for invocation tests.

Definition at line 193 of file test_ari.c.

References ast_ari_remove_handler().

193  {
194  if (!ignore) {
195  return;
196  }
197  ast_ari_remove_handler(&test_root);
198 }
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
Definition: res_ari.c:202