Tests for the LDAP DN and filter escape functions.
More...
#include <freeradius-devel/util/test/acutest_common_init.h>
#include <freeradius-devel/util/test/acutest_helpers.h>
#include <freeradius-devel/ldap/base.h>
Go to the source code of this file.
Tests for the LDAP DN and filter escape functions.
- Copyright
- 2026 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file ldap_util_tests.c.
◆ BOX_FROM_LITERAL
Allocate a tainted string box from a literal, NUL bytes included.
Definition at line 44 of file ldap_util_tests.c.
◆ TEST_CHECK_BOX_BYTES
| #define TEST_CHECK_BOX_BYTES |
( |
|
_vb, |
|
|
|
_exp |
|
) |
| |
Value:do { \
TEST_CHECK_LEN(_our_vb->vb_length, sizeof(_exp) - 1); \
TEST_CHECK(memcmp(_our_vb->vb_strvalue, _exp, sizeof(_exp) - 1) == 0); \
TEST_MSG("Expected : \"%s\"", _exp); \
TEST_MSG("Got : \"%s\"", _our_vb->vb_strvalue); \
} while (0)
Check a value box holds exactly the expected bytes, NUL bytes included.
A strcmp based check stops at the first NUL, which is the failure mode these tests exist to catch.
Definition at line 33 of file ldap_util_tests.c.
◆ box_from_bytes()
◆ test_dn_box_escape_leading()
| static void test_dn_box_escape_leading |
( |
void |
| ) |
|
|
static |
◆ test_dn_box_escape_nul_length_collision()
| static void test_dn_box_escape_nul_length_collision |
( |
void |
| ) |
|
|
static |
◆ test_dn_box_escape_plain()
| static void test_dn_box_escape_plain |
( |
void |
| ) |
|
|
static |
◆ test_dn_box_escape_specials()
| static void test_dn_box_escape_specials |
( |
void |
| ) |
|
|
static |
◆ test_dn_escape_sbuff()
| static void test_dn_escape_sbuff |
( |
void |
| ) |
|
|
static |
◆ test_dn_escape_sbuff_empty()
| static void test_dn_escape_sbuff_empty |
( |
void |
| ) |
|
|
static |
◆ test_filter_afrom_dn_list()
| static void test_filter_afrom_dn_list |
( |
void |
| ) |
|
|
static |
◆ test_filter_box_escape_empty()
| static void test_filter_box_escape_empty |
( |
void |
| ) |
|
|
static |
◆ test_filter_box_escape_nul_length_collision()
| static void test_filter_box_escape_nul_length_collision |
( |
void |
| ) |
|
|
static |
◆ test_filter_box_escape_nul_truncation()
| static void test_filter_box_escape_nul_truncation |
( |
void |
| ) |
|
|
static |
◆ test_filter_box_escape_plain()
| static void test_filter_box_escape_plain |
( |
void |
| ) |
|
|
static |
◆ test_filter_box_escape_specials()
| static void test_filter_box_escape_specials |
( |
void |
| ) |
|
|
static |
◆ test_filter_escape_sbuff()
| static void test_filter_escape_sbuff |
( |
void |
| ) |
|
|
static |
◆ test_filter_escape_sbuff_no_space()
| static void test_filter_escape_sbuff_no_space |
( |
void |
| ) |
|
|
static |
◆ TEST_LIST
Initial value:= {
}
static void test_filter_afrom_dn_list(void)
static void test_filter_escape_sbuff_no_space(void)
static void test_filter_box_escape_specials(void)
static void test_dn_escape_sbuff_empty(void)
static void test_dn_box_escape_plain(void)
static void test_dn_box_escape_nul_length_collision(void)
static void test_filter_box_escape_plain(void)
static void test_filter_box_escape_nul_length_collision(void)
static void test_filter_escape_sbuff(void)
static void test_filter_box_escape_nul_truncation(void)
static void test_filter_box_escape_empty(void)
static void test_dn_box_escape_specials(void)
static void test_dn_box_escape_leading(void)
static void test_dn_escape_sbuff(void)
Definition at line 242 of file ldap_util_tests.c.