diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/tests/ecore_test_ecore_x.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/libraries/ecore/src/tests/ecore_test_ecore_x.c b/libraries/ecore/src/tests/ecore_test_ecore_x.c new file mode 100644 index 0000000..4b9e126 --- /dev/null +++ b/libraries/ecore/src/tests/ecore_test_ecore_x.c | |||
@@ -0,0 +1,56 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif | ||
4 | |||
5 | #include <Ecore_X.h> | ||
6 | |||
7 | #include "ecore_suite.h" | ||
8 | |||
9 | |||
10 | /* TODO: change to HAVE_ECORE_X when xcb implementation is done */ | ||
11 | #ifdef HAVE_ECORE_X_XLIB | ||
12 | |||
13 | START_TEST(ecore_test_ecore_x_init) | ||
14 | { | ||
15 | int ret; | ||
16 | |||
17 | ret = ecore_x_init(NULL); | ||
18 | fail_if(ret != 1); | ||
19 | |||
20 | ret = ecore_x_shutdown(); | ||
21 | fail_if(ret != 0); | ||
22 | } | ||
23 | END_TEST | ||
24 | |||
25 | START_TEST(ecore_test_ecore_x_bell) | ||
26 | { | ||
27 | int i; | ||
28 | int ret; | ||
29 | |||
30 | ret = ecore_x_init(NULL); | ||
31 | fail_if(ret != 1); | ||
32 | |||
33 | printf("You should hear 3 beeps now.\n"); | ||
34 | for (i = 0; i < 3; i++) | ||
35 | { | ||
36 | ret = ecore_x_bell(0); | ||
37 | fail_if(ret != EINA_TRUE); | ||
38 | ecore_x_sync(); | ||
39 | sleep(1); | ||
40 | } | ||
41 | |||
42 | ecore_x_shutdown(); | ||
43 | } | ||
44 | END_TEST | ||
45 | |||
46 | #endif | ||
47 | |||
48 | void ecore_test_ecore_x(TCase *tc) | ||
49 | { | ||
50 | |||
51 | /* TODO: change to HAVE_ECORE_X when xcb implementation is done */ | ||
52 | #ifdef HAVE_ECORE_X_XLIB | ||
53 | tcase_add_test(tc, ecore_test_ecore_x_init); | ||
54 | tcase_add_test(tc, ecore_test_ecore_x_bell); | ||
55 | #endif | ||
56 | } | ||