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

t_event_log.c File Reference


Detailed Description

For internal use only.

This test program is used to test the operation of event_log_set(), event_log_reset(), event_log_debug(), event_log_trace(), event_log_abort(), ev_log(), ev_abort(), ev_assert(), and ev_init().

Definition in file t_event_log.c.

#include <stdio.h>
#include <stdlib.h>
#include "event-test.h"

Include dependency graph for t_event_log.c:

Go to the source code of this file.

Defines

#define _str(a)
 Stringify argument.
#define str(a)
 Stringify expansion of argument.
#define LC_START
 Initial value for log_called.
#define LC_EVLOGTEST
 Secondary value for log_called.
#define LC_EVDEBUGTEST
 Tertiary value for log_called.

Functions

static void t_log (const char *file, int line, const char *func, const char *msg)
 Test logging function.
static unsigned int _ev_log (ev_flags_t flag, const char *msg)
 Wrap ev_log() logging macro.
static ev_err_t _ev_assert (int expr)
 Wrap ev_assert() logging macro.
static ev_err_t _ev_abort (void)
 Wrap ev_abort() logging macro.
static ev_err_t _ev_init (void)
 Wrap ev_init() macro.
int main (int argc, char **argv)
 Event log test program.

Variables

static unsigned int log_called
 Logging sentinel.


Define Documentation

#define _str  ) 
 

For internal use only.

This macro stringifies the a parameter.

Parameters:
[in] a The argument to be stringified.

Definition at line 45 of file t_event_log.c.

#define LC_EVDEBUGTEST
 

For internal use only.

This macro contains the tertiary value of the log_called variable, and is used in testing _ev_debug() calls.

Definition at line 78 of file t_event_log.c.

Referenced by main().

#define LC_EVLOGTEST
 

For internal use only.

This macro contains the secondary value of the log_called variable, and is used in testing that the log function is called.

Definition at line 70 of file t_event_log.c.

Referenced by main().

#define LC_START
 

For internal use only.

This macro contains the initial value of the log_called variable, and is used in testing that the log function is called.

Definition at line 62 of file t_event_log.c.

Referenced by main().

#define str  ) 
 

For internal use only.

This macro stringifies the expansion of the a parameter.

Parameters:
[in] a The argument to be expanded.

Definition at line 54 of file t_event_log.c.

Referenced by main().


Function Documentation

static ev_err_t _ev_abort void   )  [static]
 

For internal use only.

This function is used to wrap calls to the ev_abort() logging macro, in an attempt to keep the compiler from optimizing the macro away.

Definition at line 341 of file t_event_log.c.

References ev_abort.

Referenced by main().

static ev_err_t _ev_assert int  expr  )  [static]
 

For internal use only.

This function is used to wrap calls to the ev_assert() logging macro, in an attempt to keep the compiler from optimizing the macro away.

Parameters:
[in] expr The expression being asserted.

Definition at line 326 of file t_event_log.c.

References ev_assert.

Referenced by main().

static ev_err_t _ev_init void   )  [static]
 

For internal use only.

This function is used to wrap calls to the ev_init() macro, in an attempt to keep the compiler from optimizing the macro away.

Definition at line 355 of file t_event_log.c.

References ev_init.

Referenced by main().

static unsigned int _ev_log ev_flags_t  flag,
const char *  msg
[static]
 

For internal use only.

This function is used to wrap calls to the ev_log() logging macro, in an attempt to keep the compiler from optimizing the macro away.

Parameters:
[in] flag One of EVAS_LOG or EVAS_TRACE; if the flag is set in _ev_asflags, msg will be logged.
[in] msg The message to be logged.

Definition at line 309 of file t_event_log.c.

References ev_log, and log_called.

Referenced by main().

int main int  argc,
char **  argv
 

For internal use only.

This program is used for testing the event library's logging routines. It is a comprehensive test that also tests the internal macros used by the library for the purposes of logging debugging data.

Definition at line 126 of file t_event_log.c.

References _ev_abort(), _ev_asflags, _ev_assert(), _ev_debug(), _ev_debuglog, _ev_init(), _ev_log(), _gca_func, EVAS_ABORT, EVAS_LOG, EVAS_LOOP, EVAS_TRACE, event_log_abort(), event_log_debug(), event_log_reset(), event_log_set(), event_log_trace(), LC_EVDEBUGTEST, LC_EVLOGTEST, LC_START, log_called, str, and t_log().

Here is the call graph for this function:

static void t_log const char *  file,
int  line,
const char *  func,
const char *  msg
[static]
 

For internal use only.

This routine is a test logging function matching the ev_log_t functional signature. In addition to writing the log message to stderr, the msg is treated as a hexadecimal integer and parsed into log_called by a call to strtoul().

Parameters:
[in] file The file name.
[in] line The line number in the file.
[in] func The name of the containing function, or NULL if function names are not available.
[in] msg The log message.

Definition at line 104 of file t_event_log.c.

References log_called.

Referenced by main().


Variable Documentation

unsigned int log_called [static]
 

For internal use only.

This variable is used to signal whether the logging function was called and which message was logged.

Definition at line 86 of file t_event_log.c.

Referenced by _ev_log(), main(), and t_log().


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