Tests for chaining, EOF and shutdown.
More...
#include <freeradius-devel/util/test/acutest_common_init.h>
#include <freeradius-devel/util/test/acutest_helpers.h>
#include <freeradius-devel/bio/bio_priv.h>
#include <freeradius-devel/bio/mem.h>
#include <freeradius-devel/bio/pipe.h>
Go to the source code of this file.
Tests for chaining, EOF and shutdown.
- Copyright
- 2026 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file bio_base_tests.c.
◆ _BIO_PRIVATE
◆ cb_eof()
◆ cb_noop()
◆ cb_shutdown()
| static int cb_shutdown |
( |
fr_bio_t * |
bio | ) |
|
|
static |
◆ test_chain()
| static void test_chain |
( |
void |
| ) |
|
|
static |
◆ test_chain_alloc()
A pipe in front of a sink, which is the smallest chain we can build without a socket.
The pipe is the head, and is the bio which can hold data for the application. The sink stands in for the transport.
Definition at line 52 of file bio_base_tests.c.
◆ test_shutdown_discard()
| static void test_shutdown_discard |
( |
void |
| ) |
|
|
static |
◆ test_shutdown_drains_reads()
| static void test_shutdown_drains_reads |
( |
void |
| ) |
|
|
static |
A bio which still holds data defers the teardown until the application has drained it.
Definition at line 123 of file bio_base_tests.c.
◆ test_shutdown_free_completes()
| static void test_shutdown_free_completes |
( |
void |
| ) |
|
|
static |
A free completes a shutdown which is still waiting for a drain.
Definition at line 187 of file bio_base_tests.c.
◆ test_shutdown_immediate()
| static void test_shutdown_immediate |
( |
void |
| ) |
|
|
static |
With nothing buffered, a shutdown tears the chain down at once.
Definition at line 95 of file bio_base_tests.c.
◆ test_strerror()
| static void test_strerror |
( |
void |
| ) |
|
|
static |
◆ eof_count
◆ shutdown_count
◆ test_cb
Initial value:= {
}
static void cb_eof(fr_bio_t *bio)
static int cb_shutdown(fr_bio_t *bio)
static int cb_noop(fr_bio_t *bio)
Definition at line 38 of file bio_base_tests.c.
◆ TEST_LIST
Initial value:= {
}
static void test_strerror(void)
static void test_chain(void)
static void test_shutdown_drains_reads(void)
A bio which still holds data defers the teardown until the application has drained it.
static void test_shutdown_immediate(void)
With nothing buffered, a shutdown tears the chain down at once.
static void test_shutdown_discard(void)
fr_bio_shutdown_discard() does not wait, and throws the buffered data away.
static void test_shutdown_free_completes(void)
A free completes a shutdown which is still waiting for a drain.
Definition at line 227 of file bio_base_tests.c.