Asterisk - The Open Source Telephony Project  18.5.0
Data Structures | Macros | Functions | Variables
test_linkedlists.c File Reference

Linked List Tests. More...

#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/strings.h"
#include "asterisk/logger.h"
#include "asterisk/linkedlists.h"
#include "asterisk/dlinkedlists.h"
Include dependency graph for test_linkedlists.c:

Go to the source code of this file.

Data Structures

struct  test_dbl_llist
 
struct  test_llist
 
struct  test_val
 

Macros

#define ELEM_OR_FAIL(x, y)
 
#define MATCH_OR_FAIL(list, val, retbuf)
 
#define MATCH_OR_FAIL_DBL(list, val, retbuf)
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
 AST_TEST_DEFINE (single_ll_tests)
 
 AST_TEST_DEFINE (double_ll_tests)
 
static int dbl_list_expect_forward (struct test_dbl_llist *test_list, const char *expect, struct ast_str **buf)
 
static int dbl_list_expect_reverse (struct test_dbl_llist *test_list, const char *expect, struct ast_str **buf)
 
static int list_expect (struct test_llist *test_list, const char *expect, struct ast_str **buf)
 
static int load_module (void)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Test Linked Lists" , .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, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, }
 
static struct test_val a = { "A" }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static struct test_val b = { "B" }
 
static struct test_val c = { "C" }
 
static struct test_val d = { "D" }
 

Detailed Description

Linked List Tests.

Author
Terry Wilson twils.nosp@m.on@d.nosp@m.igium.nosp@m..com

Definition in file test_linkedlists.c.

Macro Definition Documentation

◆ ELEM_OR_FAIL

#define ELEM_OR_FAIL (   x,
 
)
Value:
if ((x) != (y)) { \
ast_test_status_update(test, "Expected: %s, Got: %s\n", (x)->name, (y)->name); \
return AST_TEST_FAIL; \
}
static const char name[]
Definition: cdr_mysql.c:74

Definition at line 119 of file test_linkedlists.c.

Referenced by AST_TEST_DEFINE().

◆ MATCH_OR_FAIL

#define MATCH_OR_FAIL (   list,
  val,
  retbuf 
)
Value:
if (list_expect(list, val, &retbuf)) { \
ast_test_status_update(test, "Expected: %s, Got: %s\n", val, ast_str_buffer(retbuf)); \
return AST_TEST_FAIL; \
}
Definition: ast_expr2.c:325
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Definition: strings.h:714
static int list_expect(struct test_llist *test_list, const char *expect, struct ast_str **buf)

Definition at line 103 of file test_linkedlists.c.

Referenced by AST_TEST_DEFINE().

◆ MATCH_OR_FAIL_DBL

#define MATCH_OR_FAIL_DBL (   list,
  val,
  retbuf 
)

Definition at line 109 of file test_linkedlists.c.

Referenced by AST_TEST_DEFINE().

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 661 of file test_linkedlists.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 661 of file test_linkedlists.c.

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 661 of file test_linkedlists.c.

◆ AST_TEST_DEFINE() [1/2]

AST_TEST_DEFINE ( single_ll_tests  )

Definition at line 125 of file test_linkedlists.c.

References ast_alloca, ast_free, AST_LIST_APPEND_LIST, AST_LIST_EMPTY, AST_LIST_FIRST, AST_LIST_INSERT_AFTER, AST_LIST_INSERT_BEFORE_CURRENT, AST_LIST_INSERT_HEAD, AST_LIST_INSERT_LIST_AFTER, AST_LIST_INSERT_TAIL, AST_LIST_LAST, AST_LIST_NEXT, AST_LIST_REMOVE, AST_LIST_REMOVE_CURRENT, AST_LIST_REMOVE_HEAD, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_str_create, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, buf, ELEM_OR_FAIL, sip_to_pjsip::info(), test_val::list, MATCH_OR_FAIL, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.

126 {
127  RAII_VAR(struct ast_str *, buf, NULL, ast_free);
128  struct test_llist test_list = { 0, };
129  struct test_llist other_list = { 0, };
130  struct test_val *bogus;
131 
132  switch (cmd) {
133  case TEST_INIT:
134  info->name = "ll_tests";
135  info->category = "/main/linkedlists/";
136  info->summary = "single linked list unit test";
137  info->description =
138  "Test the single linked list API";
139  return AST_TEST_NOT_RUN;
140  case TEST_EXECUTE:
141  break;
142  }
143 
144  if (!(buf = ast_str_create(16))) {
145  return AST_TEST_FAIL;
146  }
147 
148  if (!(bogus = ast_alloca(sizeof(*bogus)))) {
149  return AST_TEST_FAIL;
150  }
151 
152  if (AST_LIST_REMOVE(&test_list, bogus, list)) {
153  ast_test_status_update(test, "AST_LIST_REMOVE should safely return NULL for missing element from empty list\n");
154  return AST_TEST_FAIL;
155  }
156 
157  /* INSERT_HEAD and REMOVE_HEAD tests */
158  AST_LIST_INSERT_HEAD(&test_list, &a, list);
159  MATCH_OR_FAIL(&test_list, "A", buf);
160  AST_LIST_INSERT_HEAD(&test_list, &b, list);
161  MATCH_OR_FAIL(&test_list, "BA", buf);
162  AST_LIST_REMOVE_HEAD(&test_list, list);
163  MATCH_OR_FAIL(&test_list, "A", buf);
164  AST_LIST_REMOVE_HEAD(&test_list, list);
165  MATCH_OR_FAIL(&test_list, "", buf);
166  if (AST_LIST_REMOVE_HEAD(&test_list, list)) {
167  ast_test_status_update(test, "Somehow removed an item from the head of a list that didn't exist\n");
168  return AST_TEST_FAIL;
169  }
170  MATCH_OR_FAIL(&test_list, "", buf);
171 
172  /* Check empty list test */
173 
174  if (!AST_LIST_EMPTY(&test_list)) {
175  ast_test_status_update(test, "List should be empty\n");
176  return AST_TEST_FAIL;
177  }
178 
179  /* Insert tail and remove specific item tests. */
180 
181  AST_LIST_INSERT_TAIL(&test_list, &a, list);
182  MATCH_OR_FAIL(&test_list, "A", buf);
183  AST_LIST_INSERT_TAIL(&test_list, &b, list);
184  MATCH_OR_FAIL(&test_list, "AB", buf);
185  AST_LIST_INSERT_TAIL(&test_list, &c, list);
186  MATCH_OR_FAIL(&test_list, "ABC", buf);
187  AST_LIST_INSERT_TAIL(&test_list, &d, list);
188  MATCH_OR_FAIL(&test_list, "ABCD", buf);
189  if (AST_LIST_REMOVE(&test_list, bogus, list)) {
190  ast_test_status_update(test, "AST_LIST_REMOVE should safely return NULL for missing element\n");
191  return AST_TEST_FAIL;
192  }
193  bogus = NULL;
194  if (AST_LIST_REMOVE(&test_list, bogus, list)) {
195  ast_test_status_update(test, "AST_LIST_REMOVE should safely return NULL for element set to NULL\n");
196  return AST_TEST_FAIL;
197  }
198  AST_LIST_REMOVE(&test_list, &b, list);
199  MATCH_OR_FAIL(&test_list, "ACD", buf);
200  AST_LIST_REMOVE(&test_list, &d, list);
201  MATCH_OR_FAIL(&test_list, "AC", buf);
202  AST_LIST_REMOVE(&test_list, &a, list);
203  MATCH_OR_FAIL(&test_list, "C", buf);
204  AST_LIST_REMOVE(&test_list, &c, list);
205  MATCH_OR_FAIL(&test_list, "", buf);
206  if (!AST_LIST_EMPTY(&test_list)) {
207  ast_test_status_update(test, "List should be empty\n");
208  return AST_TEST_FAIL;
209  }
210  if (AST_LIST_REMOVE(&test_list, bogus, list)) {
211  ast_test_status_update(test, "AST_LIST_REMOVE should safely return NULL asked to remove a NULL pointer from an empty list\n");
212  return AST_TEST_FAIL;
213  }
214 
215  /* Insert item after specific item tests */
216 
217  AST_LIST_INSERT_HEAD(&test_list, &a, list);
218  MATCH_OR_FAIL(&test_list, "A", buf);
219  AST_LIST_INSERT_TAIL(&test_list, &c, list);
220  MATCH_OR_FAIL(&test_list, "AC", buf);
221  AST_LIST_INSERT_AFTER(&test_list, &a, &b, list);
222  MATCH_OR_FAIL(&test_list, "ABC", buf);
223  AST_LIST_INSERT_AFTER(&test_list, &c, &d, list);
224  MATCH_OR_FAIL(&test_list, "ABCD", buf);
225 
226  ELEM_OR_FAIL(AST_LIST_FIRST(&test_list), &a);
227  ELEM_OR_FAIL(AST_LIST_LAST(&test_list), &d);
229 
230  AST_LIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, list) {
232  }
234 
235  if (!AST_LIST_EMPTY(&test_list)) {
236  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
237  return AST_TEST_FAIL;
238  }
239 
240  /* Append list test */
241 
242  AST_LIST_INSERT_HEAD(&test_list, &a, list);
243  MATCH_OR_FAIL(&test_list, "A", buf);
244  AST_LIST_INSERT_TAIL(&test_list, &b, list);
245  MATCH_OR_FAIL(&test_list, "AB", buf);
246  AST_LIST_INSERT_HEAD(&other_list, &c, list);
247  MATCH_OR_FAIL(&other_list, "C", buf);
248  AST_LIST_INSERT_TAIL(&other_list, &d, list);
249  MATCH_OR_FAIL(&other_list, "CD", buf);
250  AST_LIST_APPEND_LIST(&test_list, &other_list, list);
251  MATCH_OR_FAIL(&test_list, "ABCD", buf);
252  MATCH_OR_FAIL(&other_list, "", buf);
253  AST_LIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, list) {
255  }
257  if (!AST_LIST_EMPTY(&test_list)) {
258  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
259  return AST_TEST_FAIL;
260  }
261 
262  /* Insert list after specific item in middle test */
263 
264  AST_LIST_INSERT_HEAD(&test_list, &a, list);
265  MATCH_OR_FAIL(&test_list, "A", buf);
266  AST_LIST_INSERT_TAIL(&test_list, &d, list);
267  MATCH_OR_FAIL(&test_list, "AD", buf);
268  AST_LIST_INSERT_HEAD(&other_list, &b, list);
269  MATCH_OR_FAIL(&other_list, "B", buf);
270  AST_LIST_INSERT_TAIL(&other_list, &c, list);
271  MATCH_OR_FAIL(&other_list, "BC", buf);
272  AST_LIST_INSERT_LIST_AFTER(&test_list, &other_list, &a, list);
273  MATCH_OR_FAIL(&test_list, "ABCD", buf);
274  MATCH_OR_FAIL(&other_list, "", buf);
275  AST_LIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, list) {
277  }
279  if (!AST_LIST_EMPTY(&test_list)) {
280  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
281  return AST_TEST_FAIL;
282  }
283 
284  /* Insert list after specific item on end test */
285 
286  AST_LIST_INSERT_HEAD(&test_list, &a, list);
287  MATCH_OR_FAIL(&test_list, "A", buf);
288  AST_LIST_INSERT_TAIL(&test_list, &b, list);
289  MATCH_OR_FAIL(&test_list, "AB", buf);
290  AST_LIST_INSERT_HEAD(&other_list, &c, list);
291  MATCH_OR_FAIL(&other_list, "C", buf);
292  AST_LIST_INSERT_TAIL(&other_list, &d, list);
293  MATCH_OR_FAIL(&other_list, "CD", buf);
294  AST_LIST_INSERT_LIST_AFTER(&test_list, &other_list, &b, list);
295  MATCH_OR_FAIL(&test_list, "ABCD", buf);
296  MATCH_OR_FAIL(&other_list, "", buf);
297  AST_LIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, list) {
299  }
301  if (!AST_LIST_EMPTY(&test_list)) {
302  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
303  return AST_TEST_FAIL;
304  }
305 
306  /* Safe traversal list modification tests */
307 
308  AST_LIST_INSERT_HEAD(&test_list, &a, list);
309  MATCH_OR_FAIL(&test_list, "A", buf);
310  AST_LIST_INSERT_TAIL(&test_list, &d, list);
311  MATCH_OR_FAIL(&test_list, "AD", buf);
312  AST_LIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, list) {
313  if (bogus == &d) {
315  MATCH_OR_FAIL(&test_list, "ABD", buf);
317  MATCH_OR_FAIL(&test_list, "ABCD", buf);
319  MATCH_OR_FAIL(&test_list, "ABC", buf);
320  }
321  }
323  MATCH_OR_FAIL(&test_list, "ABC", buf);
324  AST_LIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, list) {
326  }
328  if (!AST_LIST_EMPTY(&test_list)) {
329  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
330  return AST_TEST_FAIL;
331  }
332 
333  return AST_TEST_PASS;
334 }
#define AST_LIST_INSERT_LIST_AFTER(head, list, elm, field)
Inserts a whole list after a specific entry in a list.
Definition: linkedlists.h:811
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
Definition: linkedlists.h:420
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
static struct test_val d
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
Definition: linkedlists.h:438
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
Definition: linkedlists.h:449
static struct test_val c
#define NULL
Definition: resample.c:96
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
Definition: linkedlists.h:855
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
Definition: linkedlists.h:614
#define AST_LIST_INSERT_AFTER(head, listelm, elm, field)
Inserts a list entry after a given entry.
Definition: linkedlists.h:694
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:911
#define ast_test_status_update(a, b, c...)
Definition: test.h:129
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
Definition: linkedlists.h:556
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
Definition: linkedlists.h:832
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
Definition: astmm.h:290
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
Definition: linkedlists.h:730
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
def info(msg)
#define AST_LIST_LAST(head)
Returns the last entry contained in a list.
Definition: linkedlists.h:428
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
Definition: linkedlists.h:710
#define ast_free(a)
Definition: astmm.h:182
#define ELEM_OR_FAIL(x, y)
#define MATCH_OR_FAIL(list, val, retbuf)
struct test_val::@512 list
static struct test_val b
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
Definition: linkedlists.h:528
#define AST_LIST_INSERT_BEFORE_CURRENT(elm, field)
Inserts a list entry before the current entry during a traversal.
Definition: linkedlists.h:598
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
Definition: strings.h:620
#define AST_LIST_APPEND_LIST(head, list, field)
Appends a whole list to the tail of a list.
Definition: linkedlists.h:782
static struct test_val a

◆ AST_TEST_DEFINE() [2/2]

AST_TEST_DEFINE ( double_ll_tests  )

Definition at line 336 of file test_linkedlists.c.

References ast_alloca, AST_DLLIST_APPEND_DLLIST, AST_DLLIST_EMPTY, AST_DLLIST_FIRST, AST_DLLIST_INSERT_AFTER, AST_DLLIST_INSERT_AFTER_CURRENT, AST_DLLIST_INSERT_BEFORE, AST_DLLIST_INSERT_BEFORE_CURRENT, AST_DLLIST_INSERT_HEAD, AST_DLLIST_INSERT_TAIL, AST_DLLIST_LAST, AST_DLLIST_NEXT, AST_DLLIST_PREV, AST_DLLIST_REMOVE, AST_DLLIST_REMOVE_CURRENT, AST_DLLIST_REMOVE_HEAD, AST_DLLIST_REMOVE_TAIL, AST_DLLIST_REMOVE_VERIFY, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END, AST_DLLIST_TRAVERSE_SAFE_BEGIN, AST_DLLIST_TRAVERSE_SAFE_END, ast_free, ast_str_create, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, buf, test_val::dbl_list, ELEM_OR_FAIL, sip_to_pjsip::info(), MATCH_OR_FAIL_DBL, NULL, RAII_VAR, TEST_EXECUTE, and TEST_INIT.

337 {
338  RAII_VAR(struct ast_str *, buf, NULL, ast_free);
339  struct test_dbl_llist test_list = { 0, };
340  struct test_dbl_llist other_list = { 0, };
341  struct test_val *bogus;
342 
343  switch (cmd) {
344  case TEST_INIT:
345  info->name = "double_ll_tests";
346  info->category = "/main/linkedlists/";
347  info->summary = "double linked list unit test";
348  info->description =
349  "Test the double linked list API";
350  return AST_TEST_NOT_RUN;
351  case TEST_EXECUTE:
352  break;
353  }
354 
355  if (!(buf = ast_str_create(16))) {
356  return AST_TEST_FAIL;
357  }
358 
359  bogus = ast_alloca(sizeof(*bogus));
360 
361  if (AST_DLLIST_REMOVE_VERIFY(&test_list, bogus, dbl_list)) {
362  ast_test_status_update(test, "AST_DLLIST_REMOVE_VERIFY should safely return NULL for missing element from empty list\n");
363  return AST_TEST_FAIL;
364  }
365 
366  /* INSERT_HEAD and REMOVE_HEAD tests */
367  AST_DLLIST_INSERT_HEAD(&test_list, &a, dbl_list);
368  MATCH_OR_FAIL_DBL(&test_list, "A", buf);
369  AST_DLLIST_INSERT_HEAD(&test_list, &b, dbl_list);
370  MATCH_OR_FAIL_DBL(&test_list, "BA", buf);
371  AST_DLLIST_REMOVE_HEAD(&test_list, dbl_list);
372  MATCH_OR_FAIL_DBL(&test_list, "A", buf);
373  AST_DLLIST_REMOVE_HEAD(&test_list, dbl_list);
374  MATCH_OR_FAIL_DBL(&test_list, "", buf);
375  if (AST_DLLIST_REMOVE_HEAD(&test_list, dbl_list)) {
376  ast_test_status_update(test, "Somehow removed an item from the head of a list that didn't exist\n");
377  return AST_TEST_FAIL;
378  }
379  MATCH_OR_FAIL_DBL(&test_list, "", buf);
380 
381  /* Check empty list test */
382 
383  if (!AST_DLLIST_EMPTY(&test_list)) {
384  ast_test_status_update(test, "List should be empty\n");
385  return AST_TEST_FAIL;
386  }
387 
388  /* Insert tail and remove specific item tests. */
389 
390  AST_DLLIST_INSERT_TAIL(&test_list, &a, dbl_list);
391  MATCH_OR_FAIL_DBL(&test_list, "A", buf);
392  AST_DLLIST_INSERT_TAIL(&test_list, &b, dbl_list);
393  MATCH_OR_FAIL_DBL(&test_list, "AB", buf);
394  AST_DLLIST_INSERT_TAIL(&test_list, &c, dbl_list);
395  MATCH_OR_FAIL_DBL(&test_list, "ABC", buf);
396  AST_DLLIST_INSERT_TAIL(&test_list, &d, dbl_list);
397  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
398  if (AST_DLLIST_REMOVE_VERIFY(&test_list, bogus, dbl_list)) {
399  ast_test_status_update(test, "AST_DLLIST_REMOVE_VERIFY should safely return NULL for missing element\n");
400  return AST_TEST_FAIL;
401  }
402  bogus = NULL;
403  if (AST_DLLIST_REMOVE_VERIFY(&test_list, bogus, dbl_list)) {
404  ast_test_status_update(test, "AST_DLLIST_REMOVE_VERIFY should safely return NULL for element set to NULL\n");
405  return AST_TEST_FAIL;
406  }
407  AST_DLLIST_REMOVE(&test_list, &b, dbl_list);
408  MATCH_OR_FAIL_DBL(&test_list, "ACD", buf);
409  AST_DLLIST_REMOVE(&test_list, &d, dbl_list);
410  MATCH_OR_FAIL_DBL(&test_list, "AC", buf);
411  AST_DLLIST_REMOVE(&test_list, &a, dbl_list);
412  MATCH_OR_FAIL_DBL(&test_list, "C", buf);
413  AST_DLLIST_REMOVE(&test_list, &c, dbl_list);
414  MATCH_OR_FAIL_DBL(&test_list, "", buf);
415  if (!AST_DLLIST_EMPTY(&test_list)) {
416  ast_test_status_update(test, "List should be empty\n");
417  return AST_TEST_FAIL;
418  }
419  if (AST_DLLIST_REMOVE_VERIFY(&test_list, bogus, dbl_list)) {
420  ast_test_status_update(test, "AST_DLLIST_REMOVE_VERIFY should safely return NULL asked to remove a NULL pointer from an empty list\n");
421  return AST_TEST_FAIL;
422  }
423 
424  /* Insert item after and before specific item tests */
425 
426  AST_DLLIST_INSERT_HEAD(&test_list, &a, dbl_list);
427  MATCH_OR_FAIL_DBL(&test_list, "A", buf);
428  AST_DLLIST_INSERT_TAIL(&test_list, &c, dbl_list);
429  MATCH_OR_FAIL_DBL(&test_list, "AC", buf);
430  AST_DLLIST_INSERT_AFTER(&test_list, &a, &b, dbl_list);
431  MATCH_OR_FAIL_DBL(&test_list, "ABC", buf);
432  AST_DLLIST_INSERT_AFTER(&test_list, &c, &d, dbl_list);
433  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
434  AST_DLLIST_REMOVE_TAIL(&test_list, dbl_list);
435  MATCH_OR_FAIL_DBL(&test_list, "ABC", buf);
436  AST_DLLIST_REMOVE_TAIL(&test_list, dbl_list);
437  MATCH_OR_FAIL_DBL(&test_list, "AB", buf);
438  AST_DLLIST_INSERT_TAIL(&test_list, &d, dbl_list);
439  MATCH_OR_FAIL_DBL(&test_list, "ABD", buf);
440  AST_DLLIST_INSERT_BEFORE(&test_list, &d, &c, dbl_list);
441  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
442  AST_DLLIST_REMOVE_HEAD(&test_list, dbl_list);
443  MATCH_OR_FAIL_DBL(&test_list, "BCD", buf);
444  AST_DLLIST_INSERT_BEFORE(&test_list, &b, &a, dbl_list);
445  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
446 
447  ELEM_OR_FAIL(AST_DLLIST_FIRST(&test_list), &a);
448  ELEM_OR_FAIL(AST_DLLIST_LAST(&test_list), &d);
451 
452  AST_DLLIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, dbl_list) {
454  }
456 
457  if (!AST_DLLIST_EMPTY(&test_list)) {
458  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
459  return AST_TEST_FAIL;
460  }
461 
462  /* Append list test */
463 
464  AST_DLLIST_INSERT_HEAD(&test_list, &a, dbl_list);
465  MATCH_OR_FAIL_DBL(&test_list, "A", buf);
466  AST_DLLIST_INSERT_TAIL(&test_list, &b, dbl_list);
467  MATCH_OR_FAIL_DBL(&test_list, "AB", buf);
468  AST_DLLIST_INSERT_HEAD(&other_list, &c, dbl_list);
469  MATCH_OR_FAIL_DBL(&other_list, "C", buf);
470  AST_DLLIST_INSERT_TAIL(&other_list, &d, dbl_list);
471  MATCH_OR_FAIL_DBL(&other_list, "CD", buf);
472  AST_DLLIST_APPEND_DLLIST(&test_list, &other_list, dbl_list);
473  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
474  MATCH_OR_FAIL_DBL(&other_list, "", buf);
475  AST_DLLIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, dbl_list) {
477  }
479  if (!AST_DLLIST_EMPTY(&test_list)) {
480  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
481  return AST_TEST_FAIL;
482  }
483 
484  /*
485  * Safe traversal list modification tests
486  * Traverse starting from first element
487  */
488 
489  AST_DLLIST_INSERT_HEAD(&test_list, &a, dbl_list);
490  MATCH_OR_FAIL_DBL(&test_list, "A", buf);
491  AST_DLLIST_INSERT_TAIL(&test_list, &d, dbl_list);
492  MATCH_OR_FAIL_DBL(&test_list, "AD", buf);
493  AST_DLLIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, dbl_list) {
494  if (bogus == &d) {
496  MATCH_OR_FAIL_DBL(&test_list, "ABD", buf);
498  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
500  MATCH_OR_FAIL_DBL(&test_list, "ABC", buf);
501  }
502  }
504  MATCH_OR_FAIL_DBL(&test_list, "ABC", buf);
505  AST_DLLIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, dbl_list) {
507  }
509  if (!AST_DLLIST_EMPTY(&test_list)) {
510  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
511  return AST_TEST_FAIL;
512  }
513 
514  AST_DLLIST_INSERT_HEAD(&test_list, &b, dbl_list);
515  MATCH_OR_FAIL_DBL(&test_list, "B", buf);
516  AST_DLLIST_INSERT_TAIL(&test_list, &d, dbl_list);
517  MATCH_OR_FAIL_DBL(&test_list, "BD", buf);
518  AST_DLLIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, dbl_list) {
519  if (bogus == &b) {
521  MATCH_OR_FAIL_DBL(&test_list, "ABD", buf);
523  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
525  MATCH_OR_FAIL_DBL(&test_list, "ACD", buf);
526  }
527  }
529  MATCH_OR_FAIL_DBL(&test_list, "ACD", buf);
530  AST_DLLIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, dbl_list) {
532  }
534  if (!AST_DLLIST_EMPTY(&test_list)) {
535  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
536  return AST_TEST_FAIL;
537  }
538 
539  AST_DLLIST_INSERT_HEAD(&test_list, &b, dbl_list);
540  MATCH_OR_FAIL_DBL(&test_list, "B", buf);
541  AST_DLLIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, dbl_list) {
542  if (bogus == &b) {
544  MATCH_OR_FAIL_DBL(&test_list, "AB", buf);
546  MATCH_OR_FAIL_DBL(&test_list, "ABD", buf);
548  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
550  MATCH_OR_FAIL_DBL(&test_list, "ACD", buf);
551  }
552  }
554  MATCH_OR_FAIL_DBL(&test_list, "ACD", buf);
555  AST_DLLIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, dbl_list) {
557  }
559  if (!AST_DLLIST_EMPTY(&test_list)) {
560  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
561  return AST_TEST_FAIL;
562  }
563 
564  /*
565  * Safe traversal list modification tests
566  * Traverse starting from last element
567  */
568 
569  AST_DLLIST_INSERT_HEAD(&test_list, &a, dbl_list);
570  MATCH_OR_FAIL_DBL(&test_list, "A", buf);
571  AST_DLLIST_INSERT_TAIL(&test_list, &d, dbl_list);
572  MATCH_OR_FAIL_DBL(&test_list, "AD", buf);
574  if (bogus == &d) {
576  MATCH_OR_FAIL_DBL(&test_list, "ABD", buf);
578  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
580  MATCH_OR_FAIL_DBL(&test_list, "ABC", buf);
581  }
582  }
584  MATCH_OR_FAIL_DBL(&test_list, "ABC", buf);
587  }
589  if (!AST_DLLIST_EMPTY(&test_list)) {
590  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
591  return AST_TEST_FAIL;
592  }
593 
594  AST_DLLIST_INSERT_HEAD(&test_list, &b, dbl_list);
595  MATCH_OR_FAIL_DBL(&test_list, "B", buf);
596  AST_DLLIST_INSERT_TAIL(&test_list, &d, dbl_list);
597  MATCH_OR_FAIL_DBL(&test_list, "BD", buf);
599  if (bogus == &b) {
601  MATCH_OR_FAIL_DBL(&test_list, "ABD", buf);
603  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
605  MATCH_OR_FAIL_DBL(&test_list, "ACD", buf);
606  }
607  }
609  MATCH_OR_FAIL_DBL(&test_list, "ACD", buf);
610  AST_DLLIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, dbl_list) {
612  }
614  if (!AST_DLLIST_EMPTY(&test_list)) {
615  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
616  return AST_TEST_FAIL;
617  }
618 
619  AST_DLLIST_INSERT_HEAD(&test_list, &b, dbl_list);
620  MATCH_OR_FAIL_DBL(&test_list, "B", buf);
622  if (bogus == &b) {
624  MATCH_OR_FAIL_DBL(&test_list, "AB", buf);
626  MATCH_OR_FAIL_DBL(&test_list, "ABD", buf);
628  MATCH_OR_FAIL_DBL(&test_list, "ABCD", buf);
630  MATCH_OR_FAIL_DBL(&test_list, "ACD", buf);
631  }
632  }
634  MATCH_OR_FAIL_DBL(&test_list, "ACD", buf);
635  AST_DLLIST_TRAVERSE_SAFE_BEGIN(&test_list, bogus, dbl_list) {
637  }
639  if (!AST_DLLIST_EMPTY(&test_list)) {
640  ast_test_status_update(test, "List should be empty after traversing and removal. It wasn't.\n");
641  return AST_TEST_FAIL;
642  }
643 
644  return AST_TEST_PASS;
645 }
#define AST_DLLIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
Definition: dlinkedlists.h:848
#define AST_DLLIST_INSERT_BEFORE(head, listelm, elm, field)
Inserts a list entry before a given entry.
#define AST_DLLIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
static struct test_val d
#define AST_DLLIST_REMOVE_VERIFY(head, elm, field)
Removes a specific node from a list if it is in the list.
struct test_val::@513 dbl_list
#define AST_DLLIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
Definition: dlinkedlists.h:887
#define AST_DLLIST_INSERT_AFTER(head, listelm, elm, field)
Inserts a list entry after a given entry.
#define AST_DLLIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
Definition: dlinkedlists.h:752
static struct test_val c
#define NULL
Definition: resample.c:96
#define AST_DLLIST_INSERT_AFTER_CURRENT(elm, field)
Inserts a list node after the current node during a traversal.
Definition: dlinkedlists.h:722
#define AST_DLLIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
#define AST_DLLIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
Definition: dlinkedlists.h:445
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:911
#define ast_test_status_update(a, b, c...)
Definition: test.h:129
#define AST_DLLIST_INSERT_BEFORE_CURRENT(elm, field)
Inserts a list node before the current node during a traversal.
Definition: dlinkedlists.h:695
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
Definition: astmm.h:290
#define AST_DLLIST_APPEND_DLLIST(head, list, field)
Appends a whole list to the tail of a list.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
def info(msg)
#define ast_free(a)
Definition: astmm.h:182
#define AST_DLLIST_EMPTY(head)
Checks whether the specified list contains any entries.
Definition: dlinkedlists.h:468
#define MATCH_OR_FAIL_DBL(list, val, retbuf)
#define AST_DLLIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
Definition: dlinkedlists.h:912
#define ELEM_OR_FAIL(x, y)
#define AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END
Closes a safe loop traversal block.
Definition: dlinkedlists.h:920
#define AST_DLLIST_PREV(elm, field)
Returns the previous entry in the list before the given entry.
Definition: dlinkedlists.h:456
#define AST_DLLIST_REMOVE_TAIL(head, field)
Removes and returns the tail node from a list.
#define AST_DLLIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
static struct test_val b
#define AST_DLLIST_FIRST(head)
Returns the first entry contained in a list.
Definition: dlinkedlists.h:421
#define AST_DLLIST_LAST(head)
Returns the last entry contained in a list.
Definition: dlinkedlists.h:430
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
Definition: strings.h:620
static struct test_val a

◆ dbl_list_expect_forward()

static int dbl_list_expect_forward ( struct test_dbl_llist test_list,
const char *  expect,
struct ast_str **  buf 
)
static

Definition at line 66 of file test_linkedlists.c.

References AST_DLLIST_TRAVERSE, ast_str_append(), ast_str_buffer(), ast_str_reset(), test_val::dbl_list, and test_val::name.

67 {
68  struct test_val *i;
69 
70  ast_str_reset(*buf);
71  AST_DLLIST_TRAVERSE(test_list, i, dbl_list) {
72  ast_str_append(buf, 0, "%s", i->name);
73  }
74 
75  return strcmp(expect, ast_str_buffer(*buf));
76 }
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Definition: strings.h:714
struct test_val::@513 dbl_list
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
Definition: strings.h:1091
#define AST_DLLIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: dlinkedlists.h:575
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
Definition: strings.h:653
const char * name

◆ dbl_list_expect_reverse()

static int dbl_list_expect_reverse ( struct test_dbl_llist test_list,
const char *  expect,
struct ast_str **  buf 
)
static

Definition at line 78 of file test_linkedlists.c.

References AST_DLLIST_TRAVERSE_BACKWARDS, ast_str_append(), ast_str_buffer(), ast_str_reset(), test_val::dbl_list, len(), test_val::name, and str.

79 {
80  struct test_val *i;
81  char *str;
82  int len = strlen(expect);
83  int idx;
84 
85  ast_str_reset(*buf);
87  ast_str_append(buf, 0, "%s", i->name);
88  }
89 
90  /* Check reverse string. */
91  str = ast_str_buffer(*buf);
92  if (len != strlen(str)) {
93  return 1;
94  }
95  for (idx = 0; idx < len; ++idx) {
96  if (expect[idx] != str[len - idx - 1]) {
97  return 1;
98  }
99  }
100  return 0;
101 }
#define AST_DLLIST_TRAVERSE_BACKWARDS(head, var, field)
Loops over (traverses) the entries in a list in reverse order, starting at the end.
Definition: dlinkedlists.h:617
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Definition: strings.h:714
struct test_val::@513 dbl_list
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
Definition: strings.h:1091
const char * str
Definition: app_jack.c:147
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
Definition: strings.h:653
const char * name

◆ list_expect()

static int list_expect ( struct test_llist test_list,
const char *  expect,
struct ast_str **  buf 
)
static

Definition at line 54 of file test_linkedlists.c.

References AST_LIST_TRAVERSE, ast_str_append(), ast_str_buffer(), ast_str_reset(), test_val::list, and test_val::name.

55 {
56  struct test_val *i;
57 
58  ast_str_reset(*buf);
59  AST_LIST_TRAVERSE(test_list, i, list) {
60  ast_str_append(buf, 0, "%s", i->name);
61  }
62 
63  return strcmp(expect, ast_str_buffer(*buf));
64 }
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Definition: strings.h:714
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
Definition: strings.h:1091
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
Definition: strings.h:653
const char * name
struct test_val::@512 list

◆ load_module()

static int load_module ( void  )
static

Definition at line 654 of file test_linkedlists.c.

References AST_MODULE_LOAD_SUCCESS, and AST_TEST_REGISTER.

655 {
656  AST_TEST_REGISTER(single_ll_tests);
657  AST_TEST_REGISTER(double_ll_tests);
659 }
#define AST_TEST_REGISTER(cb)
Definition: test.h:127

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 647 of file test_linkedlists.c.

References AST_TEST_UNREGISTER.

648 {
649  AST_TEST_UNREGISTER(single_ll_tests);
650  AST_TEST_UNREGISTER(double_ll_tests);
651  return 0;
652 }
#define AST_TEST_UNREGISTER(cb)
Definition: test.h:128

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Test Linked Lists" , .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, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, }
static

Definition at line 661 of file test_linkedlists.c.

◆ a

struct test_val a = { "A" }
static

Definition at line 46 of file test_linkedlists.c.

Referenced by __ast_format_def_register(), __ast_register_translator(), __bt_split(), _stun_show_status(), add_sdp(), anaFilter(), analog_swap_subs(), ao2_container_unregister(), ao2_iterator_init(), ao2_weakproxy_unsubscribe(), ast_atomic_dec_and_test(), ast_channel_internal_oldest_linkedid(), ast_pthread_create_stack(), ast_sockaddr_cmp(), ast_sockaddr_cmp_addr(), ast_sockaddr_copy(), ast_tvadd(), ast_tvsub(), bridge_show_specific_print_channel(), check_switch_expr(), cli_complete_subscription_callid(), cli_list_subscriptions_inout(), cli_show_subscription_inout(), cli_show_subscriptions_inout(), compare_categories(), compare_char(), config_parse_variables(), contact_transport_monitor_matcher(), convshort(), dahdi_cc_callback(), delete_devices(), display_results(), dll_tests(), do_alignment_detection(), do_cli_dump_endpt(), fsk_serial(), function_realtime_store(), get_also_info(), get_button_template(), get_dahdi_codec(), get_domain(), handle_cli_iax2_test_losspct(), handle_cli_malloc_trim(), handle_show_hint(), hashtab_compare_strings(), interpolate_product_single(), interval_hook_time_cmp(), keypad_cfg_read(), load_pktccops_config(), lsf2a(), lua_extension_cmp(), main(), manager_displayconnects(), manager_sip_show_peers(), manager_skinny_show_device(), manager_skinny_show_devices(), manager_skinny_show_line(), manager_skinny_show_lines(), MD5Transform(), media_cache_prnt_summary(), monitor_matcher(), my_wink(), P1(), P2(), P4(), pow_ii(), print_applicationmap(), print_featuregroup(), print_featuregroups(), process_sdp(), r_sign(), realtime_exec(), rescomp(), say_date_generic(), say_enumeration_full(), say_full(), say_number_full(), sched_time_cmp(), search_directory_sub(), send_dtmf(), show_sound_info_cb(), show_sounds_cb(), show_users_cb(), sip_show_peers(), skinny_reload(), sorcery_memory_cache_dump(), stir_shaken_cli_show(), swap_subs(), threadstorage_init(), tls_method_to_str(), and tvfix().

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 661 of file test_linkedlists.c.

◆ b

struct test_val b = { "B" }
static

◆ c

struct test_val c = { "C" }
static
Examples:
/usr/src/asterisk-18.5.0/main/app.c.

Definition at line 48 of file test_linkedlists.c.

Referenced by __analog_handle_event(), __ast_cli_register_multiple(), __bt_curdel(), __bt_delete(), __bt_seqadv(), __has_voicemail(), _ast_hashtab_insert_immediate_bucket(), _ast_hashtab_resize(), _macro_exec(), action_getvar(), action_hangup(), action_sendtext(), action_setvar(), action_timeout(), add_sdp(), agi_handle_command(), analog_call(), analog_my_getsigstr(), analog_new_ast_channel(), ao2_iterator_init(), append_history_va(), ast_add_extension(), ast_add_extension2_lockopt(), ast_add_extension_nolock(), ast_compile_ael2(), ast_context_add_ignorepat(), ast_context_add_include(), ast_context_add_include2(), ast_context_add_switch(), ast_context_ignorepats_count(), ast_context_includes_count(), ast_context_lockmacro(), ast_context_remove_extension_callerid(), ast_context_remove_ignorepat(), ast_context_remove_include(), ast_context_remove_switch(), ast_context_switches_count(), ast_context_unlockmacro(), ast_el_read_char(), ast_escape(), ast_escape_c(), ast_get_group(), ast_get_namedgroups(), ast_hashtab_hash_string_sax(), ast_parse_digest(), ast_recvchar(), ast_smdi_interface_find(), AST_TEST_DEFINE(), ast_unescape_c(), ast_writefile(), ast_xmldoc_printable(), base_encode(), bt_psplit(), build_channels(), c_prevword(), change_monitor_action(), check_auth(), check_day(), check_dow(), check_month(), check_switch_expr(), check_via(), chunked_atoh(), cli_complete_notify(), common_exec(), compile_script(), complete_dialplan_add_extension(), complete_dialplan_add_ignorepat(), complete_dialplan_add_include(), complete_dialplan_remove_context(), complete_dialplan_remove_extension(), complete_dialplan_remove_ignorepat(), complete_dialplan_remove_include(), complete_mohclass_realtime(), complete_show_dialplan_context(), complete_sip_notify(), complete_sipch(), conf_run(), console_print(), conv66(), dahdi_call(), dahdi_chan_conf_default(), dahdi_handle_event(), dahdi_read(), destroy_cts(), dll_tests(), do_forward(), do_pause_or_unpause(), dtmf_info_incoming_request(), ebl_callback(), enum_callback(), ext_cmp1(), ext_cmp_pattern_pos(), extract_uri(), fileexists_test(), find_context_locked(), find_matching_endif(), find_matching_endwhile(), find_ringing_channel(), find_subchannel_and_lock(), func_channels_read(), generate_filenames_string(), generic_fax_exec(), get_also_info(), get_comma(), get_csv(), get_event(), getnum(), getqzname(), getzname(), handle_call_outgoing(), handle_callforward_button(), handle_clear_alarms(), handle_cli_dialplan_remove_extension(), handle_cli_dialplan_save(), handle_cli_locks_show(), handle_core_set_debug_channel(), handle_enbloc_call_message(), handle_hangup(), handle_hd_hf(), handle_invite_replaces(), handle_mgcp_audit_endpoint(), handle_offhook_message(), handle_request_bye(), handle_request_info(), handle_request_invite(), handle_request_notify(), handle_response(), handle_soft_key_event_message(), handle_softhangup(), handle_stimulus_message(), handle_transfer_button(), handle_updates(), handle_uri(), headers_to_vars(), htonll(), httpd_process_request(), iax2_request(), iax_prov_complete_template(), ices_exec(), include_alloc(), input(), ivr_dispatch(), jb_debug_output(), keypad_cfg_read(), load_dlopen(), load_dlopen_missing(), load_pktccops_config(), lua_find_extension(), main(), manager_mixmonitor(), manager_mute_mixmonitor(), manager_mutestream(), manager_show_dialplan_helper(), manager_stop_mixmonitor(), MD5Transform(), moh_rescan_files(), my_getsigstr(), ntohll(), onAlerting(), onCallEstablished(), onProgress(), ooh323_onReceivedSetup(), ooh323c_call_thread(), ooh323c_start_call_thread(), op_cond(), oss_new(), oss_request(), P3(), P4(), parse(), parse_line(), parse_ok_contact(), parse_request(), parse_uri_full(), parse_via(), parseintarg(), pbcwhere(), pbx_builtin_setvar(), pbx_extension_helper(), pbx_load_users(), pbx_thread(), phone_answer(), populate_addr(), process_dahdi(), process_sdp(), process_text_line(), read_some(), register_verify(), reply_digest(), reqprep(), request_channel(), rfcomm_append_buf(), rfcomm_read(), rfcomm_read_and_append_char(), rfcomm_read_and_expect_char(), rfcomm_read_command(), rfcomm_read_result(), rfcomm_read_until_crlf(), rfcomm_read_until_ok(), rfcomm_wait(), rotate_file(), run_agi(), safe_mkdir(), send_waveform_to_fd(), sendfax_exec(), set_message_vars_from_req(), setsubstate(), setup_dahdi_int(), shift_pop(), show_chanstats_cb(), show_debug_helper(), show_dialplan_helper(), sip_digest_parser(), sip_report_security_event(), skinny_dialer(), skinny_newcall(), smdi_read(), sms_handleincoming_proto2(), sms_messagetx(), socket_receive_file_to_buff(), softhangup_exec(), spawn_ras(), speex_get_wb_sz_at(), speex_samples(), split_ec(), srv_callback(), start_monitor_action(), stop_monitor_action(), store_tone_zone_ring_cadence(), t30_phase_e_handler(), table_config_for_table_name(), table_configs_free(), tdd_feed(), tdd_generate(), transmit_fake_auth_response(), transmit_refer(), transmit_state_notify(), try_load_key(), txt_callback(), unistim_sp(), update_connectedline(), wait_for_answer(), while(), write_history(), xmldoc_setpostbr(), and xmpp_client_receive().

◆ d

struct test_val d = { "D" }
static
Examples:
/usr/src/asterisk-18.5.0/main/app.c.

Definition at line 49 of file test_linkedlists.c.

Referenced by __ast_play_and_record(), _skinny_message_clear(), _skinny_message_set(), _skinny_show_device(), _skinny_show_devices(), _skinny_show_line(), add_sip_domain(), ast_play_and_wait(), ast_readstring_full(), auth_http_callback(), block4(), build_device(), calc_rxstamp(), change_favorite_icon(), check_sip_domain(), clear_sip_domains(), complete_skinny_devices(), complete_skinny_show_line(), config_device(), config_parse_variables(), console_dial(), datastore_destroy_cb(), delete_devices(), destroy_session_details(), dialandactivatesub(), dll_tests(), dumpsub(), find_line_by_name(), find_subchannel_by_name(), find_subline_by_name(), finish_bookmark(), g726_encode(), get_button_template(), get_folder(), get_folder_ja(), get_unaligned_uint16(), get_unaligned_uint32(), get_unaligned_uint64(), h264_encap(), handle_button_template_req_message(), handle_call_outgoing(), handle_callforward_button(), handle_capabilities_res_message(), handle_enbloc_call_message(), handle_keypad_button_message(), handle_message(), handle_mwi_state(), handle_offhook_message(), handle_onhook_message(), handle_open_receive_channel_ack_message(), handle_skinny_reset(), handle_soft_key_event_message(), handle_stimulus_message(), handle_transfer_button(), hash_test_count(), hash_test_grow(), hash_test_lookup(), hash_test_shrink(), initreqprep(), key_select_extension(), keypad_cfg_read(), lintog726_framein(), lintog726aal2_framein(), load_pktccops_config(), main(), manager_ph_control(), manager_ph_control_block(), MD5Transform(), mwi_event_cb(), parse_naptr(), push_callinfo(), put_unaligned_uint16(), put_unaligned_uint32(), put_unaligned_uint64(), rcv_mac_addr(), reload_config(), rxqcheck(), saturate(), say_and_wait(), send_callinfo(), session_details_new(), setsubstate(), sip_show_domains(), sip_show_settings(), skinny_call(), skinny_device_alloc(), skinny_dialer(), skinny_extensionstate_cb(), skinny_indicate(), skinny_new(), skinny_newcall(), skinny_register(), skinny_reload(), skinny_senddigit_end(), skinny_session_cleanup(), skinny_set_rtp_peer(), sms_exec(), sms_nextoutgoing(), sms_readfile(), start_monitor_action(), start_rtp(), tdd_decode_baudot(), transfer_call_step1(), transfer_cancel_step2(), transmit_keepaliveack(), transtime(), txqcheck(), unistim_answer(), unistim_hangup(), unistim_register(), unistim_request(), unload_module(), and update_connectedline().