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

t_event_init.c File Reference


Detailed Description

For internal use only.

This test program is used to test the operation of event_init() and related functions.

Definition in file t_event_init.c.

#include "event-test.h"
#include "engines_int.h"
#include <stdio.h>
#include <string.h>

Include dependency graph for t_event_init.c:

Go to the source code of this file.

Data Structures

struct  teng
 Testing engines. More...

Defines

#define TENG_CNT
 Number of test engines in tengs array.

Functions

static ev_err_t ei_init (ev_ctx_t *ctx, ev_engine_t *engine, ev_flags_t *eng_flags)
 Test engine initialization callback.
static ev_err_t ei_poll (ev_ctx_t *ctx, ev_engine_t *engine, struct timeval *timeout)
 Test engine poll callback.
static ev_err_t ei_sock (ev_ctx_t *ctx, ev_engine_t *engine, ev_sock_t *sock)
 Test socket add/remove engine callback.
static ev_err_t ei_sockev (ev_ctx_t *ctx, ev_engine_t *engine, ev_sock_t *sock, ev_flags_t evs)
 Test socket event set engine callback.
static ev_err_t ei_sig (ev_ctx_t *ctx, ev_engine_t *engine, ev_sig_t *sig)
 Test signal add/remove engine callback.
static ev_err_t ei_tim (ev_ctx_t *ctx, ev_engine_t *engine, ev_tim_t *tim)
 Test timer add/remove engine callback.
static int gen_verify (ev_ctx_t *ctx, unsigned int gentype, ev_magic_t genmagic, size_t gensize)
 Helper routine for testing generator characteristics.
int main (int argc, char **argv)
 Library initialization test program.

Variables

static struct teng tengs []
 Testing engines.


Define Documentation

#define TENG_CNT
 

For internal use only.

This macro contains the count of the test engines in the tengs array.

Definition at line 233 of file t_event_init.c.

Referenced by main().


Function Documentation

static ev_err_t ei_init ev_ctx_t ctx,
ev_engine_t engine,
ev_flags_t eng_flags
[static]
 

For internal use only.

This routine is used to simulate an engine initialization callback. All it does is save the eng_flags value into the engine structure for later verification, then return an error.

Parameters:
[in] ctx A pointer to an ev_ctx_t.
[in] engine A pointer to the ev_engine_t.
[in,out] eng_flags A pointer to an ev_flags_t containing the desired engine flags. This is a value-result parameter that the engine is expected to modify.
Returns:
A non-zero error code.

Definition at line 61 of file t_event_init.c.

References eng_data_set.

static ev_err_t ei_poll ev_ctx_t ctx,
ev_engine_t engine,
struct timeval *  timeout
[static]
 

For internal use only.

This dummy routine is needed only to make the engine structure legal. All it does is return 0.

Parameters:
[in] ctx A pointer to an ev_ctx_t.
[in] engine A pointer to the ev_engine_t.
[in,out] timeout A pointer to a struct timeval which will contain the current timeout value. This is a value-result parameter that the engine may modify.
Returns:
A non-zero error code, or 0 on success.

Definition at line 83 of file t_event_init.c.

static ev_err_t ei_sig ev_ctx_t ctx,
ev_engine_t engine,
ev_sig_t sig
[static]
 

For internal use only.

This dummy routine is needed only to make the engine structure legal. All it does is return 0.

Parameters:
[in] ctx A pointer to an ev_ctx_t.
[in] engine A pointer to the ev_engine_t.
[in] sig A pointer to an ev_sig_t.
Returns:
A non-zero error code, or 0 on success.

Definition at line 139 of file t_event_init.c.

static ev_err_t ei_sock ev_ctx_t ctx,
ev_engine_t engine,
ev_sock_t sock
[static]
 

For internal use only.

This dummy routine is needed only to make the engine structure legal. All it does is return 0.

Parameters:
[in] ctx A pointer to an ev_ctx_t.
[in] engine A pointer to the ev_engine_t.
[in] sock A pointer to an ev_sock_t.
Returns:
A non-zero error code, or 0 on success.

Definition at line 101 of file t_event_init.c.

static ev_err_t ei_sockev ev_ctx_t ctx,
ev_engine_t engine,
ev_sock_t sock,
ev_flags_t  evs
[static]
 

For internal use only.

This dummy routine is needed only to make the engine structure legal. All it does is return 0.

Parameters:
[in] ctx A pointer to an ev_ctx_t.
[in] engine A pointer to the ev_engine_t.
[in] sock A pointer to an ev_sock_t.
[in] evs An ev_flags_t specifying the events of interest.
Returns:
A non-zero error code, or 0 on success.

Definition at line 121 of file t_event_init.c.

static ev_err_t ei_tim ev_ctx_t ctx,
ev_engine_t engine,
ev_tim_t tim
[static]
 

For internal use only.

This dummy routine is needed only to make the engine structure legal. All it does is return 0.

Parameters:
[in] ctx A pointer to an ev_ctx_t.
[in] engine A pointer to the ev_engine_t.
[in] tim A pointer to an ev_tim_t specifying the timer being registered.
Returns:
A non-zero error code, or 0 on success.

Definition at line 158 of file t_event_init.c.

static int gen_verify ev_ctx_t ctx,
unsigned int  gentype,
ev_magic_t  genmagic,
size_t  gensize
[static]
 

For internal use only.

This simple helper routine simply verifies the characteristics of some basic generators.

Parameters:
[in] ctx A pointer to an ev_ctx_t.
[in] gentype An integer representing the generator type.
[in] genmagic An ev_magic_t specifying the magic number for the generator specified by gentype.
[in] gensize A size_t specifying the size of the generator structure specified by gentype.
Returns:
Boolean true if the generator specified by gentype matches the values specified by genmagic and gensize.

Definition at line 256 of file t_event_init.c.

References _ev_ctx_s::ec_gens, _ev_gendesc_s::gd_active, _ev_gendesc_s::gd_free, _ev_gendesc_s::gd_magic, _ev_gendesc_s::gd_size, _ev_gendesc_s::gd_type, _ev_genlist_s::gl_count, _ev_genlist_s::gl_list, _ev_gens_s::gs_first, and _ev_gens_s::gs_gens.

Referenced by main().

int main int  argc,
char **  argv
 

For internal use only.

This program is used for testing the event library's initialization routines.

Definition at line 273 of file t_event_init.c.

References _ev_ctx_s::ec_gens, ec_verify, EGT_SIGNAL, EGT_SOCKET, EGT_TIMER, eng_data, eng_name, engine, ev_prog_name, EV_SIG_MAGIC, EV_SOCK_MAGIC, ev_test_init, EV_TIM_MAGIC, event_attr_confpath(), event_attr_confreg(), event_attr_confvar(), event_attr_destroy(), event_attr_engine(), event_attr_init(), event_attr_libpath(), event_attr_modlist(), event_destroy(), event_init(), gen_verify(), _ev_gens_s::gs_count, _ev_gens_s::gs_first, _ev_gens_s::gs_next, _ev_gens_s::gs_prev, prog, TENG_CNT, and tengs.

Here is the call graph for this function:


Variable Documentation

struct teng tengs[] [static]
 

For internal use only.

This variable is an array of engines to be tested, along with the expected results for the tests.

Referenced by main().


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