25#define TEST_GLOBAL_INIT test_init()
26#define TEST_GLOBAL_FINI test_fini()
30#include <freeradius-devel/util/conf.h>
31#include <freeradius-devel/util/dbuff.h>
32#include <freeradius-devel/util/dict_test.h>
33#include <freeradius-devel/util/pair.h>
34#include <freeradius-devel/internal/internal.h>
97 fr_dbuff_uctx_talloc_t tctx;
106 TEST_MSG(
"init = %zu, expected %zd, got %zd",
init, ref_len, slen);
107 if (slen == ref_len) {
#define TEST_ASSERT(cond)
Common initialisation for acutest binaries.
static void fr_dbuff_free_talloc(fr_dbuff_t *dbuff)
Free the talloc buffer associated with a dbuff.
#define fr_dbuff_start(_dbuff_or_marker)
Return the 'start' position of a dbuff or marker.
static fr_dbuff_t * fr_dbuff_init_talloc(TALLOC_CTX *ctx, fr_dbuff_t *dbuff, fr_dbuff_uctx_talloc_t *tctx, size_t init, size_t max)
Initialise a special dbuff which automatically extends as additional data is written.
#define FR_DBUFF_TMP(_start, _len_or_end)
Creates a compound literal to pass into functions which accept a dbuff.
#define fr_exit_now(_x)
Exit without calling atexit() handlers, producing a log message in debug builds.
int fr_dict_free(fr_dict_t **dict, char const *dependent)
Decrement the reference count on a previously loaded dictionary.
fr_dict_attr_t const * fr_dict_attr_test_string
int fr_dict_test_init(TALLOC_CTX *ctx, fr_dict_t **dict_p, fr_dict_test_attr_t const *test_defs)
Initialise a test dictionary and add our test_defs to it.
int fr_dict_internal_afrom_file(fr_dict_t **out, char const *dict_subdir, char const *dependent)
(Re-)Initialize the special internal dictionary
static TALLOC_CTX * autofree
static fr_dict_t * internal_dict
static void test_encode_talloc_extend(void)
Encode one pair into talloc dbuffs of every initial size up to the encoded length.
static fr_dict_t * test_dict
static void test_init(void)
Global initialisation.
static void test_fini(void)
Release the internal dictionary before the dictionary context is freed.
int fr_pair_append_by_da(TALLOC_CTX *ctx, fr_pair_t **out, fr_pair_list_t *list, fr_dict_attr_t const *da)
Alloc a new fr_pair_t (and append)
int fr_pair_value_strdup(fr_pair_t *vp, char const *src, bool tainted)
Copy data into an "string" data type.
void fr_pair_list_init(fr_pair_list_t *list)
Initialise a pair list header.
ssize_t fr_internal_encode_pair(fr_dbuff_t *dbuff, fr_dcursor_t *cursor, void *encode_ctx)
Encode a data structure into an internal attribute.
init
Enter the EAP-IDENTITY state.
Stores an attribute, a value and various bits of other data.
#define talloc_autofree_context
The original function is deprecated, so replace it with our version.
#define FR_DICTIONARY_INTERNAL_DIR
void fr_pair_list_free(fr_pair_list_t *list)
Free memory used by a valuepair list.
#define fr_pair_dcursor_init(_cursor, _list)
Initialises a special dcursor with callbacks that will maintain the attr sublists correctly.
void fr_perror(char const *fmt,...)
Print the current error to stderr with a prefix.
int fr_check_lib_magic(uint64_t magic)
Check if the application linking to the library has the correct magic number.
#define RADIUSD_MAGIC_NUMBER