summaryrefslogtreecommitdiff
path: root/src/tests/eo/signals/signals_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eo/signals/signals_main.c')
-rw-r--r--src/tests/eo/signals/signals_main.c108
1 files changed, 54 insertions, 54 deletions
diff --git a/src/tests/eo/signals/signals_main.c b/src/tests/eo/signals/signals_main.c
index 4fcfaef..5d40331 100644
--- a/src/tests/eo/signals/signals_main.c
+++ b/src/tests/eo/signals/signals_main.c
@@ -23,8 +23,8 @@ _a_changed_cb(void *data, const Eo_Event *event)
23 23
24 cb_count++; 24 cb_count++;
25 25
26 eo_do(event->obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _null_cb, (void *) 23423)); 26 eo_event_callback_priority_add(event->obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _null_cb, (void *) 23423);
27 eo_do(event->obj, eo_event_callback_del(EV_A_CHANGED, _null_cb, (void *) 23423)); 27 eo_event_callback_del(event->obj, EV_A_CHANGED, _null_cb, (void *) 23423);
28 28
29 /* Stop as we reached the 3rd one. */ 29 /* Stop as we reached the 3rd one. */
30 return (cb_count != 3); 30 return (cb_count != 3);
@@ -41,132 +41,132 @@ main(int argc, char *argv[])
41 Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); 41 Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS);
42 42
43 /* The order of these two is undetermined. */ 43 /* The order of these two is undetermined. */
44 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2)); 44 eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2);
45 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1)); 45 eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1);
46 /* This will be called afterwards. */ 46 /* This will be called afterwards. */
47 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_DEFAULT, _a_changed_cb, (void *) 3)); 47 eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_DEFAULT, _a_changed_cb, (void *) 3);
48 /* This will never be called because the previous callback returns NULL. */ 48 /* This will never be called because the previous callback returns NULL. */
49 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_AFTER, _a_changed_cb, (void *) 4)); 49 eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_AFTER, _a_changed_cb, (void *) 4);
50 50
51 eo_do(obj, simple_a_set(1)); 51 simple_a_set(obj, 1);
52 52
53 fail_if(cb_count != 3); 53 fail_if(cb_count != 3);
54 54
55 eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 3)); 55 eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 3);
56 fail_if(pd->cb_count != 3); 56 fail_if(pd->cb_count != 3);
57 57
58 eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 12)); 58 eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 12);
59 fail_if(pd->cb_count != 3); 59 fail_if(pd->cb_count != 3);
60 60
61 eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 4)); 61 eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 4);
62 fail_if(pd->cb_count != 2); 62 fail_if(pd->cb_count != 2);
63 63
64 eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 2)); 64 eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 2);
65 fail_if(pd->cb_count != 1); 65 fail_if(pd->cb_count != 1);
66 66
67 eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 1)); 67 eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 1);
68 fail_if(pd->cb_count != 0); 68 fail_if(pd->cb_count != 0);
69 69
70 /* Freeze/thaw. */ 70 /* Freeze/thaw. */
71 int fcount = 0; 71 int fcount = 0;
72 cb_count = 0; 72 cb_count = 0;
73 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1)); 73 eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1);
74 fail_if(pd->cb_count != 1); 74 fail_if(pd->cb_count != 1);
75 75
76 eo_do(obj, fcount = eo_event_freeze_count_get()); 76 fcount = eo_event_freeze_count_get(obj);
77 fail_if(fcount != 0); 77 fail_if(fcount != 0);
78 78
79 eo_do(obj, eo_event_freeze()); 79 eo_event_freeze(obj);
80 eo_do(obj, fcount = eo_event_freeze_count_get()); 80 fcount = eo_event_freeze_count_get(obj);
81 fail_if(fcount != 1); 81 fail_if(fcount != 1);
82 82
83 eo_do(obj, eo_event_freeze()); 83 eo_event_freeze(obj);
84 eo_do(obj, fcount = eo_event_freeze_count_get()); 84 fcount = eo_event_freeze_count_get(obj);
85 fail_if(fcount != 2); 85 fail_if(fcount != 2);
86 86
87 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2)); 87 eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2);
88 fail_if(pd->cb_count != 2); 88 fail_if(pd->cb_count != 2);
89 89
90 eo_do(obj, simple_a_set(2)); 90 simple_a_set(obj, 2);
91 fail_if(cb_count != 0); 91 fail_if(cb_count != 0);
92 eo_do(obj, eo_event_thaw()); 92 eo_event_thaw(obj);
93 eo_do(obj, fcount = eo_event_freeze_count_get()); 93 fcount = eo_event_freeze_count_get(obj);
94 fail_if(fcount != 1); 94 fail_if(fcount != 1);
95 95
96 eo_do(obj, eo_event_thaw()); 96 eo_event_thaw(obj);
97 eo_do(obj, fcount = eo_event_freeze_count_get()); 97 fcount = eo_event_freeze_count_get(obj);
98 fail_if(fcount != 0); 98 fail_if(fcount != 0);
99 99
100 eo_do(obj, simple_a_set(3)); 100 simple_a_set(obj, 3);
101 fail_if(cb_count != 2); 101 fail_if(cb_count != 2);
102 102
103 cb_count = 0; 103 cb_count = 0;
104 eo_do(obj, eo_event_thaw()); 104 eo_event_thaw(obj);
105 eo_do(obj, fcount = eo_event_freeze_count_get()); 105 fcount = eo_event_freeze_count_get(obj);
106 fail_if(fcount != 0); 106 fail_if(fcount != 0);
107 107
108 eo_do(obj, eo_event_freeze()); 108 eo_event_freeze(obj);
109 eo_do(obj, fcount = eo_event_freeze_count_get()); 109 fcount = eo_event_freeze_count_get(obj);
110 fail_if(fcount != 1); 110 fail_if(fcount != 1);
111 111
112 eo_do(obj, simple_a_set(2)); 112 simple_a_set(obj, 2);
113 fail_if(cb_count != 0); 113 fail_if(cb_count != 0);
114 eo_do(obj, eo_event_thaw()); 114 eo_event_thaw(obj);
115 eo_do(obj, fcount = eo_event_freeze_count_get()); 115 fcount = eo_event_freeze_count_get(obj);
116 fail_if(fcount != 0); 116 fail_if(fcount != 0);
117 117
118 eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 1)); 118 eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 1);
119 fail_if(pd->cb_count != 1); 119 fail_if(pd->cb_count != 1);
120 eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _a_changed_cb, (void *) 2)); 120 eo_event_callback_del(obj, EV_A_CHANGED, _a_changed_cb, (void *) 2);
121 fail_if(pd->cb_count != 0); 121 fail_if(pd->cb_count != 0);
122 122
123 /* Global Freeze/thaw. */ 123 /* Global Freeze/thaw. */
124 fcount = 0; 124 fcount = 0;
125 cb_count = 0; 125 cb_count = 0;
126 pd->cb_count = 0; 126 pd->cb_count = 0;
127 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1)); 127 eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 1);
128 fail_if(pd->cb_count != 1); 128 fail_if(pd->cb_count != 1);
129 129
130 eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); 130 fcount = eo_event_global_freeze_count_get(EO_CLASS);
131 fail_if(fcount != 0); 131 fail_if(fcount != 0);
132 132
133 eo_do(EO_CLASS, eo_event_global_freeze()); 133 eo_event_global_freeze(EO_CLASS);
134 eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); 134 fcount = eo_event_global_freeze_count_get(EO_CLASS);
135 fail_if(fcount != 1); 135 fail_if(fcount != 1);
136 136
137 eo_do(EO_CLASS, eo_event_global_freeze()); 137 eo_event_global_freeze(EO_CLASS);
138 eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); 138 fcount = eo_event_global_freeze_count_get(EO_CLASS);
139 fail_if(fcount != 2); 139 fail_if(fcount != 2);
140 140
141 eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2)); 141 eo_event_callback_priority_add(obj, EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _a_changed_cb, (void *) 2);
142 fail_if(pd->cb_count != 2); 142 fail_if(pd->cb_count != 2);
143 143
144 eo_do(obj, simple_a_set(2)); 144 simple_a_set(obj, 2);
145 fail_if(cb_count != 0); 145 fail_if(cb_count != 0);
146 eo_do(EO_CLASS, eo_event_global_thaw()); 146 eo_event_global_thaw(EO_CLASS);
147 eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); 147 fcount = eo_event_global_freeze_count_get(EO_CLASS);
148 fail_if(fcount != 1); 148 fail_if(fcount != 1);
149 149
150 eo_do(EO_CLASS, eo_event_global_thaw()); 150 eo_event_global_thaw(EO_CLASS);
151 eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); 151 fcount = eo_event_global_freeze_count_get(EO_CLASS);
152 fail_if(fcount != 0); 152 fail_if(fcount != 0);
153 153
154 eo_do(obj, simple_a_set(3)); 154 simple_a_set(obj, 3);
155 fail_if(cb_count != 2); 155 fail_if(cb_count != 2);
156 156
157 cb_count = 0; 157 cb_count = 0;
158 eo_do(EO_CLASS, eo_event_global_thaw()); 158 eo_event_global_thaw(EO_CLASS);
159 eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); 159 fcount = eo_event_global_freeze_count_get(EO_CLASS);
160 fail_if(fcount != 0); 160 fail_if(fcount != 0);
161 161
162 eo_do(EO_CLASS, eo_event_global_freeze()); 162 eo_event_global_freeze(EO_CLASS);
163 eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); 163 fcount = eo_event_global_freeze_count_get(EO_CLASS);
164 fail_if(fcount != 1); 164 fail_if(fcount != 1);
165 165
166 eo_do(obj, simple_a_set(2)); 166 simple_a_set(obj, 2);
167 fail_if(cb_count != 0); 167 fail_if(cb_count != 0);
168 eo_do(EO_CLASS, eo_event_global_thaw()); 168 eo_event_global_thaw(EO_CLASS);
169 eo_do(EO_CLASS, fcount = eo_event_global_freeze_count_get()); 169 fcount = eo_event_global_freeze_count_get(EO_CLASS);
170 fail_if(fcount != 0); 170 fail_if(fcount != 0);
171 171
172 172