summaryrefslogtreecommitdiff
path: root/src/tests/eio
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-04-11 10:38:21 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-24 16:02:17 -0700
commitccb5642eb9c122deac271da5f8b1353f46d73160 (patch)
tree9a0a93692425677f4853a6f1b8dadd6ee430c5ec /src/tests/eio
parent36f8a70041a8a16249a07d5b7131d57a8a6ea95b (diff)
Revert "efl_add_ref - fis to use efl_add properly with a parent."
This reverts commit 2fb5cc3ad09f6aaf82b5d1131ac5ed22ed848bd4. Most of this change where wrong as they didn't affect the destruction of the object. efl_add_ref allow for manual handling of the lifecycle of the object and make sure it is still alive during destructor. efl_add will not allow you to access an object after invalidate also efl.parent.get will always return NULL once the object is invalidated. Differential Revision: https://phab.enlightenment.org/D6062
Diffstat (limited to 'src/tests/eio')
-rw-r--r--src/tests/eio/eio_test_sentry.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/tests/eio/eio_test_sentry.c b/src/tests/eio/eio_test_sentry.c
index d2a368438c..f11d670e6e 100644
--- a/src/tests/eio/eio_test_sentry.c
+++ b/src/tests/eio/eio_test_sentry.c
@@ -145,7 +145,7 @@ EFL_START_TEST(eio_test_sentry_add_and_remove)
145 _create_directory((void*)filename); 145 _create_directory((void*)filename);
146 146
147 //monitor directory 147 //monitor directory
148 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 148 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
149 fail_if(!eio_sentry_add(sentry, filename)); 149 fail_if(!eio_sentry_add(sentry, filename));
150 150
151 eio_sentry_remove(sentry, filename); 151 eio_sentry_remove(sentry, filename);
@@ -166,7 +166,7 @@ EFL_START_TEST(eio_test_sentry_add_remove_add)
166 _create_directory((void*)filename); 166 _create_directory((void*)filename);
167 167
168 //monitor directory 168 //monitor directory
169 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 169 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
170 fail_if(!eio_sentry_add(sentry, filename)); 170 fail_if(!eio_sentry_add(sentry, filename));
171 eio_sentry_remove(sentry, filename); 171 eio_sentry_remove(sentry, filename);
172 172
@@ -191,7 +191,7 @@ EFL_START_TEST(eio_test_sentry_add_add_remove_remove)
191 _create_directory((void*)filename1); 191 _create_directory((void*)filename1);
192 _create_directory((void*)filename2); 192 _create_directory((void*)filename2);
193 193
194 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 194 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
195 195
196 //monitor directory 196 //monitor directory
197 fail_if(!eio_sentry_add(sentry, filename1)); 197 fail_if(!eio_sentry_add(sentry, filename1));
@@ -221,7 +221,7 @@ EFL_START_TEST(eio_test_sentry_directory_file_created_notify)
221 Eo* sentry; 221 Eo* sentry;
222 222
223 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_created_notify", dirname); 223 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_created_notify", dirname);
224 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 224 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
225 225
226 //monitor directory 226 //monitor directory
227 fail_if(!eio_sentry_add(sentry, dirname)); 227 fail_if(!eio_sentry_add(sentry, dirname));
@@ -245,7 +245,7 @@ EFL_START_TEST(eio_test_sentry_directory_file_deleted_notify)
245 245
246 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_deleted_notify", dirname); 246 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_deleted_notify", dirname);
247 _create_file((void*)filename); 247 _create_file((void*)filename);
248 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 248 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
249 249
250 //monitor directory 250 //monitor directory
251 fail_if(!eio_sentry_add(sentry, dirname)); 251 fail_if(!eio_sentry_add(sentry, dirname));
@@ -269,7 +269,7 @@ EFL_START_TEST(eio_test_sentry_directory_file_modified_notify)
269 269
270 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_modified_notify", dirname); 270 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_modified_notify", dirname);
271 _create_file((void*)filename); 271 _create_file((void*)filename);
272 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 272 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
273 273
274 //monitor directory 274 //monitor directory
275 fail_if(!eio_sentry_add(sentry, dirname)); 275 fail_if(!eio_sentry_add(sentry, dirname));
@@ -294,7 +294,7 @@ EFL_START_TEST(eio_test_sentry_directory_file_closed_notify)
294 294
295 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_closed_notify", dirname); 295 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_file_closed_notify", dirname);
296 _create_file((void*)filename); 296 _create_file((void*)filename);
297 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 297 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
298 298
299 //monitor directory 299 //monitor directory
300 fail_if(!eio_sentry_add(sentry, dirname)); 300 fail_if(!eio_sentry_add(sentry, dirname));
@@ -316,7 +316,7 @@ EFL_START_TEST(eio_test_sentry_directory_directory_created_notify)
316 Eo *sentry; 316 Eo *sentry;
317 317
318 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_directory_created_notify", dirname); 318 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_directory_created_notify", dirname);
319 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 319 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
320 320
321 //monitor directory 321 //monitor directory
322 fail_if(!eio_sentry_add(sentry, dirname)); 322 fail_if(!eio_sentry_add(sentry, dirname));
@@ -340,7 +340,7 @@ EFL_START_TEST(eio_test_sentry_directory_directory_deleted_notify)
340 340
341 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_directory_deleted_notify", dirname); 341 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_directory_deleted_notify", dirname);
342 _create_directory((void*)filename); 342 _create_directory((void*)filename);
343 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 343 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
344 344
345 //monitor directory 345 //monitor directory
346 fail_if(!eio_sentry_add(sentry, dirname)); 346 fail_if(!eio_sentry_add(sentry, dirname));
@@ -364,7 +364,7 @@ EFL_START_TEST(eio_test_sentry_directory_directory_modified_notify)
364 364
365 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_directory_modified_notify", dirname); 365 filename = eina_stringshare_printf("%s/eio_test_sentry_directory_directory_modified_notify", dirname);
366 _create_directory((void*)filename); 366 _create_directory((void*)filename);
367 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 367 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
368 368
369 //monitor directory 369 //monitor directory
370 fail_if(!eio_sentry_add(sentry, dirname)); 370 fail_if(!eio_sentry_add(sentry, dirname));
@@ -383,7 +383,7 @@ EFL_END_TEST
383EFL_START_TEST(eio_test_sentry_directory_directory_self_deleted_notify) 383EFL_START_TEST(eio_test_sentry_directory_directory_self_deleted_notify)
384{ 384{
385 Eina_Tmpstr *dirname = _common_init(); 385 Eina_Tmpstr *dirname = _common_init();
386 Eo *sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 386 Eo *sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
387 387
388 //monitor directory 388 //monitor directory
389 fail_if(!eio_sentry_add(sentry, dirname)); 389 fail_if(!eio_sentry_add(sentry, dirname));
@@ -409,7 +409,7 @@ EFL_START_TEST(eio_test_sentry_file_file_modified_notify)
409 409
410 filename = eina_stringshare_printf("%s/filecreated", dirname); 410 filename = eina_stringshare_printf("%s/filecreated", dirname);
411 _create_file((void*)filename); 411 _create_file((void*)filename);
412 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 412 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
413 413
414 //monitor file 414 //monitor file
415 fail_if(!eio_sentry_add(sentry, filename)); 415 fail_if(!eio_sentry_add(sentry, filename));
@@ -434,7 +434,7 @@ EFL_START_TEST(eio_test_sentry_file_file_attrib_modified_notify)
434 434
435 filename = eina_stringshare_printf("%s/eio_test_sentry_file_file_attrib_modified_notify", dirname); 435 filename = eina_stringshare_printf("%s/eio_test_sentry_file_file_attrib_modified_notify", dirname);
436 _create_file((void*)filename); 436 _create_file((void*)filename);
437 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 437 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
438 438
439 //monitor file 439 //monitor file
440 fail_if(!eio_sentry_add(sentry, filename)); 440 fail_if(!eio_sentry_add(sentry, filename));
@@ -459,7 +459,7 @@ EFL_START_TEST(eio_test_sentry_file_file_closed_notify)
459 459
460 filename = eina_stringshare_printf("%s/eio_test_sentry_file_file_closed_notify", dirname); 460 filename = eina_stringshare_printf("%s/eio_test_sentry_file_file_closed_notify", dirname);
461 _create_file((void*)filename); 461 _create_file((void*)filename);
462 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 462 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
463 463
464 //monitor file 464 //monitor file
465 fail_if(!eio_sentry_add(sentry, dirname)); 465 fail_if(!eio_sentry_add(sentry, dirname));
@@ -482,7 +482,7 @@ EFL_START_TEST(eio_test_sentry_file_file_self_deleted_notify)
482 482
483 filename = eina_stringshare_printf("%s/eio_test_sentry_file_file_self_deleted_notify", dirname); 483 filename = eina_stringshare_printf("%s/eio_test_sentry_file_file_self_deleted_notify", dirname);
484 _create_file((void*)filename); 484 _create_file((void*)filename);
485 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 485 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
486 486
487 //monitor file 487 //monitor file
488 fail_if(!eio_sentry_add(sentry, filename)); 488 fail_if(!eio_sentry_add(sentry, filename));
@@ -508,7 +508,7 @@ EFL_START_TEST(eio_test_sentry_two_monitors_one_event)
508 508
509 eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2); 509 eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2);
510 filename = eina_stringshare_printf("%s/eio_test_sentry_two_monitors_one_event", dirname); 510 filename = eina_stringshare_printf("%s/eio_test_sentry_two_monitors_one_event", dirname);
511 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 511 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
512 512
513 //monitor directory 513 //monitor directory
514 fail_if(!eio_sentry_add(sentry, dirname)); 514 fail_if(!eio_sentry_add(sentry, dirname));
@@ -537,7 +537,7 @@ EFL_START_TEST(eio_test_sentry_two_monitors_one_removed_one_event)
537 537
538 eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2); 538 eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2);
539 filename = eina_stringshare_printf("%s/eio_test_sentry_two_monitors_one_removed", dirname); 539 filename = eina_stringshare_printf("%s/eio_test_sentry_two_monitors_one_removed", dirname);
540 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 540 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
541 541
542 //monitor directory 542 //monitor directory
543 fail_if(!eio_sentry_add(sentry, dirname2)); 543 fail_if(!eio_sentry_add(sentry, dirname2));
@@ -571,7 +571,7 @@ EFL_START_TEST(eio_test_sentry_two_monitors_one_removed_no_event)
571 571
572 eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2); 572 eina_file_mkdtemp("checkFileCreationXXXXXX", &dirname2);
573 filename = eina_stringshare_printf("%s/eio_test_sentry_two_monitors_one_removed", dirname); 573 filename = eina_stringshare_printf("%s/eio_test_sentry_two_monitors_one_removed", dirname);
574 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 574 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
575 575
576 //monitor directory 576 //monitor directory
577 fail_if(!eio_sentry_add(sentry, dirname)); 577 fail_if(!eio_sentry_add(sentry, dirname));
@@ -602,7 +602,7 @@ EFL_START_TEST(eio_test_sentry_two_files_in_same_directory)
602 filename2 = eina_stringshare_printf("%s/eio_test_sentry_two_files_in_same_directory_2", dirname); 602 filename2 = eina_stringshare_printf("%s/eio_test_sentry_two_files_in_same_directory_2", dirname);
603 _create_file((void*)filename); 603 _create_file((void*)filename);
604 _create_file((void*)filename2); 604 _create_file((void*)filename2);
605 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 605 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
606 606
607 //monitor file 607 //monitor file
608 fail_if(!eio_sentry_add(sentry,filename)); 608 fail_if(!eio_sentry_add(sentry,filename));
@@ -632,7 +632,7 @@ EFL_START_TEST(eio_test_sentry_two_files_in_same_directory_one_removed)
632 filename2 = eina_stringshare_printf("%s/eio_test_sentry_two_files_in_same_directory_one_removed_2", dirname); 632 filename2 = eina_stringshare_printf("%s/eio_test_sentry_two_files_in_same_directory_one_removed_2", dirname);
633 _create_file((void*)filename); 633 _create_file((void*)filename);
634 _create_file((void*)filename2); 634 _create_file((void*)filename2);
635 sentry = efl_add(EIO_SENTRY_CLASS, efl_main_loop_get()); 635 sentry = efl_add_ref(EIO_SENTRY_CLASS, NULL);
636 636
637 //monitor file 637 //monitor file
638 fail_if(!eio_sentry_add(sentry,filename)); 638 fail_if(!eio_sentry_add(sentry,filename));