summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/ecore/ecore_suite.c1
-rw-r--r--src/tests/ecore/ecore_suite.h1
-rw-r--r--src/tests/ecore/ecore_test_coroutine.c86
3 files changed, 0 insertions, 88 deletions
diff --git a/src/tests/ecore/ecore_suite.c b/src/tests/ecore/ecore_suite.c
index e9e737069a..7119d7df81 100644
--- a/src/tests/ecore/ecore_suite.c
+++ b/src/tests/ecore/ecore_suite.c
@@ -25,7 +25,6 @@ static const Ecore_Test_Case etc[] = {
25#if HAVE_ECORE_AUDIO 25#if HAVE_ECORE_AUDIO
26 { "Ecore Audio", ecore_test_ecore_audio}, 26 { "Ecore Audio", ecore_test_ecore_audio},
27#endif 27#endif
28 { "Ecore_Coroutine", ecore_test_coroutine },
29 { "Ecore_Timers", ecore_test_timer }, 28 { "Ecore_Timers", ecore_test_timer },
30 { "Ecore_Evas", ecore_test_ecore_evas }, 29 { "Ecore_Evas", ecore_test_ecore_evas },
31 { "Ecore_Animators", ecore_test_animator }, 30 { "Ecore_Animators", ecore_test_animator },
diff --git a/src/tests/ecore/ecore_suite.h b/src/tests/ecore/ecore_suite.h
index 03f13ef440..4514733c4d 100644
--- a/src/tests/ecore/ecore_suite.h
+++ b/src/tests/ecore/ecore_suite.h
@@ -8,7 +8,6 @@ void ecore_test_ecore_con(TCase *tc);
8void ecore_test_ecore_x(TCase *tc); 8void ecore_test_ecore_x(TCase *tc);
9void ecore_test_ecore_imf(TCase *tc); 9void ecore_test_ecore_imf(TCase *tc);
10void ecore_test_ecore_audio(TCase *tc); 10void ecore_test_ecore_audio(TCase *tc);
11void ecore_test_coroutine(TCase *tc);
12void ecore_test_timer(TCase *tc); 11void ecore_test_timer(TCase *tc);
13void ecore_test_ecore_evas(TCase *tc); 12void ecore_test_ecore_evas(TCase *tc);
14void ecore_test_animator(TCase *tc); 13void ecore_test_animator(TCase *tc);
diff --git a/src/tests/ecore/ecore_test_coroutine.c b/src/tests/ecore/ecore_test_coroutine.c
deleted file mode 100644
index 8d807375be..0000000000
--- a/src/tests/ecore/ecore_test_coroutine.c
+++ /dev/null
@@ -1,86 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdio.h>
6#include <unistd.h>
7
8#include <Eina.h>
9#include <Ecore.h>
10
11#include "ecore_suite.h"
12
13typedef struct _Ecore_Coroutine_Test Ecore_Coroutine_Test;
14struct _Ecore_Coroutine_Test
15{
16 unsigned int v;
17 unsigned int s;
18};
19
20static Ecore_Coroutine_Test t1;
21
22static int
23_ecore_test_v1(void *data, Ecore_Coroutine *coro)
24{
25 int *t = data;
26
27 ecore_coroutine_yield(coro, 7);
28 t1.v = *t;
29 ecore_coroutine_yield(coro, 42);
30 t1.s = *t;
31
32 return 0xDEADBEEF;
33}
34
35static int
36_ecore_test_v2(void *data, Ecore_Coroutine *coro EINA_UNUSED)
37{
38 int *t = data;
39
40 ecore_coroutine_yield(coro, 42);
41 t1.v = *t;
42 ecore_coroutine_yield(coro, 7);
43 t1.s = *t;
44
45 return 0xDEADBEEF;
46}
47
48START_TEST(ecore_test_coroutine_simple)
49{
50 Ecore_Coroutine *coro1;
51 Ecore_Coroutine *coro2;
52 unsigned int value[] = { 7, 42, 0xDEADBEEF };
53
54 ecore_init();
55
56 t1.v = 0xDEADBEEF; t1.s = 0xDEADBEEF;
57
58 coro1 = ecore_coroutine_add(0, _ecore_test_v1, &value[0]);
59 coro2 = ecore_coroutine_add(4*1024*1024, _ecore_test_v2, &value[1]);
60
61 fail_if(ecore_coroutine_state_get(coro1) != ECORE_COROUTINE_NEW);
62 fail_if(ecore_coroutine_resume(coro1) != 7);
63 fail_if(t1.v != 0xDEADBEEF || t1.s != 0xDEADBEEF);
64 fail_if(ecore_coroutine_resume(coro2) != 42);
65 fail_if(t1.v != 0xDEADBEEF || t1.s != 0xDEADBEEF);
66 fail_if(ecore_coroutine_resume(coro1) != 42);
67 fail_if(t1.v != value[0] || t1.s != 0xDEADBEEF);
68 fail_if((unsigned int) ecore_coroutine_resume(coro1) != 0xDEADBEEF);
69 fail_if(t1.v != value[0] || t1.s != value[0]);
70 fail_if(ecore_coroutine_resume(coro2) != 7);
71 fail_if(t1.v != value[1] || t1.s != value[0]);
72 fail_if((unsigned int) ecore_coroutine_resume(coro2) != 0xDEADBEEF);
73 fail_if(t1.v != value[1] || t1.s != value[1]);
74 fail_if(ecore_coroutine_state_get(coro2) != ECORE_COROUTINE_FINISHED);
75
76 fail_if(ecore_coroutine_del(coro1) != &value[0]);
77 fail_if(ecore_coroutine_del(coro2) != &value[1]);
78
79 ecore_shutdown();
80}
81END_TEST
82
83void ecore_test_coroutine(TCase *tc)
84{
85 tcase_add_test(tc, ecore_test_coroutine_simple);
86}