bb33374550a1780fa7946531030aa0b3be522b7f
[platform/upstream/efl.git] / src / tests / ecore / ecore_test_ecore_x.c
1 #ifdef HAVE_CONFIG_H
2 # include <config.h>
3 #endif
4
5 #include <Eina.h>
6
7 #include "ecore_suite.h"
8
9 /* FIXME: Currently disable these tests. They are useless ATM and they just
10  * make buildbot complain. Once we add useful tests here we'll also bother
11  * with getting X on the server. */
12 #undef HAVE_ECORE_X_XLIB
13
14 /* TODO: change to HAVE_ECORE_X when xcb implementation is done */
15 #ifdef HAVE_ECORE_X_XLIB
16
17 #include <Ecore_X.h>
18
19 START_TEST(ecore_test_ecore_x_init)
20 {
21    int ret;
22
23    ret = ecore_x_init(NULL);
24    fail_if(ret != 1);
25
26    ret = ecore_x_shutdown();
27    fail_if(ret != 0);
28 }
29 END_TEST
30
31 START_TEST(ecore_test_ecore_x_bell)
32 {
33    int i;
34    int ret;
35
36    ret = ecore_x_init(NULL);
37    fail_if(ret != 1);
38
39    printf("You should hear 3 beeps now.\n");
40    for (i = 0; i < 3; i++)
41      {
42         ret = ecore_x_bell(0);
43         fail_if(ret != EINA_TRUE);
44         ecore_x_sync();
45         sleep(1);
46      }
47
48    ecore_x_shutdown();
49 }
50 END_TEST
51
52 #endif
53
54 void ecore_test_ecore_x(TCase *tc EINA_UNUSED)
55 {
56
57 /* TODO: change to HAVE_ECORE_X when xcb implementation is done */
58 #ifdef HAVE_ECORE_X_XLIB
59    tcase_add_test(tc, ecore_test_ecore_x_init);
60    tcase_add_test(tc, ecore_test_ecore_x_bell);
61 #endif
62 }