OpenVPN
Functions
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_entryschedule_find_earliest_wakeup (struct schedule *s)
 
int schedule_debug_entry (const struct schedule_entry *e, int depth, int *count, struct timeval *least, const struct timeval *min, const struct timeval *max)
 
int schedule_debug (struct schedule *s, int *count, struct timeval *least)
 
void tv_randomize (struct timeval *tv)
 
void schedule_verify (struct schedule *s, int n)
 
void schedule_randomize_array (struct schedule_entry **array, int size)
 
void schedule_print_work (struct schedule_entry *e, int indent)
 
void schedule_print (struct schedule *s)
 
void schedule_test (void **state)
 Runs the schedule test.
 

Function Documentation

◆ schedule_debug()

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

Definition at line 142 of file test_schedule.c.

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

Referenced by schedule_verify().

◆ schedule_debug_entry()

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

◆ schedule_find_earliest_wakeup()

static 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 241 of file test_schedule.c.

References schedule::root, and schedule_print_work().

◆ schedule_print_work()

void schedule_print_work ( struct schedule_entry e,
int  indent 
)

◆ schedule_randomize_array()

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

Definition at line 201 of file test_schedule.c.

Referenced by schedule_test().

◆ schedule_test()

void schedule_test ( void **  state)

◆ schedule_verify()

void schedule_verify ( struct schedule s,
int  n 
)

◆ tv_eq()

static 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()

static 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()

static 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 160 of file test_schedule.c.

References random.

Referenced by schedule_test().