event/event_test.c File Reference

#include <stdio.h>
#include "muxevent.h"

Include dependency graph for event_test.c:

Go to the source code of this file.

Defines

#define number(a, b)   (a+rand()%(b-a+1))
#define TEST_ITERATIONS   1000000
#define LARGE_NUMBER   500000
#define SIMULTANEOUS_EVENTS   600
#define SHORT_TIME   1
#define LONG_TIME   2

Functions

void hellow (MUXEVENT *e)
void main ()


Define Documentation

#define LARGE_NUMBER   500000

Definition at line 37 of file event_test.c.

Referenced by hellow(), and main().

#define LONG_TIME   2

Definition at line 41 of file event_test.c.

Referenced by hellow().

#define number ( a,
 )     (a+rand()%(b-a+1))

Definition at line 19 of file event_test.c.

Referenced by add_mail_message(), add_mail_message_nosig(), atr_add_raw(), atr_clr(), atr_get_raw(), do_dolist(), do_scramble(), fun_columns(), fun_dec(), fun_inc(), fun_iter(), fun_list(), fun_parse(), fun_strtrunc(), hellow(), load_mail(), mail_to_list(), mmdb_write_object(), player_folder(), vattr_alloc(), and vattr_delete().

#define SHORT_TIME   1

Definition at line 40 of file event_test.c.

Referenced by hellow().

#define SIMULTANEOUS_EVENTS   600

Definition at line 38 of file event_test.c.

Referenced by main().

#define TEST_ITERATIONS   1000000

Definition at line 29 of file event_test.c.

Referenced by main().


Function Documentation

void hellow ( MUXEVENT e  ) 

Definition at line 44 of file event_test.c.

References my_event_type::data, LARGE_NUMBER, LONG_TIME, muxevent_add_simple_arg, number, and SHORT_TIME.

Referenced by main().

00045 {
00046     int n;
00047     int d = (int) e->data;
00048 
00049 #if 1
00050     int d1, d2;
00051 
00052     d1 = d / LARGE_NUMBER;
00053     d2 = d % LARGE_NUMBER;
00054     printf("Hello, world!(%d) - %d\n", d1, d2);
00055     n = number(0, 10);
00056 #endif
00057     muxevent_add_simple_arg(!n ? number(1, LONG_TIME) : number(1, SHORT_TIME),
00058         hellow, (int *) (d + 1));
00059 }

void main ( void   ) 

Definition at line 61 of file event_test.c.

00062 {
00063     int i;
00064 
00065     muxevent_initialize();
00066     for (i = 0; i < SIMULTANEOUS_EVENTS; i++)
00067         muxevent_add_simple_arg(i + 1, hellow, (int *) (LARGE_NUMBER * i));
00068     for (i = 0; i < TEST_ITERATIONS; i++) {
00069 #ifdef TEST_TIME
00070         usleep(TEST_MSECS);
00071 #endif
00072         muxevent_run();
00073     }
00074 }


Generated on Mon May 28 04:25:26 2007 for BattletechMUX by  doxygen 1.4.7