eo: Test deadlock after finalize (shared objects)
This is a test case for 258cfbbe80
Unfortunately there are many other functions that we should
be testing, not just efl_finalized_get().
This commit is contained in:
parent
0f7dfdedfd
commit
7db67aaea8
|
@ -4,6 +4,11 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
# include <signal.h>
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <Eo.h>
|
#include <Eo.h>
|
||||||
|
|
||||||
#include "eo_suite.h"
|
#include "eo_suite.h"
|
||||||
|
@ -1373,6 +1378,9 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
|
||||||
Eo *obj = efl_add(DOMAIN_CLASS, NULL);
|
Eo *obj = efl_add(DOMAIN_CLASS, NULL);
|
||||||
printf("ADD2 DONE = %p\n", obj);
|
printf("ADD2 DONE = %p\n", obj);
|
||||||
|
|
||||||
|
printf("VERIFY finalized_get()\n");
|
||||||
|
fail_if(!efl_finalized_get(d->objs));
|
||||||
|
|
||||||
printf("SET ON LOCAL\n");
|
printf("SET ON LOCAL\n");
|
||||||
domain_a_set(obj, 1234);
|
domain_a_set(obj, 1234);
|
||||||
fail_if(domain_a_get(obj) != 1234);
|
fail_if(domain_a_get(obj) != 1234);
|
||||||
|
@ -1410,6 +1418,15 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
static void
|
||||||
|
_timeout(int val EINA_UNUSED)
|
||||||
|
{
|
||||||
|
printf("TIMED OUT!\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
START_TEST(eo_domain)
|
START_TEST(eo_domain)
|
||||||
{
|
{
|
||||||
Eo *obj, *objs;
|
Eo *obj, *objs;
|
||||||
|
@ -1417,6 +1434,11 @@ START_TEST(eo_domain)
|
||||||
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
|
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
|
||||||
efl_object_init();
|
efl_object_init();
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
signal(SIGALRM, _timeout);
|
||||||
|
alarm(10);
|
||||||
|
#endif
|
||||||
|
|
||||||
fail_if(efl_domain_get() != EFL_ID_DOMAIN_MAIN);
|
fail_if(efl_domain_get() != EFL_ID_DOMAIN_MAIN);
|
||||||
|
|
||||||
fail_if(efl_domain_switch(EFL_ID_DOMAIN_THREAD) != EINA_TRUE);
|
fail_if(efl_domain_switch(EFL_ID_DOMAIN_THREAD) != EINA_TRUE);
|
||||||
|
@ -1459,7 +1481,7 @@ START_TEST(eo_domain)
|
||||||
|
|
||||||
efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
|
efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
|
||||||
printf("ADDS\n");
|
printf("ADDS\n");
|
||||||
objs = efl_add(DOMAIN_CLASS, NULL);
|
objs = efl_add(DOMAIN_CLASS, NULL, domain_a_set(efl_added, 42));
|
||||||
printf("ADDS DONE = %p\n", objs);
|
printf("ADDS DONE = %p\n", objs);
|
||||||
efl_domain_current_pop();
|
efl_domain_current_pop();
|
||||||
|
|
||||||
|
@ -1484,11 +1506,17 @@ START_TEST(eo_domain)
|
||||||
eina_thread_join(t);
|
eina_thread_join(t);
|
||||||
printf("JOIN DONE\n");
|
printf("JOIN DONE\n");
|
||||||
|
|
||||||
|
printf("DELETING OBJECTS\n");
|
||||||
efl_del(obj);
|
efl_del(obj);
|
||||||
efl_del(objs);
|
efl_del(objs);
|
||||||
|
|
||||||
efl_object_shutdown();
|
efl_object_shutdown();
|
||||||
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
|
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
alarm(0);
|
||||||
|
signal(SIGALRM, NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue