Tests for the pipe bio.
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 the pipe bio.
- Copyright
- 2026 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file bio_pipe_tests.c.
◆ _BIO_PRIVATE
◆ cb_eof()
◆ cb_noop()
◆ cb_read_blocked()
| static int cb_read_blocked |
( |
fr_bio_t * |
bio | ) |
|
|
static |
◆ test_eof_on_empty_read()
| static void test_eof_on_empty_read |
( |
void |
| ) |
|
|
static |
EOF is signalled even when the read which notices it returns no data.
The pipe used to call read_blocked() in that case, telling an application which read until it got nothing that it was blocked rather than finished.
Definition at line 110 of file bio_pipe_tests.c.
◆ test_eof_walk_continues()
| static void test_eof_walk_continues |
( |
void |
| ) |
|
|
static |
An empty pipe must not stop the EOF walk.
fr_bio_eof() stops when a handler returns zero or less. The pipe used to return zero for "nothing buffered", which stopped the walk and left a chain containing a pipe unable to finish.
Definition at line 150 of file bio_pipe_tests.c.
◆ test_pipe_alloc()
◆ test_write_after_eof()
| static void test_write_after_eof |
( |
void |
| ) |
|
|
static |
A write after EOF reports an error rather than "try again later".
Definition at line 175 of file bio_pipe_tests.c.
◆ test_write_clamped()
| static void test_write_clamped |
( |
void |
| ) |
|
|
static |
A write larger than the buffer is clamped rather than refused.
Definition at line 83 of file bio_pipe_tests.c.
◆ test_write_read()
| static void test_write_read |
( |
void |
| ) |
|
|
static |
◆ eof_count
◆ read_blocked_count
◆ test_cb
Initial value:= {
}
static void cb_eof(fr_bio_t *bio)
static int cb_read_blocked(fr_bio_t *bio)
static int cb_noop(fr_bio_t *bio)
Definition at line 38 of file bio_pipe_tests.c.
◆ TEST_LIST
Initial value:= {
}
static void test_write_read(void)
static void test_eof_walk_continues(void)
An empty pipe must not stop the EOF walk.
static void test_eof_on_empty_read(void)
EOF is signalled even when the read which notices it returns no data.
static void test_write_after_eof(void)
A write after EOF reports an error rather than "try again later".
static void test_write_clamped(void)
A write larger than the buffer is clamped rather than refused.
Definition at line 199 of file bio_pipe_tests.c.