Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

t_timer_fcns.c File Reference


Detailed Description

For internal use only.

This test program is used to test the operation of the timer manipulation functions.

Definition in file t_timer_fcns.c.

#include "event-test.h"
#include <sys/time.h>

Include dependency graph for t_timer_fcns.c:

Go to the source code of this file.

Data Structures

struct  test_timer
 Structure for defining a timer to create. More...
struct  test_resched
 Structure for defining a timer rescheduling to perform. More...

Defines

#define TTF_SEC
 Number of seconds for current time.
#define TTF_USEC
 Number of microseconds for current time.
#define TT_FLAG_DESTROY
 Timer destruction flag.
#define timer_init(type, sec, usec, flags)
 Initializer for test timers.
#define resched_init(timer, type, sec, usec)
 Initializer for test rescheduling.

Functions

int gettimeofday (struct timeval *tv, struct timezone *tz)
 Overridden gettimeofday() function.
int main (int argc, char **argv)
 Timer manipulation functions test program.

Variables

static struct test_timer timers []
 Array of test timers.
static struct test_resched resched []
 Array of test reschedules.


Define Documentation

#define resched_init timer,
type,
sec,
usec   ) 
 

For internal use only.

This macro initializes an element of the test timer reschedule array.

Warning:
This macro evaluates the type argument multiple times.
Parameters:
[in] timer The index of the timer to reschedule.
[in] type One of TT_ABSOLUTE, TT_RELATIVE, or TT_PERIODIC, to specify the desired timer type.
[in] sec The seconds value for the timer expiration time.
[in] usec The microseconds value for the timer expiration time.

Definition at line 207 of file t_timer_fcns.c.

#define timer_init type,
sec,
usec,
flags   ) 
 

For internal use only.

This macro initializes an element of the test timer array.

Warning:
This macro evaluates the type argument multiple times.
Parameters:
[in] type One of TT_ABSOLUTE, TT_RELATIVE, or TT_PERIODIC, to specify the desired timer type.
[in] sec The seconds value for the timer expiration time.
[in] usec The microseconds value for the timer expiration time.
[in] flags Flags affecting how the timer will be tested.

Definition at line 122 of file t_timer_fcns.c.

#define TT_FLAG_DESTROY
 

For internal use only.

This flag indicates that the timer will be passed to timer_destroy() in order to test that function.

Definition at line 103 of file t_timer_fcns.c.

Referenced by main().

#define TTF_SEC
 

For internal use only.

This macro simply contains the number of seconds for the "current" time for testing purposes. (There's nothing special about this number; it's just the value for Monday, September 12, 21:03:15 EDT 2005, which just happens to be when this test program was written.)

Definition at line 47 of file t_timer_fcns.c.

Referenced by gettimeofday().

#define TTF_USEC
 

For internal use only.

This macro simply contains the number of microseconds for the "current" time for testing purposes. (There's nothing special about this number; see TTF_SEC.)

Definition at line 56 of file t_timer_fcns.c.

Referenced by gettimeofday().


Function Documentation

int gettimeofday struct timeval *  tv,
struct timezone *  tz
 

For internal use only.

This is an override of the C library's gettimeofday() function. Since it's not ANSI, we're supposed to be able to do so. We're doing this to be able to control what periodic and relative timers have their expire time set to, for testing purposes.

Parameters:
[in] tv A struct timeval to be filled in.
[in] tz The timezone (obsolete).
Return values:
0 The operation completed successfully.
-1 There was an error getting the time.

Definition at line 73 of file t_timer_fcns.c.

References TTF_SEC, and TTF_USEC.

int main int  argc,
char **  argv
 

For internal use only.

This program is used for testing the timer manipulation functions timer_create(), timer_destroy(), and timer_resched().

Definition at line 357 of file t_timer_fcns.c.

References ev_lib_init, ev_prog_name, ev_test_init, prog, ti_expire, ti_type, ti_value, timer_create(), timer_destroy(), timer_resched(), and TT_FLAG_DESTROY.

Here is the call graph for this function:


Variable Documentation

struct test_resched resched[] [static]
 

For internal use only.

This array contains all the information for the test timer reschedules to be performed.

Definition at line 218 of file t_timer_fcns.c.

struct test_timer timers[] [static]
 

For internal use only.

This array contains all the information for the timers which will be created in the process of testing timer_create() and friends.

Definition at line 132 of file t_timer_fcns.c.


Generated on Wed Dec 28 23:37:43 2005 for event by  doxygen 1.4.4