summaryrefslogtreecommitdiff
path: root/src/tests/eo/suite
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-10-06 15:42:03 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-10-06 16:12:01 +0900
commit7db67aaea842e4eb852ed9edbd0941b67648951b (patch)
tree04f343cf9ac4bd844f9f4fec67878f08fe7ea698 /src/tests/eo/suite
parent0f7dfdedfd7aacc3591d48fd47ba78ecb7b2757e (diff)
eo: Test deadlock after finalize (shared objects)
This is a test case for 258cfbbe8013b50a7d3f89ab863dab73fce Unfortunately there are many other functions that we should be testing, not just efl_finalized_get().
Diffstat (limited to 'src/tests/eo/suite')
-rw-r--r--src/tests/eo/suite/eo_test_general.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index 73418337d0..e08d69699a 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -4,6 +4,11 @@
4 4
5#include <stdio.h> 5#include <stdio.h>
6 6
7#ifndef _WIN32
8# include <signal.h>
9# include <unistd.h>
10#endif
11
7#include <Eo.h> 12#include <Eo.h>
8 13
9#include "eo_suite.h" 14#include "eo_suite.h"
@@ -1373,6 +1378,9 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
1373 Eo *obj = efl_add(DOMAIN_CLASS, NULL); 1378 Eo *obj = efl_add(DOMAIN_CLASS, NULL);
1374 printf("ADD2 DONE = %p\n", obj); 1379 printf("ADD2 DONE = %p\n", obj);
1375 1380
1381 printf("VERIFY finalized_get()\n");
1382 fail_if(!efl_finalized_get(d->objs));
1383
1376 printf("SET ON LOCAL\n"); 1384 printf("SET ON LOCAL\n");
1377 domain_a_set(obj, 1234); 1385 domain_a_set(obj, 1234);
1378 fail_if(domain_a_get(obj) != 1234); 1386 fail_if(domain_a_get(obj) != 1234);
@@ -1410,6 +1418,15 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
1410 return NULL; 1418 return NULL;
1411} 1419}
1412 1420
1421#ifndef _WIN32
1422static void
1423_timeout(int val EINA_UNUSED)
1424{
1425 printf("TIMED OUT!\n");
1426 exit(-1);
1427}
1428#endif
1429
1413START_TEST(eo_domain) 1430START_TEST(eo_domain)
1414{ 1431{
1415 Eo *obj, *objs; 1432 Eo *obj, *objs;
@@ -1417,6 +1434,11 @@ START_TEST(eo_domain)
1417 printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); 1434 printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
1418 efl_object_init(); 1435 efl_object_init();
1419 1436
1437#ifndef _WIN32
1438 signal(SIGALRM, _timeout);
1439 alarm(10);
1440#endif
1441
1420 fail_if(efl_domain_get() != EFL_ID_DOMAIN_MAIN); 1442 fail_if(efl_domain_get() != EFL_ID_DOMAIN_MAIN);
1421 1443
1422 fail_if(efl_domain_switch(EFL_ID_DOMAIN_THREAD) != EINA_TRUE); 1444 fail_if(efl_domain_switch(EFL_ID_DOMAIN_THREAD) != EINA_TRUE);
@@ -1459,7 +1481,7 @@ START_TEST(eo_domain)
1459 1481
1460 efl_domain_current_push(EFL_ID_DOMAIN_SHARED); 1482 efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
1461 printf("ADDS\n"); 1483 printf("ADDS\n");
1462 objs = efl_add(DOMAIN_CLASS, NULL); 1484 objs = efl_add(DOMAIN_CLASS, NULL, domain_a_set(efl_added, 42));
1463 printf("ADDS DONE = %p\n", objs); 1485 printf("ADDS DONE = %p\n", objs);
1464 efl_domain_current_pop(); 1486 efl_domain_current_pop();
1465 1487
@@ -1484,11 +1506,17 @@ START_TEST(eo_domain)
1484 eina_thread_join(t); 1506 eina_thread_join(t);
1485 printf("JOIN DONE\n"); 1507 printf("JOIN DONE\n");
1486 1508
1509 printf("DELETING OBJECTS\n");
1487 efl_del(obj); 1510 efl_del(obj);
1488 efl_del(objs); 1511 efl_del(objs);
1489 1512
1490 efl_object_shutdown(); 1513 efl_object_shutdown();
1491 printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); 1514 printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
1515
1516#ifndef _WIN32
1517 alarm(0);
1518 signal(SIGALRM, NULL);
1519#endif
1492} 1520}
1493END_TEST 1521END_TEST
1494 1522