23#include <freeradius-devel/util/test/acutest.h>
24#include <freeradius-devel/util/test/acutest_helpers.h>
26#include <freeradius-devel/server/log.h>
36#define CAPTURE_LOG(_fmt, ...) \
37 ((void) snprintf(captured, sizeof(captured), _fmt, ## __VA_ARGS__), logged++)
#define TEST_ASSERT(cond)
#define RATE_LIMIT_LOCAL(_entry, _log, _fmt,...)
Rate limit messages using a local limiting entry.
unsigned int repeated
Number of "skipped" messages.
fr_time_t last_complained
Last time we emitted a log message.
Track when a log message was last repeated.
bool fr_log_rate_limit
Whether repeated log entries should be rate limited.
static void test_first_message_logged(void)
The first message from a fresh entry is logged, even in the first second of the process.
static void test_repeat_suppressed(void)
A second message in the same second is counted, not logged.
#define CAPTURE_LOG(_fmt,...)
static void test_repeat_count_reported(void)
A message one second after the last one reports the repeats suppressed in between.
static void capture_reset(void)
static char captured[256]
int fr_time_start(void)
Initialize the local time.
static fr_time_delta_t fr_time_delta_from_sec(int64_t sec)
#define fr_time_sub(_a, _b)
Subtract one time from another.