summaryrefslogtreecommitdiff
path: root/src/tests/eio
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-11-07 16:33:33 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-11-09 11:43:59 +0000
commit309e5a57e1f9686648d2c5f2f7d163d057cee475 (patch)
tree44b18c58c688b70d59d6ef49b2fd631f56e269d6 /src/tests/eio
parent659473a7bfea0745440d6c34f12605ba6fcda50c (diff)
eio test -0 fix lots of ecore event handler prototypes.... warn
lots of warnigns because the ecore event prototyeps were WRONG. you must return true/fals if more handlers shoudl handle it or not... not return nothing... these tests were just broken.
Diffstat (limited to 'src/tests/eio')
-rw-r--r--src/tests/eio/eio_test_monitor.c114
1 files changed, 72 insertions, 42 deletions
diff --git a/src/tests/eio/eio_test_monitor.c b/src/tests/eio/eio_test_monitor.c
index 6728270feb..a209287e52 100644
--- a/src/tests/eio/eio_test_monitor.c
+++ b/src/tests/eio/eio_test_monitor.c
@@ -19,7 +19,8 @@
19 19
20static Ecore_Timer *test_timeout_timer; 20static Ecore_Timer *test_timeout_timer;
21 21
22static Eina_Bool _test_timeout_cb(void *data EINA_UNUSED) 22static Eina_Bool
23_test_timeout_cb(void *data EINA_UNUSED)
23{ 24{
24 ck_abort_msg("test timeout"); 25 ck_abort_msg("test timeout");
25 ecore_main_loop_quit(); 26 ecore_main_loop_quit();
@@ -35,7 +36,8 @@ static void _cancel_timeout()
35 } 36 }
36} 37}
37 38
38static Eina_Bool _test_timeout_expected(void *data EINA_UNUSED) 39static Eina_Bool
40_test_timeout_expected(void *data EINA_UNUSED)
39{ 41{
40 if (test_timeout_timer != NULL) 42 if (test_timeout_timer != NULL)
41 { 43 {
@@ -52,7 +54,8 @@ typedef struct {
52 const char *dst; 54 const char *dst;
53} RenameOperation; 55} RenameOperation;
54 56
55static Eina_Bool _delete_directory(void *data) 57static Eina_Bool
58_delete_directory(void *data)
56{ 59{
57 const char *dirname = (const char*)data; 60 const char *dirname = (const char*)data;
58 if (ecore_file_is_dir(dirname)) 61 if (ecore_file_is_dir(dirname))
@@ -62,7 +65,8 @@ static Eina_Bool _delete_directory(void *data)
62 return ECORE_CALLBACK_CANCEL; 65 return ECORE_CALLBACK_CANCEL;
63} 66}
64 67
65static Eina_Bool _create_directory(void *data) 68static Eina_Bool
69_create_directory(void *data)
66{ 70{
67 const char *dirname = (const char*)data; 71 const char *dirname = (const char*)data;
68 ecore_file_mkpath(dirname); 72 ecore_file_mkpath(dirname);
@@ -70,7 +74,8 @@ static Eina_Bool _create_directory(void *data)
70} 74}
71 75
72 76
73static Eina_Bool _create_file(void *data) 77static Eina_Bool
78_create_file(void *data)
74{ 79{
75 FILE *fd = fopen((const char*)data, "wb+"); 80 FILE *fd = fopen((const char*)data, "wb+");
76 ck_assert_ptr_ne(fd, NULL); 81 ck_assert_ptr_ne(fd, NULL);
@@ -79,14 +84,16 @@ static Eina_Bool _create_file(void *data)
79 return ECORE_CALLBACK_CANCEL; 84 return ECORE_CALLBACK_CANCEL;
80} 85}
81 86
82static Eina_Bool _delete_file(void *data) 87static Eina_Bool
88_delete_file(void *data)
83{ 89{
84 Eina_Bool file_removed = ecore_file_remove((const char*)data); 90 Eina_Bool file_removed = ecore_file_remove((const char*)data);
85 ck_assert(file_removed); 91 ck_assert(file_removed);
86 return ECORE_CALLBACK_CANCEL; 92 return ECORE_CALLBACK_CANCEL;
87} 93}
88 94
89static Eina_Bool _modify_file(void *data) 95static Eina_Bool
96_modify_file(void *data)
90{ 97{
91 FILE *fd = fopen((const char*)data, "ab"); 98 FILE *fd = fopen((const char*)data, "ab");
92 ck_assert_ptr_ne(fd, NULL); 99 ck_assert_ptr_ne(fd, NULL);
@@ -95,7 +102,8 @@ static Eina_Bool _modify_file(void *data)
95 return ECORE_CALLBACK_CANCEL; 102 return ECORE_CALLBACK_CANCEL;
96} 103}
97 104
98static Eina_Bool _modify_attrib_file(void *data) 105static Eina_Bool
106_modify_attrib_file(void *data)
99{ 107{
100 int ret = chmod((const char*)data, 0666); 108 int ret = chmod((const char*)data, 0666);
101 ck_assert_int_eq(ret, 0); 109 ck_assert_int_eq(ret, 0);
@@ -104,7 +112,8 @@ static Eina_Bool _modify_attrib_file(void *data)
104 112
105/////// helper functions 113/////// helper functions
106 114
107static Eina_Bool _check_event_path(void *data, void *event) 115static Eina_Bool
116_check_event_path(void *data, void *event)
108{ 117{
109 const char *f = ((Eio_Monitor_Event*)event)->filename; 118 const char *f = ((Eio_Monitor_Event*)event)->filename;
110 /* ignore directory creation events */ 119 /* ignore directory creation events */
@@ -113,7 +122,8 @@ static Eina_Bool _check_event_path(void *data, void *event)
113 return EINA_TRUE; 122 return EINA_TRUE;
114} 123}
115 124
116static Eina_Tmpstr *_common_init() 125static Eina_Tmpstr *
126_common_init(void)
117{ 127{
118 Eina_Tmpstr *dirname; 128 Eina_Tmpstr *dirname;
119 ecore_file_init(); 129 ecore_file_init();
@@ -125,7 +135,8 @@ static Eina_Tmpstr *_common_init()
125 return dirname; 135 return dirname;
126} 136}
127 137
128static void _common_shutdown(Eina_Tmpstr *dirname) 138static void
139_common_shutdown(Eina_Tmpstr *dirname)
129{ 140{
130 _delete_directory((void*)dirname); 141 _delete_directory((void*)dirname);
131 ecore_file_shutdown(); 142 ecore_file_shutdown();
@@ -199,7 +210,8 @@ EFL_START_TEST(eio_test_monitor_add_add_remove_remove)
199} 210}
200EFL_END_TEST 211EFL_END_TEST
201 212
202static void _file_created_cb(void *data, int type, void *event) 213static Eina_Bool
214_file_created_cb(void *data, int type, void *event)
203{ 215{
204 ck_assert_int_eq(type, (int)EIO_MONITOR_FILE_CREATED); 216 ck_assert_int_eq(type, (int)EIO_MONITOR_FILE_CREATED);
205 if (_check_event_path(data, event)) 217 if (_check_event_path(data, event))
@@ -207,6 +219,7 @@ static void _file_created_cb(void *data, int type, void *event)
207 _cancel_timeout(); 219 _cancel_timeout();
208 ecore_main_loop_quit(); 220 ecore_main_loop_quit();
209 } 221 }
222 return EINA_TRUE;
210} 223}
211 224
212 225
@@ -219,7 +232,7 @@ EFL_START_TEST(eio_test_monitor_directory_file_created_notify)
219 232
220 //monitor directory 233 //monitor directory
221 eio_monitor_add(dirname); 234 eio_monitor_add(dirname);
222 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, (Ecore_Event_Handler_Cb)_file_created_cb, filename); 235 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, _file_created_cb, filename);
223 236
224 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename); 237 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename);
225 238
@@ -239,7 +252,7 @@ struct {
239 { NULL, EINA_FALSE } 252 { NULL, EINA_FALSE }
240}; 253};
241 254
242static void 255static Eina_Bool
243_multi_file_created_cb(void *data EINA_UNUSED, int type, void *event) 256_multi_file_created_cb(void *data EINA_UNUSED, int type, void *event)
244{ 257{
245 Eio_Monitor_Event *ev = event; 258 Eio_Monitor_Event *ev = event;
@@ -251,16 +264,17 @@ _multi_file_created_cb(void *data EINA_UNUSED, int type, void *event)
251 for (i = 0; multi_files[i].s && strcmp(multi_files[i].s, ev->filename); i++) 264 for (i = 0; multi_files[i].s && strcmp(multi_files[i].s, ev->filename); i++)
252 ; 265 ;
253 266
254 if (!multi_files[i].s) return ; 267 if (!multi_files[i].s) return EINA_TRUE;
255 multi_files[i].checked = EINA_TRUE; 268 multi_files[i].checked = EINA_TRUE;
256 269
257 for (i = 0; multi_files[i].s; i++) 270 for (i = 0; multi_files[i].s; i++)
258 checked &= multi_files[i].checked; 271 checked &= multi_files[i].checked;
259 272
260 if (!checked) return ; 273 if (!checked) return EINA_TRUE;
261 274
262 _cancel_timeout(); 275 _cancel_timeout();
263 ecore_main_loop_quit(); 276 ecore_main_loop_quit();
277 return EINA_TRUE;
264} 278}
265 279
266EFL_START_TEST(eio_test_monitor_directory_multi_file_created_notify) 280EFL_START_TEST(eio_test_monitor_directory_multi_file_created_notify)
@@ -273,7 +287,7 @@ EFL_START_TEST(eio_test_monitor_directory_multi_file_created_notify)
273 287
274 //monitor directory 288 //monitor directory
275 eio_monitor_add(dirname); 289 eio_monitor_add(dirname);
276 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, (Ecore_Event_Handler_Cb)_multi_file_created_cb, NULL); 290 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, _multi_file_created_cb, NULL);
277 291
278 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, multi_files[0].s); 292 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, multi_files[0].s);
279 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, multi_files[1].s); 293 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, multi_files[1].s);
@@ -285,7 +299,8 @@ EFL_START_TEST(eio_test_monitor_directory_multi_file_created_notify)
285} 299}
286EFL_END_TEST 300EFL_END_TEST
287 301
288static void _file_deleted_cb(void *data, int type, void *event) 302static Eina_Bool
303_file_deleted_cb(void *data, int type, void *event)
289{ 304{
290 ck_assert_int_eq(type, (int)EIO_MONITOR_FILE_DELETED); 305 ck_assert_int_eq(type, (int)EIO_MONITOR_FILE_DELETED);
291 if (_check_event_path(data, event)) 306 if (_check_event_path(data, event))
@@ -293,6 +308,7 @@ static void _file_deleted_cb(void *data, int type, void *event)
293 _cancel_timeout(); 308 _cancel_timeout();
294 ecore_main_loop_quit(); 309 ecore_main_loop_quit();
295 } 310 }
311 return EINA_TRUE;
296} 312}
297 313
298EFL_START_TEST(eio_test_monitor_directory_file_deleted_notify) 314EFL_START_TEST(eio_test_monitor_directory_file_deleted_notify)
@@ -305,7 +321,7 @@ EFL_START_TEST(eio_test_monitor_directory_file_deleted_notify)
305 321
306 //monitor directory 322 //monitor directory
307 eio_monitor_add(dirname); 323 eio_monitor_add(dirname);
308 ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, (Ecore_Event_Handler_Cb)_file_deleted_cb, filename); 324 ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, _file_deleted_cb, filename);
309 325
310 ecore_timer_add(TEST_OPERATION_DELAY, _delete_file, filename); 326 ecore_timer_add(TEST_OPERATION_DELAY, _delete_file, filename);
311 327
@@ -315,14 +331,16 @@ EFL_START_TEST(eio_test_monitor_directory_file_deleted_notify)
315} 331}
316EFL_END_TEST 332EFL_END_TEST
317 333
318static void _file_modified_cb(void *data, int type, void *event) 334static Eina_Bool
335_file_modified_cb(void *data, int type, void *event)
319{ 336{
320 ck_assert_int_eq(type, (int)EIO_MONITOR_FILE_MODIFIED); 337 ck_assert_int_eq(type, (int)EIO_MONITOR_FILE_MODIFIED);
321 if(_check_event_path(data, event)) 338 if (_check_event_path(data, event))
322 { 339 {
323 _cancel_timeout(); 340 _cancel_timeout();
324 ecore_main_loop_quit(); 341 ecore_main_loop_quit();
325 } 342 }
343 return EINA_TRUE;
326} 344}
327 345
328EFL_START_TEST(eio_test_monitor_directory_file_modified_notify) 346EFL_START_TEST(eio_test_monitor_directory_file_modified_notify)
@@ -335,7 +353,7 @@ EFL_START_TEST(eio_test_monitor_directory_file_modified_notify)
335 353
336 //monitor directory 354 //monitor directory
337 eio_monitor_add(dirname); 355 eio_monitor_add(dirname);
338 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, (Ecore_Event_Handler_Cb)_file_modified_cb, filename); 356 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _file_modified_cb, filename);
339 357
340 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename); 358 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
341 359
@@ -346,7 +364,8 @@ EFL_START_TEST(eio_test_monitor_directory_file_modified_notify)
346} 364}
347EFL_END_TEST 365EFL_END_TEST
348 366
349static void _file_closed_cb(void *data, int type, void *event) 367static Eina_Bool
368_file_closed_cb(void *data, int type, void *event)
350{ 369{
351 ck_assert_int_eq(type, (int)EIO_MONITOR_FILE_CLOSED); 370 ck_assert_int_eq(type, (int)EIO_MONITOR_FILE_CLOSED);
352 if (_check_event_path(data, event)) 371 if (_check_event_path(data, event))
@@ -354,6 +373,7 @@ static void _file_closed_cb(void *data, int type, void *event)
354 _cancel_timeout(); 373 _cancel_timeout();
355 ecore_main_loop_quit(); 374 ecore_main_loop_quit();
356 } 375 }
376 return EINA_TRUE;
357} 377}
358 378
359EFL_START_TEST(eio_test_monitor_directory_file_closed_notify) 379EFL_START_TEST(eio_test_monitor_directory_file_closed_notify)
@@ -371,7 +391,7 @@ EFL_START_TEST(eio_test_monitor_directory_file_closed_notify)
371 printf("skipping %s: using fallback monitoring\n", "eio_test_monitor_directory_file_closed_notify"); 391 printf("skipping %s: using fallback monitoring\n", "eio_test_monitor_directory_file_closed_notify");
372 else 392 else
373 { 393 {
374 ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename); 394 ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, _file_closed_cb, filename);
375 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename); 395 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
376 396
377 ecore_main_loop_begin(); 397 ecore_main_loop_begin();
@@ -381,7 +401,8 @@ EFL_START_TEST(eio_test_monitor_directory_file_closed_notify)
381} 401}
382EFL_END_TEST 402EFL_END_TEST
383 403
384static void _directory_created_cb(void *data, int type, void *event) 404static Eina_Bool
405_directory_created_cb(void *data, int type, void *event)
385{ 406{
386 ck_assert_int_eq(type, (int)EIO_MONITOR_DIRECTORY_CREATED); 407 ck_assert_int_eq(type, (int)EIO_MONITOR_DIRECTORY_CREATED);
387 if (_check_event_path(data, event)) 408 if (_check_event_path(data, event))
@@ -389,6 +410,7 @@ static void _directory_created_cb(void *data, int type, void *event)
389 _cancel_timeout(); 410 _cancel_timeout();
390 ecore_main_loop_quit(); 411 ecore_main_loop_quit();
391 } 412 }
413 return EINA_TRUE;
392} 414}
393 415
394EFL_START_TEST(eio_test_monitor_directory_directory_created_notify) 416EFL_START_TEST(eio_test_monitor_directory_directory_created_notify)
@@ -400,7 +422,7 @@ EFL_START_TEST(eio_test_monitor_directory_directory_created_notify)
400 422
401 //monitor directory 423 //monitor directory
402 eio_monitor_add(dirname); 424 eio_monitor_add(dirname);
403 ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED, (Ecore_Event_Handler_Cb)_directory_created_cb, filename); 425 ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED, _directory_created_cb, filename);
404 426
405 ecore_timer_add(TEST_OPERATION_DELAY, _create_directory, filename); 427 ecore_timer_add(TEST_OPERATION_DELAY, _create_directory, filename);
406 428
@@ -410,7 +432,8 @@ EFL_START_TEST(eio_test_monitor_directory_directory_created_notify)
410} 432}
411EFL_END_TEST 433EFL_END_TEST
412 434
413static void _directory_deleted_cb(void *data, int type, void *event) 435static Eina_Bool
436_directory_deleted_cb(void *data, int type, void *event)
414{ 437{
415 ck_assert_int_eq(type, (int)EIO_MONITOR_DIRECTORY_DELETED); 438 ck_assert_int_eq(type, (int)EIO_MONITOR_DIRECTORY_DELETED);
416 if (_check_event_path(data, event)) 439 if (_check_event_path(data, event))
@@ -418,6 +441,7 @@ static void _directory_deleted_cb(void *data, int type, void *event)
418 _cancel_timeout(); 441 _cancel_timeout();
419 ecore_main_loop_quit(); 442 ecore_main_loop_quit();
420 } 443 }
444 return EINA_TRUE;
421} 445}
422 446
423EFL_START_TEST(eio_test_monitor_directory_directory_deleted_notify) 447EFL_START_TEST(eio_test_monitor_directory_directory_deleted_notify)
@@ -430,7 +454,7 @@ EFL_START_TEST(eio_test_monitor_directory_directory_deleted_notify)
430 454
431 //monitor directory 455 //monitor directory
432 eio_monitor_add(dirname); 456 eio_monitor_add(dirname);
433 ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED, (Ecore_Event_Handler_Cb)_directory_deleted_cb, filename); 457 ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED, _directory_deleted_cb, filename);
434 458
435 ecore_timer_add(TEST_OPERATION_DELAY, _delete_directory, filename); 459 ecore_timer_add(TEST_OPERATION_DELAY, _delete_directory, filename);
436 460
@@ -440,7 +464,8 @@ EFL_START_TEST(eio_test_monitor_directory_directory_deleted_notify)
440} 464}
441EFL_END_TEST 465EFL_END_TEST
442 466
443static void _directory_modified_cb(void *data, int type, void *event) 467static Eina_Bool
468_directory_modified_cb(void *data, int type, void *event)
444{ 469{
445 ck_assert_int_eq(type, (int)EIO_MONITOR_DIRECTORY_MODIFIED); 470 ck_assert_int_eq(type, (int)EIO_MONITOR_DIRECTORY_MODIFIED);
446 if (_check_event_path(data, event)) 471 if (_check_event_path(data, event))
@@ -448,6 +473,7 @@ static void _directory_modified_cb(void *data, int type, void *event)
448 _cancel_timeout(); 473 _cancel_timeout();
449 ecore_main_loop_quit(); 474 ecore_main_loop_quit();
450 } 475 }
476 return EINA_TRUE;
451} 477}
452 478
453 479
@@ -461,7 +487,7 @@ EFL_START_TEST(eio_test_monitor_directory_directory_modified_notify)
461 487
462 //monitor directory 488 //monitor directory
463 eio_monitor_add(dirname); 489 eio_monitor_add(dirname);
464 ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED, (Ecore_Event_Handler_Cb)_directory_modified_cb, filename); 490 ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED, _directory_modified_cb, filename);
465 491
466 ecore_timer_add(TEST_OPERATION_DELAY, _modify_attrib_file, filename); 492 ecore_timer_add(TEST_OPERATION_DELAY, _modify_attrib_file, filename);
467 493
@@ -472,7 +498,8 @@ EFL_START_TEST(eio_test_monitor_directory_directory_modified_notify)
472EFL_END_TEST 498EFL_END_TEST
473 499
474 500
475static void _directory_self_deleted_cb(void *data, int type, void *event) 501static Eina_Bool
502_directory_self_deleted_cb(void *data, int type, void *event)
476{ 503{
477 ck_assert_int_eq(type, (int)EIO_MONITOR_SELF_DELETED); 504 ck_assert_int_eq(type, (int)EIO_MONITOR_SELF_DELETED);
478 if (_check_event_path(data, event)) 505 if (_check_event_path(data, event))
@@ -480,6 +507,7 @@ static void _directory_self_deleted_cb(void *data, int type, void *event)
480 _cancel_timeout(); 507 _cancel_timeout();
481 ecore_main_loop_quit(); 508 ecore_main_loop_quit();
482 } 509 }
510 return EINA_TRUE;
483} 511}
484 512
485 513
@@ -489,7 +517,7 @@ EFL_START_TEST(eio_test_monitor_directory_directory_self_deleted_notify)
489 517
490 //monitor directory 518 //monitor directory
491 eio_monitor_add(dirname); 519 eio_monitor_add(dirname);
492 ecore_event_handler_add(EIO_MONITOR_SELF_DELETED, (Ecore_Event_Handler_Cb)_directory_self_deleted_cb, dirname); 520 ecore_event_handler_add(EIO_MONITOR_SELF_DELETED, _directory_self_deleted_cb, dirname);
493 521
494 ecore_timer_add(TEST_OPERATION_DELAY, _delete_directory, dirname); 522 ecore_timer_add(TEST_OPERATION_DELAY, _delete_directory, dirname);
495 523
@@ -511,7 +539,7 @@ EFL_START_TEST(eio_test_monitor_file_file_modified_notify)
511 539
512 //monitor file 540 //monitor file
513 eio_monitor_add(filename); 541 eio_monitor_add(filename);
514 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, (Ecore_Event_Handler_Cb)_file_modified_cb, filename); 542 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _file_modified_cb, filename);
515 543
516 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename); 544 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
517 545
@@ -532,7 +560,7 @@ EFL_START_TEST(eio_test_monitor_file_file_attrib_modified_notify)
532 560
533 //monitor file 561 //monitor file
534 eio_monitor_add(filename); 562 eio_monitor_add(filename);
535 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, (Ecore_Event_Handler_Cb)_file_modified_cb, filename); 563 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _file_modified_cb, filename);
536 564
537 ecore_timer_add(TEST_OPERATION_DELAY, _modify_attrib_file, filename); 565 ecore_timer_add(TEST_OPERATION_DELAY, _modify_attrib_file, filename);
538 566
@@ -558,7 +586,7 @@ EFL_START_TEST(eio_test_monitor_file_file_closed_notify)
558 printf("skipping %s: using fallback monitoring\n", "eio_test_monitor_file_file_closed_notify"); 586 printf("skipping %s: using fallback monitoring\n", "eio_test_monitor_file_file_closed_notify");
559 else 587 else
560 { 588 {
561 ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename); 589 ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, _file_closed_cb, filename);
562 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename); 590 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
563 591
564 ecore_main_loop_begin(); 592 ecore_main_loop_begin();
@@ -578,7 +606,7 @@ EFL_START_TEST(eio_test_monitor_file_file_self_deleted_notify)
578 606
579 //monitor file 607 //monitor file
580 eio_monitor_add(filename); 608 eio_monitor_add(filename);
581 ecore_event_handler_add(EIO_MONITOR_SELF_DELETED, (Ecore_Event_Handler_Cb)_directory_self_deleted_cb, filename); 609 ecore_event_handler_add(EIO_MONITOR_SELF_DELETED, _directory_self_deleted_cb, filename);
582 610
583 ecore_timer_add(TEST_OPERATION_DELAY, _delete_file, filename); 611 ecore_timer_add(TEST_OPERATION_DELAY, _delete_file, filename);
584 612
@@ -601,7 +629,7 @@ EFL_START_TEST(eio_test_monitor_two_monitors_one_event)
601 //monitor directory 629 //monitor directory
602 eio_monitor_add(dirname); 630 eio_monitor_add(dirname);
603 eio_monitor_add(dirname2); 631 eio_monitor_add(dirname2);
604 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, (Ecore_Event_Handler_Cb)_file_created_cb, filename); 632 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, _file_created_cb, filename);
605 633
606 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename); 634 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename);
607 635
@@ -629,7 +657,7 @@ EFL_START_TEST(eio_test_monitor_two_monitors_one_removed_one_event)
629 monitor = eio_monitor_add(dirname2); 657 monitor = eio_monitor_add(dirname2);
630 eio_monitor_add(dirname); 658 eio_monitor_add(dirname);
631 eio_monitor_del(monitor); 659 eio_monitor_del(monitor);
632 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, (Ecore_Event_Handler_Cb)_file_created_cb, filename); 660 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, _file_created_cb, filename);
633 661
634 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename); 662 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename);
635 663
@@ -640,9 +668,11 @@ EFL_START_TEST(eio_test_monitor_two_monitors_one_removed_one_event)
640} 668}
641EFL_END_TEST 669EFL_END_TEST
642 670
643static void _unexpected_event_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED) 671static Eina_Bool
672_unexpected_event_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
644{ 673{
645 ck_abort_msg("unexpected event"); 674 ck_abort_msg("unexpected event");
675 return EINA_TRUE;
646} 676}
647 677
648EFL_START_TEST(eio_test_monitor_two_monitors_one_removed_no_event) 678EFL_START_TEST(eio_test_monitor_two_monitors_one_removed_no_event)
@@ -661,7 +691,7 @@ EFL_START_TEST(eio_test_monitor_two_monitors_one_removed_no_event)
661 monitor = eio_monitor_add(dirname); 691 monitor = eio_monitor_add(dirname);
662 eio_monitor_add(dirname2); 692 eio_monitor_add(dirname2);
663 eio_monitor_del(monitor); 693 eio_monitor_del(monitor);
664 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, (Ecore_Event_Handler_Cb)_unexpected_event_cb, filename); 694 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, _unexpected_event_cb, filename);
665 695
666 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename); 696 ecore_timer_add(TEST_OPERATION_DELAY, _create_file, filename);
667 ecore_timer_add(0.2, _test_timeout_expected, NULL); 697 ecore_timer_add(0.2, _test_timeout_expected, NULL);
@@ -687,7 +717,7 @@ EFL_START_TEST(eio_test_monitor_two_files_in_same_directory)
687 //monitor file 717 //monitor file
688 eio_monitor_add(filename); 718 eio_monitor_add(filename);
689 eio_monitor_add(filename2); 719 eio_monitor_add(filename2);
690 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, (Ecore_Event_Handler_Cb)_file_modified_cb, filename); 720 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _file_modified_cb, filename);
691 721
692 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename); 722 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
693 723
@@ -716,7 +746,7 @@ EFL_START_TEST(eio_test_monitor_two_files_in_same_directory_one_removed)
716 eio_monitor_add(filename2); 746 eio_monitor_add(filename2);
717 eio_monitor_del(monitor); 747 eio_monitor_del(monitor);
718 748
719 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, (Ecore_Event_Handler_Cb)_unexpected_event_cb, filename); 749 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _unexpected_event_cb, filename);
720 750
721 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename); 751 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
722 ecore_timer_add(0.2, _test_timeout_expected, NULL); 752 ecore_timer_add(0.2, _test_timeout_expected, NULL);