OpenVPN
test_schedule.c File Reference
#include "syshead.h"
#include "schedule.h"
#include "test_common.h"
Include dependency graph for test_schedule.c:

Go to the source code of this file.

Functions

static bool tv_lt (const struct timeval *t1, const struct timeval *t2)
static bool tv_le (const struct timeval *t1, const struct timeval *t2)
static bool tv_eq (const struct timeval *t1, const struct timeval *t2)
static struct schedule_entry * schedule_find_earliest_wakeup (struct schedule *s)
unsigned int schedule_debug_entry (const struct schedule_entry *e, unsigned int depth, unsigned int *count, struct timeval *least, const struct timeval *min, const struct timeval *max)
unsigned int schedule_debug (struct schedule *s, unsigned int *count, struct timeval *least)
void tv_randomize (struct timeval *tv)
void schedule_verify (struct schedule *s, unsigned int n)
void schedule_randomize_array (struct schedule_entry **array, unsigned int size)
void schedule_print_work (struct schedule_entry *e, unsigned int indent)
void schedule_print (struct schedule *s)
void schedule_test (void **state)
 Runs the schedule test.

Function Documentation

◆ schedule_debug()

unsigned int schedule_debug ( struct schedule * s,
unsigned int * count,
struct timeval * least )

Definition at line 143 of file test_schedule.c.

References schedule_entry::parent, schedule::root, and schedule_debug_entry().

Referenced by schedule_verify().

◆ schedule_debug_entry()

unsigned int schedule_debug_entry ( const struct schedule_entry * e,
unsigned int depth,
unsigned int * count,
struct timeval * least,
const struct timeval * min,
const struct timeval * max )

◆ schedule_find_earliest_wakeup()

struct schedule_entry * schedule_find_earliest_wakeup ( struct schedule * s)
inlinestatic

Definition at line 72 of file test_schedule.c.

References schedule::root, and schedule_find_least().

Referenced by schedule_test(), and schedule_verify().

◆ schedule_print()

void schedule_print ( struct schedule * s)

Definition at line 240 of file test_schedule.c.

References schedule::root, and schedule_print_work().

◆ schedule_print_work()

void schedule_print_work ( struct schedule_entry * e,
unsigned int indent )

◆ schedule_randomize_array()

void schedule_randomize_array ( struct schedule_entry ** array,
unsigned int size )

Definition at line 202 of file test_schedule.c.

Referenced by schedule_test().

◆ schedule_test()

◆ schedule_verify()

void schedule_verify ( struct schedule * s,
unsigned int n )

◆ tv_eq()

bool tv_eq ( const struct timeval * t1,
const struct timeval * t2 )
inlinestatic

Definition at line 66 of file test_schedule.c.

Referenced by schedule_verify().

◆ tv_le()

bool tv_le ( const struct timeval * t1,
const struct timeval * t2 )
inlinestatic

Definition at line 49 of file test_schedule.c.

Referenced by schedule_debug_entry().

◆ tv_lt()

bool tv_lt ( const struct timeval * t1,
const struct timeval * t2 )
inlinestatic

Definition at line 32 of file test_schedule.c.

Referenced by schedule_debug_entry().

◆ tv_randomize()

void tv_randomize ( struct timeval * tv)

Definition at line 161 of file test_schedule.c.

References random.

Referenced by schedule_test().