summaryrefslogtreecommitdiff
path: root/src/tests/eo/suite
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-09-09 18:42:21 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-09-09 18:53:20 +0900
commitfe81fff89b1bbbb7c5468edd0e08c99e193bb7c4 (patch)
tree1bca98b77dcf34b09628b01ef6b56c299c11664c /src/tests/eo/suite
parentab0cb7a62dcc0f701fd960aa34547f770ac9f93d (diff)
eo test suite - finish off the tests so we're testing all the features
testing all the core features of eo domains now. yes it could be a lot more extensive but it tests the important day to day cases. this is the case across most of our tests too - they dont really stress things out a lot.
Diffstat (limited to 'src/tests/eo/suite')
-rw-r--r--src/tests/eo/suite/eo_test_domain.c8
-rw-r--r--src/tests/eo/suite/eo_test_general.c76
2 files changed, 74 insertions, 10 deletions
diff --git a/src/tests/eo/suite/eo_test_domain.c b/src/tests/eo/suite/eo_test_domain.c
index 9ed5f9a277..6f88e597f1 100644
--- a/src/tests/eo/suite/eo_test_domain.c
+++ b/src/tests/eo/suite/eo_test_domain.c
@@ -50,14 +50,6 @@ _recursive(Eo *obj, void *class_data EINA_UNUSED, int n)
50 count = 0; 50 count = 0;
51} 51}
52 52
53static void
54_dbg_info_get(Eo *eo_obj, void *_pd EINA_UNUSED, Efl_Dbg_Info *root)
55{
56 efl_dbg_info_get(efl_super(eo_obj, MY_CLASS), root);
57 Efl_Dbg_Info *group = EFL_DBG_INFO_LIST_APPEND(root, "Test list");
58 EFL_DBG_INFO_APPEND(group, "Test", EINA_VALUE_TYPE_INT, 8);
59}
60
61EFL_VOID_FUNC_BODYV(domain_a_set, EFL_FUNC_CALL(a), int a); 53EFL_VOID_FUNC_BODYV(domain_a_set, EFL_FUNC_CALL(a), int a);
62EFL_FUNC_BODY(domain_a_get, int, 0); 54EFL_FUNC_BODY(domain_a_get, int, 0);
63EFL_FUNC_BODY(domain_a_print, Eina_Bool, EINA_FALSE); 55EFL_FUNC_BODY(domain_a_print, Eina_Bool, EINA_FALSE);
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index ccc07efd4b..0c522d19a7 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -1355,6 +1355,61 @@ START_TEST(eo_rec_interface)
1355} 1355}
1356END_TEST 1356END_TEST
1357 1357
1358typedef struct
1359{
1360 Eo *obj, *objs;
1361 Efl_Domain_Data *dat;
1362} Data;
1363
1364static void *
1365thr1(void *data, Eina_Thread t EINA_UNUSED)
1366{
1367 Data *d = data;
1368 Efl_Id_Domain dom;
1369
1370 fail_if(efl_domain_switch(EFL_ID_DOMAIN_THREAD) != EINA_TRUE);
1371 fail_if(efl_domain_get() != EFL_ID_DOMAIN_THREAD);
1372 printf("ADD2\n");
1373 Eo *obj = efl_add(DOMAIN_CLASS, NULL);
1374 printf("ADD2 DONE = %p\n", obj);
1375
1376 printf("SET ON LOCAL\n");
1377 domain_a_set(obj, 1234);
1378 fail_if(domain_a_get(obj) != 1234);
1379 printf("SET ON LOCAL DONE\n");
1380
1381 printf("SET ON SHARED\n");
1382 domain_a_set(d->objs, 1234);
1383 fail_if(domain_a_get(d->objs) != 1234);
1384 printf("SET ON SHARED DONE\n");
1385
1386 printf("FAAAAIL check %p\n", d->obj);
1387 domain_a_set(d->obj, 1234);
1388 int v = domain_a_get(d->obj);
1389 printf("........ v = %i\n", v);
1390 fail_if(v == 1234);
1391 sleep(1);
1392 printf("FAAAAIL DONE\n");
1393
1394 printf("ADOPT...\n");
1395 dom = efl_domain_data_adopt(d->dat);
1396 fail_if(dom != EFL_ID_DOMAIN_MAIN);
1397 printf("SUCCEED check %p\n", d->obj);
1398 domain_a_set(d->obj, 8910);
1399 v = domain_a_get(d->obj);
1400 printf("........ v = %i\n", v);
1401 fail_if(v != 8910);
1402 sleep(1);
1403 printf("SUCCEED DONE\n");
1404
1405 printf("RETURN DOMAIN DATA\n");
1406 fail_if(efl_domain_data_return(dom) != EINA_TRUE);
1407 printf("RETURN DOMAIN DATA DONE\n");
1408
1409 efl_del(obj);
1410 return NULL;
1411}
1412
1358START_TEST(eo_domain) 1413START_TEST(eo_domain)
1359{ 1414{
1360 Eo *obj, *objs; 1415 Eo *obj, *objs;
@@ -1398,10 +1453,14 @@ START_TEST(eo_domain)
1398 1453
1399 fail_if(efl_domain_current_get() != EFL_ID_DOMAIN_MAIN); 1454 fail_if(efl_domain_current_get() != EFL_ID_DOMAIN_MAIN);
1400 1455
1401 objs = efl_add(DOMAIN_CLASS, NULL); 1456 printf("ADD1\n");
1457 obj = efl_add(DOMAIN_CLASS, NULL);
1458 printf("ADD1 DONE = %p\n", obj);
1402 1459
1403 efl_domain_current_push(EFL_ID_DOMAIN_SHARED); 1460 efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
1404 obj = efl_add(DOMAIN_CLASS, NULL); 1461 printf("ADDS\n");
1462 objs = efl_add(DOMAIN_CLASS, NULL);
1463 printf("ADDS DONE = %p\n", objs);
1405 efl_domain_current_pop(); 1464 efl_domain_current_pop();
1406 1465
1407 fail_if(efl_compatible(objs, obj) == EINA_TRUE); 1466 fail_if(efl_compatible(objs, obj) == EINA_TRUE);
@@ -1412,6 +1471,19 @@ START_TEST(eo_domain)
1412 domain_a_set(objs, 1234); 1471 domain_a_set(objs, 1234);
1413 fail_if(domain_a_get(objs) != 1234); 1472 fail_if(domain_a_get(objs) != 1234);
1414 1473
1474 Eina_Thread t;
1475 Data data;
1476 data.obj = obj;
1477 data.objs = objs;
1478 printf("GET DOMAIN DATA\n");
1479 data.dat = efl_domain_data_get();
1480 fail_if(data.dat == NULL);
1481 printf("THR CREATE\n");
1482 fail_if(!eina_thread_create(&t, EINA_THREAD_NORMAL, -1, thr1, &data));
1483 printf("JOIN\n");
1484 eina_thread_join(t);
1485 printf("JOIN DONE\n");
1486
1415 efl_del(obj); 1487 efl_del(obj);
1416 efl_del(objs); 1488 efl_del(objs);
1417 1489