bridges/bridge_t38: Add a bridging module for managing T.38 state
[asterisk/asterisk.git] / tests / test_abstract_jb.c
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2012, Matt Jordan
5  *
6  * Matt Jordan <mjordan@digium.com>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18
19 /*!
20  * \file
21  * \brief Abstract Jitterbuffer Tests
22  *
23  * \author \verbatim Matt Jordan <mjordan@digium.com> \endverbatim
24  *
25  * Tests the abstract jitter buffer API.  This tests both adaptive and fixed
26  * jitter buffers.  Functions defined in abstract_jb that are not part of the
27  * abstract jitter buffer API are not tested by this unit test.
28  *
29  * \ingroup tests
30  */
31
32 /*** MODULEINFO
33         <depend>TEST_FRAMEWORK</depend>
34         <support_level>core</support_level>
35  ***/
36
37 #include "asterisk.h"
38
39 ASTERISK_REGISTER_FILE()
40
41 #include "asterisk/utils.h"
42 #include "asterisk/module.h"
43 #include "asterisk/test.h"
44 #include "asterisk/abstract_jb.h"
45 #include "asterisk/frame.h"
46 #include "asterisk/format_cache.h"
47
48 #define DEFAULT_FRAME_MS 160
49 #define DEFAULT_CONFIG_FLAGS 0
50 #define DEFAULT_CONFIG_SIZE (DEFAULT_FRAME_MS) * 10
51 #define DEFAULT_CONFIG_RESYNC_THRESHOLD (DEFAULT_FRAME_MS) * 2
52 #define DEFAULT_CONFIG_TARGET_EXTRA -1
53
54 /*!
55  * \internal
56  * \brief Destructor for a jitter buffer
57  *
58  * \param jb The jitter buffer to destroy
59  *
60  * \note This will destroy all frames still in the jitter buffer
61  */
62 static void dispose_jitterbuffer(struct ast_jb *jb)
63 {
64         if (!jb || !jb->impl || !jb->jbobj) {
65                 return;
66         }
67
68         jb->impl->empty_and_reset(jb->jbobj);
69
70         jb->impl->destroy(jb->jbobj);
71         jb->impl = NULL;
72         jb->jbobj = NULL;
73 }
74
75 /*!
76  * \internal
77  * \brief Create a test frame
78  *
79  * \param timestamp the time in ms of the frame
80  * \param seqno the frame's sequence number
81  *
82  * \returns a malloc'd frame
83  */
84 static struct ast_frame *create_test_frame(long timestamp,
85                 int seqno)
86 {
87         struct ast_frame f = {0};
88
89         f.subclass.format = ast_format_slin;
90         f.frametype = AST_FRAME_VOICE;
91         f.src = "TEST";
92         f.ts = timestamp;
93         f.len = DEFAULT_FRAME_MS;
94         f.seqno = seqno;
95
96         return ast_frisolate(&f);
97 }
98
99 /*! \internal
100  * \brief Test two numeric (long int) values.
101 */
102 #define LONG_INT_TEST(actual, expected) do { \
103         if ((actual) != (expected)) { \
104                 ast_test_status_update(test, #actual ": expected [%ld]; actual [%ld]\n", (long int)(expected), (long int)(actual)); \
105                 return AST_TEST_FAIL; \
106         } } while (0)
107
108 /*! \internal
109  * \brief Test two numeric (int) values.
110 */
111 #define INT_TEST(actual, expected) do { \
112         if ((actual) != (expected)) { \
113                 ast_test_status_update(test, #actual ": expected [%d]; actual [%d]\n", (expected), (actual)); \
114                 return AST_TEST_FAIL; \
115         } } while (0)
116
117 /*! \internal
118  * \brief Test two numeric (unsigned int) values.
119 */
120 #define UINT_TEST(actual, expected) do { \
121         if ((actual) != (expected)) { \
122                 ast_test_status_update(test, #actual ": expected [%u]; actual [%u]\n", (expected), (actual)); \
123                 return AST_TEST_FAIL; \
124         } } while (0)
125
126 /*! \internal
127  * \brief Test two string values
128 */
129 #define STRING_TEST(actual, expected) do { \
130         if (strcmp((actual), (expected))) { \
131                 ast_test_status_update(test, #actual ": expected [%s]; actual [%s]\n", (expected), (actual)); \
132                 return AST_TEST_FAIL; \
133         } } while (0)
134
135 /*! \internal
136  * \brief Verify that two frames have the same properties
137  */
138 #define VERIFY_FRAME(actual, expected) do { \
139         UINT_TEST((actual)->frametype, (expected)->frametype); \
140         INT_TEST((actual)->seqno, (expected)->seqno); \
141         LONG_INT_TEST((actual)->ts, (expected)->ts); \
142         LONG_INT_TEST((actual)->len, (expected)->len); \
143         STRING_TEST((actual)->src, (expected)->src); \
144 } while (0)
145
146 /*! \internal
147  * \brief Get the implementation for a jitter buffer
148  */
149 #define OBTAIN_JITTERBUFFER_IMPL(impl, ast_jb_type, literal_name) do { \
150         (impl) = ast_jb_get_impl((ast_jb_type)); \
151         if (!(impl)) { \
152                 ast_test_status_update(test, "Error: no %s jitterbuffer defined\n", (literal_name)); \
153                 return AST_TEST_FAIL; \
154         } \
155         if (strcmp((impl)->name, (literal_name))) { \
156                 ast_test_status_update(test, "Error: requested %s jitterbuffer and received %s\n", (literal_name), (impl)->name); \
157                 return AST_TEST_FAIL; \
158         } } while (0)
159
160 /*! \internal
161  * \brief Make a jitter buffer configuration object with default values
162  */
163 #define MAKE_DEFAULT_CONFIG(conf, impl) do { \
164         (conf)->flags = DEFAULT_CONFIG_FLAGS; \
165         strcpy((conf)->impl, (impl)->name); \
166         (conf)->max_size = DEFAULT_CONFIG_SIZE; \
167         (conf)->resync_threshold = DEFAULT_CONFIG_RESYNC_THRESHOLD; \
168         (conf)->target_extra = DEFAULT_CONFIG_TARGET_EXTRA; \
169         } while (0)
170
171 /*!
172  * \internal
173  * \brief A container object for the jitter buffers, used for all tests
174  */
175 static struct ast_jb default_jb = {
176         .impl = NULL,
177         .jbobj = NULL
178 };
179
180 /*!
181  * \internal
182  * \brief Construct a test name
183  */
184 #define TEST_NAME(type_name, specifier) type_name ## _  ## specifier
185
186 #define TEST_NAME2(test_name) #test_name
187 #define STRINGIFY_TESTNAME(test_name) TEST_NAME2(test_name)
188
189 /*!
190  * \internal
191  * \brief Test nominal construction of a jitter buffer
192  *
193  * \param type_name The enum type of the jitter buffer to create
194  * \param literal_type_name The literal name of the type - "fixed" or "adaptive"
195  */
196 #define test_create_nominal(type_name, literal_type_name) AST_TEST_DEFINE(TEST_NAME(type_name, create)) {\
197         RAII_VAR(struct ast_jb *, jb, &default_jb, dispose_jitterbuffer); \
198         const struct ast_jb_impl *impl; \
199         struct ast_jb_conf conf; \
200 \
201         switch (cmd) { \
202         case TEST_INIT: \
203                 info->name = STRINGIFY_TESTNAME(TEST_NAME(type_name, create)); \
204                 info->category = "/main/abstract_jb/"; \
205                 info->summary = "Test nominal creation of a " literal_type_name " jitterbuffer"; \
206                 info->description = \
207                         "Tests nominal creation of a " literal_type_name " jitterbuffer using the " \
208                         " jitterbuffer API."; \
209                 return AST_TEST_NOT_RUN; \
210         case TEST_EXECUTE: \
211                 break; \
212         } \
213  \
214         ast_test_status_update(test, "Executing " STRINGIFY_TESTNAME(TEST_NAME(type_name,  create))"...\n"); \
215         OBTAIN_JITTERBUFFER_IMPL(impl, (type_name), (literal_type_name)); \
216         MAKE_DEFAULT_CONFIG(&conf, impl); \
217  \
218         jb->jbobj = impl->create(&conf); \
219         jb->impl = impl; \
220         if (!jb->jbobj) { \
221                 ast_test_status_update(test, "Error: Failed to adaptive jitterbuffer\n"); \
222                 return AST_TEST_FAIL; \
223         } \
224  \
225         return AST_TEST_PASS; \
226 }
227
228 /*!
229  * \internal
230  * \brief Test putting the initial frame into a jitter buffer
231  *
232  * \param type_name The enum type of the jitter buffer to create
233  * \param literal_type_name The literal name of the type - "fixed" or "adaptive"
234  */
235 #define test_put_first(type_name, literal_type_name) AST_TEST_DEFINE(TEST_NAME(type_name,  put_first)) {\
236         RAII_VAR(struct ast_jb *, jb, &default_jb, dispose_jitterbuffer); \
237         const struct ast_jb_impl *impl; \
238         struct ast_jb_conf conf; \
239         RAII_VAR(struct ast_frame *, expected_frame, NULL, ast_frame_dtor); \
240         RAII_VAR(struct ast_frame *, actual_frame, NULL, ast_frame_dtor); \
241         int res; \
242 \
243         switch (cmd) { \
244         case TEST_INIT: \
245                 info->name = STRINGIFY_TESTNAME(TEST_NAME(type_name,  put_first)); \
246                 info->category = "/main/abstract_jb/"; \
247                 info->summary = "Test putting a frame into a " literal_type_name " jitterbuffer"; \
248                 info->description = \
249                         "This tests putting a single frame into a " literal_type_name " jitterbuffer " \
250                         "when the jitterbuffer is empty and verifying that it is indeed " \
251                         "the first frame on the jitterbufffer"; \
252                 return AST_TEST_NOT_RUN; \
253         case TEST_EXECUTE: \
254                 break; \
255         } \
256 \
257         ast_test_status_update(test, "Executing " STRINGIFY_TESTNAME(TEST_NAME(type_name,  create))"...\n"); \
258         OBTAIN_JITTERBUFFER_IMPL(impl, (type_name), (literal_type_name)); \
259         MAKE_DEFAULT_CONFIG(&conf, impl); \
260         jb->jbobj = impl->create(&conf); \
261         jb->impl = impl; \
262         if (!jb->jbobj) { \
263                 ast_test_status_update(test, "Error: Failed to adaptive jitterbuffer\n"); \
264                 return AST_TEST_FAIL; \
265         } \
266 \
267         expected_frame = create_test_frame(1000, 0); \
268         res = jb->impl->put_first(jb->jbobj, \
269                 expected_frame, \
270                 1100); \
271         if (res != AST_JB_IMPL_OK) { \
272                 ast_test_status_update(test, "Error: Got %d back from put_first (expected %d)\n", \
273                         res, AST_JB_IMPL_OK); \
274                 return AST_TEST_FAIL; \
275         } \
276 \
277         res = jb->impl->remove(jb->jbobj, &actual_frame); \
278         if (!actual_frame || res != AST_JB_IMPL_OK) { \
279                 ast_test_status_update(test, "Error: failed to retrieve first frame\n"); \
280                 return AST_TEST_FAIL; \
281         } \
282         expected_frame = create_test_frame(1000, 0); \
283         VERIFY_FRAME(actual_frame, expected_frame); \
284         return AST_TEST_PASS; \
285 }
286
287 /*!
288  * \internal
289  * \brief Test putting a voice frames into a jitter buffer
290  *
291  * \param type_name The enum type of the jitter buffer to create
292  * \param literal_type_name The literal name of the type - "fixed" or "adaptive"
293  */
294 #define test_put(type_name, literal_type_name) AST_TEST_DEFINE(TEST_NAME(type_name, put)) {\
295         RAII_VAR(struct ast_jb *, jb, &default_jb, dispose_jitterbuffer); \
296         const struct ast_jb_impl *impl; \
297         struct ast_jb_conf conf; \
298         RAII_VAR(struct ast_frame *, expected_frame, NULL, ast_frame_dtor); \
299         RAII_VAR(struct ast_frame *, actual_frame, NULL, ast_frame_dtor); \
300         int res; \
301         long next; \
302         int i; \
303 \
304         switch (cmd) { \
305         case TEST_INIT: \
306                 info->name = STRINGIFY_TESTNAME(TEST_NAME(type_name, put)); \
307                 info->category = "/main/abstract_jb/"; \
308                 info->summary = "Test putting frames onto a " literal_type_name " jitterbuffer"; \
309                 info->description = \
310                         "This tests putting multiple frames into a " literal_type_name " jitterbuffer"; \
311                 return AST_TEST_NOT_RUN; \
312         case TEST_EXECUTE: \
313                 break; \
314         } \
315 \
316         ast_test_status_update(test, "Executing "STRINGIFY_TESTNAME(TEST_NAME(type_name, put))"...\n"); \
317         OBTAIN_JITTERBUFFER_IMPL(impl, (type_name), (literal_type_name)); \
318         MAKE_DEFAULT_CONFIG(&conf, impl); \
319         jb->jbobj = impl->create(&conf); \
320         jb->impl = impl; \
321 \
322         expected_frame = create_test_frame(1000, 0); \
323         jb->impl->put_first(jb->jbobj, expected_frame, 1100); \
324         for (i = 1; i < 10; i++) { \
325                 expected_frame = create_test_frame(1000 + i * DEFAULT_FRAME_MS, 0); \
326                 res = jb->impl->put(jb->jbobj, \
327                         expected_frame, \
328                         1100 + i * DEFAULT_FRAME_MS); \
329                 if (res != AST_JB_IMPL_OK) { \
330                         ast_test_status_update(test, "Error: On frame %d, got %d back from put (expected %d)\n", \
331                                 i, res, AST_JB_IMPL_OK); \
332                         return AST_TEST_FAIL; \
333                 } \
334         } \
335 \
336         for (i = 0; i < 10; i++) { \
337                 expected_frame = create_test_frame(1000 + i * DEFAULT_FRAME_MS, 0); \
338                 next = jb->impl->next(jb->jbobj); \
339                 res = jb->impl->get(jb->jbobj, &actual_frame, next, DEFAULT_FRAME_MS); \
340                 if (res != AST_JB_IMPL_OK) { \
341                         ast_test_status_update(test, "Error: failed to retrieve frame %i at time %ld\n", \
342                                 i, next); \
343                         return AST_TEST_FAIL; \
344                 } \
345                 VERIFY_FRAME(actual_frame, expected_frame); \
346                 ast_frfree(expected_frame); \
347                 expected_frame = NULL; \
348         } \
349         return AST_TEST_PASS; \
350 }
351
352 /*!
353  * \internal
354  * \brief Test overflowing the limits of a jitter buffer
355  *
356  * \param type_name The enum type of the jitter buffer to create
357  * \param literal_type_name The literal name of the type - "fixed" or "adaptive"
358  * \param overflow_limit The number of frames at which we expect the buffer to overflow
359  */
360 #define test_put_overflow(type_name, literal_type_name, overflow_limit) AST_TEST_DEFINE(TEST_NAME(type_name, put_overflow)) {\
361         RAII_VAR(struct ast_jb *, jb, &default_jb, dispose_jitterbuffer); \
362         const struct ast_jb_impl *impl; \
363         struct ast_jb_conf conf; \
364         RAII_VAR(struct ast_frame *, expected_frame, NULL, ast_frame_dtor); \
365         int res; \
366         int i; \
367 \
368         switch (cmd) { \
369         case TEST_INIT: \
370                 info->name = STRINGIFY_TESTNAME(TEST_NAME(type_name,  put_overflow)); \
371                 info->category = "/main/abstract_jb/"; \
372                 info->summary = "Test putting frames onto a " literal_type_name " jitterbuffer " \
373                         "that ends up overflowing the maximum allowed slots in the buffer"; \
374                 info->description = \
375                         "This tests putting multiple frames into a " literal_type_name " jitterbuffer " \
376                         "until the jitterbuffer overflows"; \
377                 return AST_TEST_NOT_RUN; \
378         case TEST_EXECUTE: \
379                 break; \
380         } \
381 \
382         ast_test_status_update(test, "Executing "STRINGIFY_TESTNAME(TEST_NAME(type_name, put_overflow))"...\n"); \
383         OBTAIN_JITTERBUFFER_IMPL(impl, (type_name), (literal_type_name)); \
384         MAKE_DEFAULT_CONFIG(&conf, impl); \
385         jb->jbobj = impl->create(&conf); \
386         jb->impl = impl; \
387 \
388         expected_frame = create_test_frame(1000, 0); \
389         jb->impl->put_first(jb->jbobj, expected_frame, 1100); \
390         for (i = 1; i <= (overflow_limit); i++) { \
391                 expected_frame = create_test_frame(1000 + i * DEFAULT_FRAME_MS, 0); \
392                 res = jb->impl->put(jb->jbobj, \
393                         expected_frame, \
394                         1100 + i * DEFAULT_FRAME_MS); \
395                 if (res != AST_JB_IMPL_OK) { \
396                         ast_test_status_update(test, "Error: On frame %d, got %d back from put (expected %d)\n", \
397                                 i, res, AST_JB_IMPL_OK); \
398                         return AST_TEST_FAIL; \
399                 } \
400         } \
401 \
402         for (i = (overflow_limit)+1; i < (overflow_limit) + 5; i++) { \
403                 expected_frame = create_test_frame(1000 + i * DEFAULT_FRAME_MS, 0); \
404                 res = jb->impl->put(jb->jbobj, \
405                         expected_frame, \
406                         1100 + i * DEFAULT_FRAME_MS); \
407                 if (res != AST_JB_IMPL_DROP) { \
408                         expected_frame = NULL; \
409                         ast_test_status_update(test, "Error: On frame %d, got %d back from put (expected %d)\n", \
410                                 i, res, AST_JB_IMPL_DROP); \
411                         return AST_TEST_FAIL; \
412                 } \
413                 ast_frfree(expected_frame); \
414                 expected_frame = NULL;\
415         } \
416 \
417         return AST_TEST_PASS; \
418 }
419
420 /*!
421  * \internal
422  * \brief Test putting voice frames into a jitter buffer out of order
423  *
424  * \param type_name The enum type of the jitter buffer to create
425  * \param literal_type_name The literal name of the type - "fixed" or "adaptive"
426  * \param synch_limit The synchronization limit for this particular type of jitter buffer
427  */
428 #define test_put_out_of_order(type_name, literal_type_name, synch_limit) AST_TEST_DEFINE(TEST_NAME(type_name, put_out_of_order)) {\
429         RAII_VAR(struct ast_jb *, jb, &default_jb, dispose_jitterbuffer); \
430         const struct ast_jb_impl *impl; \
431         struct ast_jb_conf conf; \
432         RAII_VAR(struct ast_frame *, actual_frame, NULL, ast_frame_dtor); \
433         RAII_VAR(struct ast_frame *, expected_frame, NULL, ast_frame_dtor); \
434         int res; \
435         long next; \
436         int i; \
437 \
438         switch (cmd) { \
439         case TEST_INIT: \
440                 info->name = STRINGIFY_TESTNAME(TEST_NAME(type_name, put_out_of_order)); \
441                 info->category = "/main/abstract_jb/"; \
442                 info->summary = "Test putting out of order frames onto a " literal_type_name " jitterbuffer"; \
443                 info->description = \
444                         "This tests putting multiple frames into a " literal_type_name " jitterbuffer " \
445                         "that arrive out of order.  Every 3rd frame is put in out of order."; \
446                 return AST_TEST_NOT_RUN; \
447         case TEST_EXECUTE: \
448                 break; \
449         } \
450 \
451         ast_test_status_update(test, "Executing " STRINGIFY_TESTNAME(TEST_NAME(type_name, put_out_of_order)) "...\n"); \
452         OBTAIN_JITTERBUFFER_IMPL(impl, (type_name), (literal_type_name)); \
453         MAKE_DEFAULT_CONFIG(&conf, impl); \
454         conf.resync_threshold = (synch_limit); \
455         jb->jbobj = impl->create(&conf); \
456         jb->impl = impl; \
457 \
458         expected_frame = create_test_frame(1000, 0); \
459         jb->impl->put_first(jb->jbobj, expected_frame, 1100); \
460         for (i = 1; i <= 10; i++) { \
461                 if (i % 3 == 1 && i != 10) { \
462                         expected_frame = create_test_frame(1000 + ((i + 1) * DEFAULT_FRAME_MS), 0); \
463                 } else if (i % 3 == 2) { \
464                         expected_frame = create_test_frame(1000 + ((i - 1) * DEFAULT_FRAME_MS), 0); \
465                 } else { \
466                         expected_frame = create_test_frame(1000 + i * DEFAULT_FRAME_MS, 0); \
467                 } \
468                 res = jb->impl->put(jb->jbobj, \
469                         expected_frame, \
470                         1100 + i * DEFAULT_FRAME_MS); \
471                 if (res != AST_JB_IMPL_OK) { \
472                         ast_test_status_update(test, "Error: On frame %d, got %d back from put (expected %d)\n", \
473                                 i, res, AST_JB_IMPL_OK); \
474                         return AST_TEST_FAIL; \
475                 } \
476         } \
477 \
478         for (i = 0; i <= 10; i++) { \
479                 expected_frame = create_test_frame(1000 + i * DEFAULT_FRAME_MS, 0); \
480                 next = jb->impl->next(jb->jbobj); \
481                 res = jb->impl->get(jb->jbobj, &actual_frame, next, DEFAULT_FRAME_MS); \
482                 if (res != AST_JB_IMPL_OK) { \
483                         ast_test_status_update(test, "Error: failed to retrieve frame at %ld\n", \
484                                 next); \
485                         return AST_TEST_FAIL; \
486                 } \
487                 VERIFY_FRAME(actual_frame, expected_frame); \
488                 ast_frfree(expected_frame); \
489                 expected_frame = NULL; \
490         } \
491 \
492         return AST_TEST_PASS; \
493 }
494
495
496 test_create_nominal(AST_JB_ADAPTIVE, "adaptive")
497
498 test_put_first(AST_JB_ADAPTIVE, "adaptive")
499
500 test_put(AST_JB_ADAPTIVE, "adaptive")
501
502 test_put_overflow(AST_JB_ADAPTIVE, "adaptive", 10)
503
504 test_put_out_of_order(AST_JB_ADAPTIVE, "adaptive", DEFAULT_FRAME_MS * 2)
505
506 test_create_nominal(AST_JB_FIXED, "fixed")
507
508 test_put_first(AST_JB_FIXED, "fixed")
509
510 test_put(AST_JB_FIXED, "fixed")
511
512 test_put_overflow(AST_JB_FIXED, "fixed", 12)
513
514 test_put_out_of_order(AST_JB_FIXED, "fixed", DEFAULT_CONFIG_RESYNC_THRESHOLD)
515
516 static int unload_module(void)
517 {
518         AST_TEST_UNREGISTER(TEST_NAME(AST_JB_ADAPTIVE, create));
519         AST_TEST_UNREGISTER(TEST_NAME(AST_JB_ADAPTIVE, put_first));
520         AST_TEST_UNREGISTER(TEST_NAME(AST_JB_ADAPTIVE, put));
521         AST_TEST_UNREGISTER(TEST_NAME(AST_JB_ADAPTIVE, put_overflow));
522         AST_TEST_UNREGISTER(TEST_NAME(AST_JB_ADAPTIVE, put_out_of_order));
523
524         AST_TEST_UNREGISTER(TEST_NAME(AST_JB_FIXED, create));
525         AST_TEST_UNREGISTER(TEST_NAME(AST_JB_FIXED, put_first));
526         AST_TEST_UNREGISTER(TEST_NAME(AST_JB_FIXED, put));
527         AST_TEST_UNREGISTER(TEST_NAME(AST_JB_FIXED, put_overflow));
528         AST_TEST_UNREGISTER(TEST_NAME(AST_JB_FIXED, put_out_of_order));
529
530         return 0;
531 }
532
533 static int load_module(void)
534 {
535         AST_TEST_REGISTER(TEST_NAME(AST_JB_ADAPTIVE, create));
536         AST_TEST_REGISTER(TEST_NAME(AST_JB_ADAPTIVE, put_first));
537         AST_TEST_REGISTER(TEST_NAME(AST_JB_ADAPTIVE, put));
538         AST_TEST_REGISTER(TEST_NAME(AST_JB_ADAPTIVE, put_overflow));
539         AST_TEST_REGISTER(TEST_NAME(AST_JB_ADAPTIVE, put_out_of_order));
540
541         AST_TEST_REGISTER(TEST_NAME(AST_JB_FIXED, create));
542         AST_TEST_REGISTER(TEST_NAME(AST_JB_FIXED, put_first));
543         AST_TEST_REGISTER(TEST_NAME(AST_JB_FIXED, put));
544         AST_TEST_REGISTER(TEST_NAME(AST_JB_FIXED, put_overflow));
545         AST_TEST_REGISTER(TEST_NAME(AST_JB_FIXED, put_out_of_order));
546
547         return AST_MODULE_LOAD_SUCCESS;
548 }
549
550 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Abstract JitterBuffer API Tests");