#include <freeradius-devel/io/atomic_queue.h>
#include <freeradius-devel/util/debug.h>
#include <inttypes.h>
#include <pthread.h>
#include <stdatomic.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
◆ stress_arg_t
◆ CHECK
Value: do { \
if (!(cond))
FAIL(
fmt, ##__VA_ARGS__); \
} while (0)
static int const char * fmt
Definition at line 47 of file atomic_ring_test.c.
◆ FAIL
Value: do { \
printf(
"FAIL\n " fmt "\n", ##__VA_ARGS__); \
fr_exit_now(EXIT_FAILURE); \
} while (0)
Definition at line 42 of file atomic_ring_test.c.
◆ OK
◆ STRESS_N
◆ TEST
| #define TEST |
( |
|
_name | ) |
do { printf(" %-48s ", _name); fflush(stdout); } while (0) |
◆ request_t
◆ main()
| int main |
( |
int |
argc, |
|
|
UNUSED char * |
argv[] |
|
) |
| |
◆ request_verify()
◆ stress_consumer()
| static void * stress_consumer |
( |
void * |
arg | ) |
|
|
static |
◆ stress_producer()
| static void * stress_producer |
( |
void * |
arg | ) |
|
|
static |
◆ test_alloc_free()
| static void test_alloc_free |
( |
TALLOC_CTX * |
ctx | ) |
|
|
static |
◆ test_free_nonempty()
| static void test_free_nonempty |
( |
TALLOC_CTX * |
ctx | ) |
|
|
static |
- free the ring with items still queued; must not leak/crash
Definition at line 160 of file atomic_ring_test.c.
◆ test_grow_across_segments()
| static void test_grow_across_segments |
( |
TALLOC_CTX * |
ctx | ) |
|
|
static |
- push past segment capacity triggers new-segment allocation
Definition at line 91 of file atomic_ring_test.c.
◆ test_interleaved()
| static void test_interleaved |
( |
TALLOC_CTX * |
ctx | ) |
|
|
static |
- interleaved push/pop keeps FIFO and frees drained segments
Definition at line 118 of file atomic_ring_test.c.
◆ test_push_pop_single_segment()
| static void test_push_pop_single_segment |
( |
TALLOC_CTX * |
ctx | ) |
|
|
static |
◆ test_stress_two_thread()
| static void test_stress_two_thread |
( |
TALLOC_CTX * |
ctx | ) |
|
|
static |