Asterisk - The Open Source Telephony Project GIT-master-35be64c
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
test_extension_state.c File Reference

Extension state legacy callback tests. More...

#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/pbx.h"
#include "asterisk/devicestate.h"
#include "asterisk/astobj2.h"
#include "asterisk/lock.h"
#include "asterisk/time.h"
#include "asterisk/utils.h"
Include dependency graph for test_extension_state.c:

Go to the source code of this file.

Data Structures

struct  test_watcher
 Tracking for a single extension state callback. More...
 

Macros

#define TEST_CATEGORY   "/main/extension_state/"
 
#define TEST_CONTEXT   "test_extension_state"
 
#define TEST_DEVICE_PREFIX   "Custom:test_extension_state_"
 Prefix for the devices used by the test hints.
 
#define TEST_REGISTRAR   "test_extension_state"
 
#define TEST_TIMEOUT   5
 How long to wait for asynchronous events, in seconds.
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_module * AST_MODULE_SELF_SYM (void)
 
 AST_TEST_DEFINE (add_failure_ownership)
 
 AST_TEST_DEFINE (dash_spelling_dashed_first)
 
 AST_TEST_DEFINE (dash_spelling_dashless_first)
 
static enum ast_test_result_state dash_spelling_check (struct ast_test *test, const char *base, const char *suffix, int dashed_first)
 Watch two spellings of an extension that differ only by dashes.
 
static void dialplan_cleanup (void)
 
static int dialplan_setup (void)
 
static int load_module (void)
 
static int state_changed (const char *context, const char *exten, struct ast_state_cb_info *info, void *data)
 
static void state_destroyed (int id, void *data)
 
static int test_watcher_add (struct ast_test *test, const char *context, struct test_watcher *watcher)
 Add an extension state callback for a watcher.
 
static struct test_watcher * test_watcher_alloc (const char *exten)
 
static int test_watcher_remove (struct ast_test *test, struct test_watcher *watcher)
 Remove an extension state callback and wait for it to be destroyed.
 
static int test_watcher_wait_for_state (struct test_watcher *watcher, enum ast_extension_states state)
 Wait until a watcher has received the given extension state.
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Extension state tests" , .key = ASTERISK_GPL_KEY , .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
 
static ast_cond_t test_cond
 
static ast_mutex_t test_lock = AST_MUTEX_INIT_VALUE
 Protects watcher state and test_run.
 
static unsigned int test_run
 Used to make the extensions, and so the devices, differ between test runs.
 

Detailed Description

Extension state legacy callback tests.

Definition in file test_extension_state.c.

Macro Definition Documentation

◆ TEST_CATEGORY

#define TEST_CATEGORY   "/main/extension_state/"

Definition at line 42 of file test_extension_state.c.

◆ TEST_CONTEXT

#define TEST_CONTEXT   "test_extension_state"

Definition at line 43 of file test_extension_state.c.

◆ TEST_DEVICE_PREFIX

#define TEST_DEVICE_PREFIX   "Custom:test_extension_state_"

Prefix for the devices used by the test hints.

Device state is global, so the hints use device names reserved for this test to avoid affecting, or being affected by, any other hint.

Definition at line 52 of file test_extension_state.c.

◆ TEST_REGISTRAR

#define TEST_REGISTRAR   "test_extension_state"

Definition at line 44 of file test_extension_state.c.

◆ TEST_TIMEOUT

#define TEST_TIMEOUT   5

How long to wait for asynchronous events, in seconds.

Definition at line 55 of file test_extension_state.c.

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 449 of file test_extension_state.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 449 of file test_extension_state.c.

◆ AST_MODULE_SELF_SYM()

struct ast_module * AST_MODULE_SELF_SYM ( void  )

Definition at line 449 of file test_extension_state.c.

◆ AST_TEST_DEFINE() [1/3]

AST_TEST_DEFINE ( add_failure_ownership  )

Definition at line 381 of file test_extension_state.c.

382{
383 struct test_watcher *watcher;
385
386 switch (cmd) {
387 case TEST_INIT:
388 info->name = __func__;
389 info->category = TEST_CATEGORY;
390 info->summary = "Failed callback registration leaves data owned by the caller";
391 info->description =
392 "Adding a callback for an extension that does not exist must fail without\n"
393 "invoking the destroy callback, so the caller can release its own data.";
394 return AST_TEST_NOT_RUN;
395 case TEST_EXECUTE:
396 break;
397 }
398
399 watcher = test_watcher_alloc("3000");
400 if (!watcher) {
401 return AST_TEST_FAIL;
402 }
403
404 if (!test_watcher_add(test, "test_extension_state_nonexistent", watcher)) {
405 ast_test_status_update(test, "Callback for nonexistent extension unexpectedly added\n");
406 test_watcher_remove(test, watcher);
407 res = AST_TEST_FAIL;
408 } else {
409 /*
410 * Any destroy callback on the failure path happens synchronously while
411 * the add unwinds, so it has already been counted.
412 */
414 if (watcher->destroyed) {
415 res = AST_TEST_FAIL;
416 }
418 }
419
420 ao2_ref(watcher, -1);
421
422 return res;
423}
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition astobj2.h:459
#define ast_mutex_unlock(a)
Definition lock.h:197
#define ast_mutex_lock(a)
Definition lock.h:196
Tracking for a single extension state callback.
@ TEST_INIT
Definition test.h:200
@ TEST_EXECUTE
Definition test.h:201
#define ast_test_status_update(a, b, c...)
Definition test.h:129
ast_test_result_state
Definition test.h:193
@ AST_TEST_PASS
Definition test.h:195
@ AST_TEST_FAIL
Definition test.h:196
@ AST_TEST_NOT_RUN
Definition test.h:194
static int test_watcher_remove(struct ast_test *test, struct test_watcher *watcher)
Remove an extension state callback and wait for it to be destroyed.
static ast_mutex_t test_lock
Protects watcher state and test_run.
static int test_watcher_add(struct ast_test *test, const char *context, struct test_watcher *watcher)
Add an extension state callback for a watcher.
#define TEST_CATEGORY
static struct test_watcher * test_watcher_alloc(const char *exten)

References ao2_ref, ast_mutex_lock, ast_mutex_unlock, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, test_watcher::destroyed, TEST_CATEGORY, TEST_EXECUTE, TEST_INIT, test_lock, test_watcher_add(), test_watcher_alloc(), and test_watcher_remove().

◆ AST_TEST_DEFINE() [2/3]

AST_TEST_DEFINE ( dash_spelling_dashed_first  )

Definition at line 362 of file test_extension_state.c.

363{
364 switch (cmd) {
365 case TEST_INIT:
366 info->name = __func__;
367 info->category = TEST_CATEGORY;
368 info->summary = "Watch a dashless extension after the dashed spelling created the hint";
369 info->description =
370 "Watching the dashed spelling first creates the hint from a pattern. Watching\n"
371 "the dashless spelling must then also succeed, both watchers must be notified\n"
372 "of state changes of the hint's device, and both must be destroyed exactly once.";
373 return AST_TEST_NOT_RUN;
374 case TEST_EXECUTE:
375 break;
376 }
377
378 return dash_spelling_check(test, "2000", "y", 1);
379}
static enum ast_test_result_state dash_spelling_check(struct ast_test *test, const char *base, const char *suffix, int dashed_first)
Watch two spellings of an extension that differ only by dashes.

References AST_TEST_NOT_RUN, dash_spelling_check(), TEST_CATEGORY, TEST_EXECUTE, and TEST_INIT.

◆ AST_TEST_DEFINE() [3/3]

AST_TEST_DEFINE ( dash_spelling_dashless_first  )

Definition at line 341 of file test_extension_state.c.

342{
343 switch (cmd) {
344 case TEST_INIT:
345 info->name = __func__;
346 info->category = TEST_CATEGORY;
347 info->summary = "Watch a dashed extension after the dashless spelling created the hint";
348 info->description =
349 "Dashes are ignored in extension matching, so '1000x' and '1000-x' are the\n"
350 "same extension. Watching the dashless spelling first creates the hint from a\n"
351 "pattern. Watching the dashed spelling must then also succeed, both watchers\n"
352 "must be notified of state changes of the hint's device, and both must be\n"
353 "destroyed exactly once.";
354 return AST_TEST_NOT_RUN;
355 case TEST_EXECUTE:
356 break;
357 }
358
359 return dash_spelling_check(test, "1000", "x", 0);
360}

References AST_TEST_NOT_RUN, dash_spelling_check(), TEST_CATEGORY, TEST_EXECUTE, and TEST_INIT.

◆ dash_spelling_check()

static enum ast_test_result_state dash_spelling_check ( struct ast_test *  test,
const char *  base,
const char *  suffix,
int  dashed_first 
)
static

Watch two spellings of an extension that differ only by dashes.

This mirrors two phones with BLF keys for the same extension, one configured with a dash and one without. The first spelling creates the hint from the pattern. Both watchers must be added, both must be notified when the device of the hint changes state, and both must be destroyed exactly once.

Parameters
testThe test
baseThe leading digits of the extension
suffixThe trailing part of the extension, joined by a dash when dashed
dashed_firstWhether the dashed spelling is watched first, naming the device

The test run number is added to the extension, so that runs use different devices and a run is not affected by state left behind by an earlier one.

Definition at line 261 of file test_extension_state.c.

263{
264 struct test_watcher *watchers[2] = { NULL, NULL };
266 char second[AST_MAX_EXTENSION];
267 char device[AST_MAX_EXTENSION + sizeof(TEST_DEVICE_PREFIX)];
269 unsigned int run;
270 int added[2] = { 0, 0 };
271 int i;
272
274 run = ++test_run;
276
277 snprintf(first, sizeof(first), "%s%u%s%s", base, run, dashed_first ? "-" : "", suffix);
278 snprintf(second, sizeof(second), "%s%u%s%s", base, run, dashed_first ? "" : "-", suffix);
279 /* The device is named after the spelling that created the hint */
280 snprintf(device, sizeof(device), TEST_DEVICE_PREFIX "%s", first);
281
282 watchers[0] = test_watcher_alloc(first);
283 watchers[1] = test_watcher_alloc(second);
284 if (!watchers[0] || !watchers[1]) {
285 ast_test_status_update(test, "Failed to allocate watchers\n");
286 ao2_cleanup(watchers[0]);
287 ao2_cleanup(watchers[1]);
288 return AST_TEST_FAIL;
289 }
290
291 if (dialplan_setup()) {
292 ast_test_status_update(test, "Failed to set up dialplan\n");
293 res = AST_TEST_FAIL;
294 goto cleanup;
295 }
296
297 for (i = 0; i < ARRAY_LEN(watchers); i++) {
298 if (test_watcher_add(test, TEST_CONTEXT, watchers[i])) {
299 ast_test_status_update(test, "Failed to watch '%s'\n", watchers[i]->exten);
300 res = AST_TEST_FAIL;
301 } else {
302 added[i] = 1;
303 }
304 }
305
306 if (res == AST_TEST_PASS) {
308 for (i = 0; i < ARRAY_LEN(watchers); i++) {
310 ast_test_status_update(test, "Watcher of '%s' was not notified of InUse\n",
311 watchers[i]->exten);
312 res = AST_TEST_FAIL;
313 }
314 }
315
317 for (i = 0; i < ARRAY_LEN(watchers); i++) {
319 ast_test_status_update(test, "Watcher of '%s' was not notified of Idle\n",
320 watchers[i]->exten);
321 res = AST_TEST_FAIL;
322 }
323 }
324 }
325
326 for (i = 0; i < ARRAY_LEN(watchers); i++) {
327 if (added[i] && test_watcher_remove(test, watchers[i])) {
328 res = AST_TEST_FAIL;
329 }
330 }
331
332cleanup:
335 ao2_ref(watchers[0], -1);
336 ao2_ref(watchers[1], -1);
337
338 return res;
339}
struct sla_ringing_trunk * first
Definition app_sla.c:338
#define ao2_cleanup(obj)
Definition astobj2.h:1934
#define AST_MAX_EXTENSION
Definition channel.h:134
@ AST_DEVSTATE_CACHABLE
Definition devicestate.h:70
int ast_device_state_clear_cache(const char *device)
Clear the device from the stasis cache.
int ast_devstate_changed_literal(enum ast_device_state state, enum ast_devstate_cache cachable, const char *device)
Tells Asterisk the State for Device is changed.
@ AST_DEVICE_INUSE
Definition devicestate.h:55
@ AST_DEVICE_NOT_INUSE
Definition devicestate.h:54
@ AST_EXTENSION_NOT_INUSE
Definition pbx.h:64
@ AST_EXTENSION_INUSE
Definition pbx.h:65
static void cleanup(void)
Clean up any old apps that we don't need any more.
Definition res_stasis.c:327
#define NULL
Definition resample.c:96
char exten[AST_MAX_EXTENSION]
static int dialplan_setup(void)
#define TEST_DEVICE_PREFIX
Prefix for the devices used by the test hints.
static unsigned int test_run
Used to make the extensions, and so the devices, differ between test runs.
static int test_watcher_wait_for_state(struct test_watcher *watcher, enum ast_extension_states state)
Wait until a watcher has received the given extension state.
#define TEST_CONTEXT
static void dialplan_cleanup(void)
#define ARRAY_LEN(a)
Definition utils.h:706

References ao2_cleanup, ao2_ref, ARRAY_LEN, AST_DEVICE_INUSE, AST_DEVICE_NOT_INUSE, ast_device_state_clear_cache(), AST_DEVSTATE_CACHABLE, ast_devstate_changed_literal(), AST_EXTENSION_INUSE, AST_EXTENSION_NOT_INUSE, AST_MAX_EXTENSION, ast_mutex_lock, ast_mutex_unlock, AST_TEST_FAIL, AST_TEST_PASS, ast_test_status_update, cleanup(), dialplan_cleanup(), dialplan_setup(), test_watcher::exten, first, NULL, TEST_CONTEXT, TEST_DEVICE_PREFIX, test_lock, test_run, test_watcher_add(), test_watcher_alloc(), test_watcher_remove(), and test_watcher_wait_for_state().

Referenced by AST_TEST_DEFINE(), and AST_TEST_DEFINE().

◆ dialplan_cleanup()

static void dialplan_cleanup ( void  )
static

Definition at line 240 of file test_extension_state.c.

241{
243}
int ast_context_destroy_by_name(const char *context, const char *registrar)
Destroy a context by name.
Definition pbx.c:6491
#define TEST_REGISTRAR

References ast_context_destroy_by_name(), TEST_CONTEXT, and TEST_REGISTRAR.

Referenced by dash_spelling_check().

◆ dialplan_setup()

static int dialplan_setup ( void  )
static

Definition at line 222 of file test_extension_state.c.

223{
225 return -1;
226 }
227
228 /*
229 * A pattern hint creates a concrete hint, and so a device, using the spelling
230 * of whichever lookup comes first.
231 */
234 return -1;
235 }
236
237 return 0;
238}
int ast_add_extension(const char *context, int replace, const char *extension, int priority, const char *label, const char *callerid, const char *application, void *data, void(*datad)(void *), const char *registrar)
Add and extension to an extension context.
Definition pbx.c:5206
struct ast_context * ast_context_find_or_create(struct ast_context **extcontexts, struct ast_hashtab *exttable, const char *name, const char *registrar)
Register a new context or find an existing one.
Definition pbx.c:4542
#define PRIORITY_HINT
Definition pbx.h:54

References ast_add_extension(), ast_context_find_or_create(), NULL, PRIORITY_HINT, TEST_CONTEXT, TEST_DEVICE_PREFIX, and TEST_REGISTRAR.

Referenced by dash_spelling_check().

◆ load_module()

static int load_module ( void  )
static

Definition at line 435 of file test_extension_state.c.

436{
438
439 /* Start somewhere other than where an earlier load of this module likely started */
440 test_run = ast_random() % 100000;
441
442 AST_TEST_REGISTER(dash_spelling_dashless_first);
443 AST_TEST_REGISTER(dash_spelling_dashed_first);
444 AST_TEST_REGISTER(add_failure_ownership);
445
447}
#define ast_cond_init(cond, attr)
Definition lock.h:208
@ AST_MODULE_LOAD_SUCCESS
Definition module.h:70
#define AST_TEST_REGISTER(cb)
Definition test.h:127
static ast_cond_t test_cond
long int ast_random(void)
Definition utils.c:2346

References ast_cond_init, AST_MODULE_LOAD_SUCCESS, ast_random(), AST_TEST_REGISTER, NULL, test_cond, and test_run.

◆ state_changed()

static int state_changed ( const char *  context,
const char *  exten,
struct ast_state_cb_info *  info,
void *  data 
)
static

Definition at line 98 of file test_extension_state.c.

99{
100 struct test_watcher *watcher = data;
101
103 watcher->last_state = info->exten_state;
106
107 return 0;
108}
#define ast_cond_broadcast(cond)
Definition lock.h:211
enum ast_extension_states last_state

References ast_cond_broadcast, ast_mutex_lock, ast_mutex_unlock, test_watcher::last_state, test_cond, and test_lock.

Referenced by test_watcher_add(), and test_watcher_remove().

◆ state_destroyed()

static void state_destroyed ( int  id,
void *  data 
)
static

Definition at line 110 of file test_extension_state.c.

111{
112 struct test_watcher *watcher = data;
113
115 watcher->destroyed++;
118
119 /* Release the reference held by the callback */
120 ao2_ref(watcher, -1);
121}

References ao2_ref, ast_cond_broadcast, ast_mutex_lock, ast_mutex_unlock, test_watcher::destroyed, test_cond, and test_lock.

Referenced by test_watcher_add().

◆ test_watcher_add()

static int test_watcher_add ( struct ast_test *  test,
const char *  context,
struct test_watcher *  watcher 
)
static

Add an extension state callback for a watcher.

Return values
0on success
-1on failure, in which case the destroy callback must not have been invoked as the caller retains ownership of the callback data

Definition at line 130 of file test_extension_state.c.

131{
132 int destroyed;
133
134 /* The callback holds its own reference to the watcher */
135 ao2_ref(watcher, +1);
136
137 watcher->id = ast_extension_state_add_destroy_extended(context, watcher->exten,
139 if (watcher->id >= 0) {
140 return 0;
141 }
142
143 /*
144 * On failure the caller keeps ownership, so the reference given to the callback
145 * is ours to release. If the destroy callback was wrongly invoked it has already
146 * released it, synchronously, before the add returned.
147 */
149 destroyed = watcher->destroyed;
151
152 if (destroyed) {
153 ast_test_status_update(test, "Destroy callback for '%s' invoked %d times on failed add\n",
154 watcher->exten, destroyed);
155 } else {
156 ao2_ref(watcher, -1);
157 }
158
159 return -1;
160}
int ast_extension_state_add_destroy_extended(const char *context, const char *exten, ast_state_cb_type change_cb, ast_state_cb_destroy_type destroy_cb, void *data)
Add watcher for extended extension states with destructor.
static int state_changed(const char *context, const char *exten, struct ast_state_cb_info *info, void *data)
static void state_destroyed(int id, void *data)

References ao2_ref, ast_extension_state_add_destroy_extended(), ast_mutex_lock, ast_mutex_unlock, ast_test_status_update, test_watcher::destroyed, test_watcher::exten, test_watcher::id, state_changed(), state_destroyed(), and test_lock.

Referenced by AST_TEST_DEFINE(), and dash_spelling_check().

◆ test_watcher_alloc()

static struct test_watcher * test_watcher_alloc ( const char *  exten)
static

Definition at line 82 of file test_extension_state.c.

83{
84 struct test_watcher *watcher;
85
86 watcher = ao2_alloc_options(sizeof(*watcher), NULL, AO2_ALLOC_OPT_LOCK_NOLOCK);
87 if (!watcher) {
88 return NULL;
89 }
90
91 watcher->id = -1;
93 ast_copy_string(watcher->exten, exten, sizeof(watcher->exten));
94
95 return watcher;
96}
@ AO2_ALLOC_OPT_LOCK_NOLOCK
Definition astobj2.h:367
#define ao2_alloc_options(data_size, destructor_fn, options)
Definition astobj2.h:404
@ AST_EXTENSION_REMOVED
Definition pbx.h:62
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition strings.h:425

References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ast_copy_string(), AST_EXTENSION_REMOVED, test_watcher::exten, test_watcher::id, test_watcher::last_state, and NULL.

Referenced by AST_TEST_DEFINE(), and dash_spelling_check().

◆ test_watcher_remove()

static int test_watcher_remove ( struct ast_test *  test,
struct test_watcher *  watcher 
)
static

Remove an extension state callback and wait for it to be destroyed.

Return values
0if the destroy callback was invoked exactly once
-1otherwise
Note
If destruction does not occur in time the callback keeps its reference, so the watcher remains valid if the callback is invoked later.

Definition at line 171 of file test_extension_state.c.

172{
173 struct timeval now = ast_tvnow();
174 struct timespec deadline = {
175 .tv_sec = now.tv_sec + TEST_TIMEOUT,
176 .tv_nsec = now.tv_usec * 1000,
177 };
178 int destroyed;
179
181
183 while (!watcher->destroyed) {
184 if (ast_cond_timedwait(&test_cond, &test_lock, &deadline) == ETIMEDOUT) {
185 break;
186 }
187 }
188 destroyed = watcher->destroyed;
190
191 if (destroyed != 1) {
192 ast_test_status_update(test, "Destroy callback for '%s' invoked %d times, expected 1\n",
193 watcher->exten, destroyed);
194 return -1;
195 }
196
197 return 0;
198}
#define ast_cond_timedwait(cond, mutex, time)
Definition lock.h:213
int ast_extension_state_del(int id, ast_state_cb_type change_cb)
Deletes a state change watcher by ID.
#define TEST_TIMEOUT
How long to wait for asynchronous events, in seconds.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition time.h:159

References ast_cond_timedwait, ast_extension_state_del(), ast_mutex_lock, ast_mutex_unlock, ast_test_status_update, ast_tvnow(), test_watcher::destroyed, test_watcher::exten, test_watcher::id, state_changed(), test_cond, test_lock, and TEST_TIMEOUT.

Referenced by AST_TEST_DEFINE(), and dash_spelling_check().

◆ test_watcher_wait_for_state()

static int test_watcher_wait_for_state ( struct test_watcher *  watcher,
enum ast_extension_states  state 
)
static

Wait until a watcher has received the given extension state.

Definition at line 201 of file test_extension_state.c.

202{
203 struct timeval now = ast_tvnow();
204 struct timespec deadline = {
205 .tv_sec = now.tv_sec + TEST_TIMEOUT,
206 .tv_nsec = now.tv_usec * 1000,
207 };
208 int res;
209
211 while (watcher->last_state != state) {
212 if (ast_cond_timedwait(&test_cond, &test_lock, &deadline) == ETIMEDOUT) {
213 break;
214 }
215 }
216 res = watcher->last_state == state ? 0 : -1;
218
219 return res;
220}

References ast_cond_timedwait, ast_mutex_lock, ast_mutex_unlock, ast_tvnow(), test_watcher::last_state, test_cond, test_lock, and TEST_TIMEOUT.

Referenced by dash_spelling_check().

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 425 of file test_extension_state.c.

426{
427 AST_TEST_UNREGISTER(dash_spelling_dashless_first);
428 AST_TEST_UNREGISTER(dash_spelling_dashed_first);
429 AST_TEST_UNREGISTER(add_failure_ownership);
431
432 return 0;
433}
#define ast_cond_destroy(cond)
Definition lock.h:209
#define AST_TEST_UNREGISTER(cb)
Definition test.h:128

References ast_cond_destroy, AST_TEST_UNREGISTER, and test_cond.

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Extension state tests" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, }
static

Definition at line 449 of file test_extension_state.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 449 of file test_extension_state.c.

◆ test_cond

ast_cond_t test_cond
static

◆ test_lock

ast_mutex_t test_lock = AST_MUTEX_INIT_VALUE
static

◆ test_run

unsigned int test_run
static

Used to make the extensions, and so the devices, differ between test runs.

Definition at line 80 of file test_extension_state.c.

Referenced by dash_spelling_check(), and load_module().