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

t_evg_register.c File Reference


Detailed Description

For internal use only.

This test program is used to test the operation of event_gen_register().

Definition in file t_evg_register.c.

#include "event-test.h"

Include dependency graph for t_evg_register.c:

Go to the source code of this file.

Data Structures

struct  rule
 Structure for defining a testing rule. More...
struct  test
 Test description.

Defines

#define rule_init(gens, endfl, first, count)
 Initializer for test rule.
#define test_rule(name, gen, err, rules)
 Declare a test with a test rule.
#define test_norule(name, gen, err)
 Declare a test with no test rules.

Enumerations

enum  {
  TGT_01, TGT_02, TGT_03, TGT_04,
  TGT_05, TGT_06, TGT_07, TGT_08,
  TGT_09, TGT_10, TGT_11
}
 Test generator list. More...

Functions

static int do_rules (ev_ctx_t *ctx, unsigned int rulecnt, const struct rule *rules)
 Test a rule set.
int main (int argc, char **argv)
 Generator registration test program.

Variables

static struct rule endcons_rules []
 Test rule for evg_endcons test.
static struct rule endextforw_rules []
 Test rule for evg_endextforw test.
static struct rule endextrev_rules []
 Test rule for evg_endextrev test.
static struct rule midcons_rules []
 Test rule for evg_midcons test.
static struct rule midextforw_rules []
 Test rule for evg_midextforw test.
static struct rule midextrev_rules []
 Test rule for evg_midextrev test.
static struct rule endmerge_rules []
 Test rule for evg_endmerge test.
static struct rule midmerge_rules []
 Test rule for evg_midmerge test.
static struct test tests []
 Tests.


Define Documentation

#define rule_init gens,
endfl,
first,
count   ) 
 

For internal use only.

This macro initializes an element of a rule structure array.

Parameters:
[in] gens Zero-based number of ev_gens_t in gens linked list.
[in] endfl Flag to indicate end of the gens linked list.
[in] first Expected value of first generator in the ev_gens_t.
[in] count Expected count of generators in the ev_gens_t.

Definition at line 74 of file t_evg_register.c.

#define test_norule name,
gen,
err   ) 
 

For internal use only.

This macro is a tests struct initializer for tests with no rule.

Parameters:
[in] name Name of the associated test case.
[in] gen Test generator to add.
[in] err Expected error code from event_gen_register().

Definition at line 114 of file t_evg_register.c.

#define test_rule name,
gen,
err,
rules   ) 
 

For internal use only.

This macro is a tests struct initializer for tests with a rule.

Parameters:
[in] name Name of the associated test case.
[in] gen Test generator to add.
[in] err Expected error code from event_gen_register().
[in] rules Array of test rules.

Definition at line 101 of file t_evg_register.c.


Enumeration Type Documentation

anonymous enum
 

For internal use only.

This enumeration just builds a list of generator types.

Enumerator:
TGT_01 
TGT_02 
TGT_03 
TGT_04 
TGT_05 
TGT_06 
TGT_07 
TGT_08 
TGT_09 
TGT_10 
TGT_11 

Definition at line 42 of file t_evg_register.c.


Function Documentation

static int do_rules ev_ctx_t ctx,
unsigned int  rulecnt,
const struct rule rules
[static]
 

For internal use only.

This function executes the test rule set.

Parameters:
[in] ctx A pointer to an ev_ctx_t.
[in] rulecnt An integer specifying the number of rules being tested.
[in] rules A pointer to a struct rule specifying the rules to be tested.
Returns:
A boolean true value if the generator list matches the testing rules, or boolean false otherwise.

Definition at line 258 of file t_evg_register.c.

References rule::count, _ev_ctx_s::ec_gens, rule::first, _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_count, _ev_gens_s::gs_first, _ev_gens_s::gs_gens, and _ev_gens_s::gs_next.

Referenced by main().

int main int  argc,
char **  argv
 

For internal use only.

This program is used for testing the event generator registration function.

Definition at line 297 of file t_evg_register.c.

References do_rules(), ev_lib_init, ev_prog_name, ev_test_init, event_destroy(), event_gen_register(), and prog.

Here is the call graph for this function:


Variable Documentation

struct rule endcons_rules[] [static]
 

For internal use only.

Test rule for evg_endcons test.

Definition at line 122 of file t_evg_register.c.

struct rule endextforw_rules[] [static]
 

For internal use only.

Test rule for evg_endextforw test.

Definition at line 131 of file t_evg_register.c.

struct rule endextrev_rules[] [static]
 

For internal use only.

Test rule for evg_endextrev test.

Definition at line 140 of file t_evg_register.c.

struct rule endmerge_rules[] [static]
 

For internal use only.

Test rule for evg_endmerge test.

Definition at line 179 of file t_evg_register.c.

struct rule midcons_rules[] [static]
 

For internal use only.

Test rule for evg_midcons test.

Definition at line 149 of file t_evg_register.c.

struct rule midextforw_rules[] [static]
 

For internal use only.

Test rule for evg_midextforw test.

Definition at line 159 of file t_evg_register.c.

struct rule midextrev_rules[] [static]
 

For internal use only.

Test rule for evg_midextrev test.

Definition at line 169 of file t_evg_register.c.

struct rule midmerge_rules[] [static]
 

For internal use only.

Test rule for evg_midmerge test.

Definition at line 188 of file t_evg_register.c.

struct test tests[] [static]
 

For internal use only.

This array contains a list of test rules for testing the event_gen_register() function.

Definition at line 199 of file t_evg_register.c.


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