summaryrefslogtreecommitdiff
path: root/src/tests/eina/eina_test_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eina/eina_test_file.c')
-rw-r--r--src/tests/eina/eina_test_file.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/tests/eina/eina_test_file.c b/src/tests/eina/eina_test_file.c
index f2f322550f..e8f735d3f0 100644
--- a/src/tests/eina/eina_test_file.c
+++ b/src/tests/eina/eina_test_file.c
@@ -441,6 +441,39 @@ START_TEST(eina_test_file_virtualize)
441} 441}
442END_TEST 442END_TEST
443 443
444static void *
445_eina_test_file_thread(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
446{
447 Eina_File *f;
448 unsigned int i;
449
450 for (i = 0; i < 10000; ++i)
451 {
452 f = eina_file_open("/bin/sh", EINA_FALSE);
453 fail_if(!f);
454 eina_file_close(f);
455 }
456
457 return NULL;
458}
459
460START_TEST(eina_test_file_thread)
461{
462 Eina_Thread th[4];
463 unsigned int i;
464
465 fail_if(!eina_init());
466
467 for (i = 0; i < 4; i++)
468 fail_if(!(eina_thread_create(&th[i], EINA_THREAD_NORMAL, 0, _eina_test_file_thread, NULL)));
469
470 for (i = 0; i < 4; i++)
471 fail_if(eina_thread_join(th[i]) != NULL);
472
473 eina_shutdown();
474}
475END_TEST
476
444void 477void
445eina_test_file(TCase *tc) 478eina_test_file(TCase *tc)
446{ 479{
@@ -449,5 +482,6 @@ eina_test_file(TCase *tc)
449 tcase_add_test(tc, eina_file_ls_simple); 482 tcase_add_test(tc, eina_file_ls_simple);
450 tcase_add_test(tc, eina_file_map_new_test); 483 tcase_add_test(tc, eina_file_map_new_test);
451 tcase_add_test(tc, eina_test_file_virtualize); 484 tcase_add_test(tc, eina_test_file_virtualize);
485 tcase_add_test(tc, eina_test_file_thread);
452} 486}
453 487