diff --git a/legacy/ecore/src/tests/Makefile.am b/legacy/ecore/src/tests/Makefile.am index 60ec31da87..dbec564d40 100644 --- a/legacy/ecore/src/tests/Makefile.am +++ b/legacy/ecore/src/tests/Makefile.am @@ -3,6 +3,7 @@ MAINTAINERCLEANFILES = Makefile.in AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib/ecore \ -I$(top_srcdir)/src/lib/ecore_con \ +-I$(top_srcdir)/src/lib/ecore_x \ @EINA_CFLAGS@ \ @CHECK_CFLAGS@ @@ -15,7 +16,8 @@ check_PROGRAMS = ecore_suite ecore_suite_SOURCES = \ ecore_suite.c \ ecore_test_ecore.c \ -ecore_test_ecore_con.c +ecore_test_ecore_con.c \ +ecore_test_ecore_x.c ecore_suite_LDADD = \ @CHECK_LIBS@ \ diff --git a/legacy/ecore/src/tests/ecore_suite.c b/legacy/ecore/src/tests/ecore_suite.c index 8f5ad266aa..9c76b4d6df 100644 --- a/legacy/ecore/src/tests/ecore_suite.c +++ b/legacy/ecore/src/tests/ecore_suite.c @@ -20,6 +20,7 @@ struct _Ecore_Test_Case static const Ecore_Test_Case etc[] = { { "Ecore", ecore_test_ecore }, { "Ecore_Con", ecore_test_ecore_con }, + { "Ecore_X", ecore_test_ecore_x }, { NULL, NULL } }; diff --git a/legacy/ecore/src/tests/ecore_suite.h b/legacy/ecore/src/tests/ecore_suite.h index 2e35ee7b7c..0c7dfef8d5 100644 --- a/legacy/ecore/src/tests/ecore_suite.h +++ b/legacy/ecore/src/tests/ecore_suite.h @@ -5,6 +5,7 @@ void ecore_test_ecore(TCase *tc); void ecore_test_ecore_con(TCase *tc); +void ecore_test_ecore_x(TCase *tc); #endif /* _ECORE_SUITE_H */ diff --git a/legacy/ecore/src/tests/ecore_test_ecore.c b/legacy/ecore/src/tests/ecore_test_ecore.c index 16c2c4c46d..1409db388d 100644 --- a/legacy/ecore/src/tests/ecore_test_ecore.c +++ b/legacy/ecore/src/tests/ecore_test_ecore.c @@ -351,31 +351,6 @@ START_TEST(ecore_test_ecore_main_loop_event_recursive) } END_TEST -/* TODO: change to HAVE_ECORE_X when xcb implementation is done */ -#ifdef HAVE_ECORE_X_XLIB - -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(TCase *tc) { tcase_add_test(tc, ecore_test_ecore_init); @@ -388,9 +363,4 @@ void ecore_test_ecore(TCase *tc) tcase_add_test(tc, ecore_test_ecore_main_loop_event); tcase_add_test(tc, ecore_test_ecore_main_loop_timer_inner); tcase_add_test(tc, ecore_test_ecore_main_loop_event_recursive); - -/* TODO: change to HAVE_ECORE_X when xcb implementation is done */ -#ifdef HAVE_ECORE_X_XLIB - tcase_add_test(tc, ecore_test_ecore_x_bell); -#endif } diff --git a/legacy/ecore/src/tests/ecore_test_ecore_x.c b/legacy/ecore/src/tests/ecore_test_ecore_x.c new file mode 100644 index 0000000000..4b9e126a18 --- /dev/null +++ b/legacy/ecore/src/tests/ecore_test_ecore_x.c @@ -0,0 +1,56 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#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 +}