summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/tests/ecore_test_ecore_x.c
blob: 4b9e126a187402d4814a2f8d717284d9f6661b38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <Ecore_X.h>

#include "ecore_suite.h"


/* TODO: change to HAVE_ECORE_X when xcb implementation is done */
#ifdef HAVE_ECORE_X_XLIB

START_TEST(ecore_test_ecore_x_init)
{
   int ret;

   ret = ecore_x_init(NULL);
   fail_if(ret != 1);

   ret = ecore_x_shutdown();
   fail_if(ret != 0);
}
END_TEST

START_TEST(ecore_test_ecore_x_bell)
{
   int i;
   int ret;

   ret = ecore_x_init(NULL);
   fail_if(ret != 1);

   printf("You should hear 3 beeps now.\n");
   for (i = 0; i < 3; i++)
     {
	ret = ecore_x_bell(0);
	fail_if(ret != EINA_TRUE);
	ecore_x_sync();
	sleep(1);
     }

   ecore_x_shutdown();
}
END_TEST

#endif

void ecore_test_ecore_x(TCase *tc)
{

/* TODO: change to HAVE_ECORE_X when xcb implementation is done */
#ifdef HAVE_ECORE_X_XLIB
   tcase_add_test(tc, ecore_test_ecore_x_init);
   tcase_add_test(tc, ecore_test_ecore_x_bell);
#endif
}