Revision 0bf1a874 EventScheduler/Test/event_scheduler_test.c

View differences:

EventScheduler/Test/event_scheduler_test.c
39 39
	struct event_scheduler * es;
40 40
	struct action_event * ev;
41 41
	int res;
42
	uint8_t priority = 0;
42 43

  
43 44
	es = event_scheduler_new(0);
44 45
	ev = action_event_new(NULL);
45 46

  
46
	res = event_scheduler_insert(NULL,NULL,-1);
47
	res = event_scheduler_insert(NULL,NULL,-1, priority);
47 48
	assert(res < 0);
48 49

  
49
	res = event_scheduler_insert(NULL,ev,-1);
50
	res = event_scheduler_insert(NULL,ev,-1, priority);
50 51
	assert(res < 0);
51 52

  
52
	res = event_scheduler_insert(NULL,NULL,1);
53
	res = event_scheduler_insert(NULL,NULL,1, priority);
53 54
	assert(res < 0);
54 55

  
55
	res = event_scheduler_insert(NULL,ev,1);
56
	res = event_scheduler_insert(NULL,ev,1, priority);
56 57
	assert(res < 0);
57 58

  
58
	res = event_scheduler_insert(es,NULL,-1);
59
	res = event_scheduler_insert(es,NULL,-1, priority);
59 60
	assert(res < 0);
60 61

  
61
	res = event_scheduler_insert(es,ev,-1);
62
	res = event_scheduler_insert(es,ev,-1, priority);
62 63
	assert(res < 0);
63 64

  
64
	res = event_scheduler_insert(es,NULL,1);
65
	res = event_scheduler_insert(es,NULL,1, priority);
65 66
	assert(res < 0);
66 67

  
67
	res = event_scheduler_insert(es,ev,1);
68
	res = event_scheduler_insert(es,ev,1, priority);
68 69
	assert(res == 0);
69 70

  
70 71
	event_scheduler_destroy(&es);
......
78 79
	struct event_scheduler * es;
79 80
	struct action_event * ev;
80 81
	uint32_t res;
82
	uint8_t priority = 0;
81 83

  
82 84
	es = event_scheduler_new(0);
83 85
	ev = action_event_new(NULL);
......
88 90
	res = event_scheduler_queue_length(es);
89 91
	assert(res == 0);
90 92

  
91
	event_scheduler_insert(es,ev,0);
93
	event_scheduler_insert(es,ev,0, priority);
92 94
	res = event_scheduler_queue_length(es);
93 95
	assert(res == 1);
94 96

  
95
	event_scheduler_insert(es,ev,0);
97
	event_scheduler_insert(es,ev,0, priority);
96 98
	res = event_scheduler_queue_length(es);
97 99
	assert(res == 2);
98 100

  
......
119 121
{
120 122
	struct event_scheduler * es;
121 123
	struct action_event * ev, *ev2, *ev3, *ev4;
124
	uint8_t priority = 0;
122 125

  
123 126
	es = event_scheduler_new(0);
124 127
	ev = action_event_new(NULL);
125 128

  
126 129
	assert(event_scheduler_pop(NULL) == NULL);
127 130
	assert(event_scheduler_pop(es) == NULL);
128
	event_scheduler_insert(es,ev,1);
131
	event_scheduler_insert(es,ev,1, priority);
129 132
	assert(event_scheduler_pop(es) == ev);
130 133
	assert(event_scheduler_queue_length(es) == 0);
131 134
	assert(event_scheduler_elapsed_time(es) == 1);
......
133 136
	ev2 = action_event_new(NULL);
134 137
	ev3 = action_event_new(NULL);
135 138
	ev4= action_event_new(NULL);
136
	event_scheduler_insert(es,ev4,3);
137
	event_scheduler_insert(es,ev2,1);
138
	event_scheduler_insert(es,ev3,2);
139
	event_scheduler_insert(es,ev4,3, priority);
140
	event_scheduler_insert(es,ev2,1, priority);
141
	event_scheduler_insert(es,ev3,2, priority);
139 142

  
140 143
	assert(event_scheduler_pop(es) == ev2);
141 144
	assert(event_scheduler_elapsed_time(es) == 2);

Also available in: Unified diff