ecore-fb: Adding test suite for ecore_fb

Summary:
Added test suite for ecore_fb with test for ecore_fb_init
w
Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1594
This commit is contained in:
vivek 2014-10-29 08:14:26 -04:00 committed by Chris Michael
parent dfdc31cae7
commit f59ddff4e2
4 changed files with 51 additions and 2 deletions

View File

@ -192,7 +192,8 @@ tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
@ECORE_EVAS_CFLAGS@ \
@ECORE_WAYLAND_CFLAGS@ \
@ECORE_WAYLAND_SRV_CFLAGS@ \
@ECORE_DRM_CFLAGS@
@ECORE_DRM_CFLAGS@ \
@ECORE_FB_CFLAGS@
tests_ecore_ecore_suite_LDADD = \
@CHECK_LIBS@ \
@ -204,8 +205,10 @@ tests_ecore_ecore_suite_LDADD = \
@USE_ECORE_IMF_LIBS@ \
@USE_ECORE_EVAS_LIBS@ \
@USE_ECORE_WAYLAND_LIBS@ \
@USE_ECORE_FB_LIBS@ \
@ECORE_WAYLAND_SRV_LIBS@ \
@ECORE_DRM_LIBS@
tests_ecore_ecore_suite_DEPENDENCIES = \
@USE_ECORE_INTERNAL_LIBS@ \
@USE_ECORE_AUDIO_INTERNAL_LIBS@ \
@ -215,7 +218,8 @@ tests_ecore_ecore_suite_DEPENDENCIES = \
@USE_ECORE_IMF_INTERNAL_LIBS@ \
@USE_ECORE_EVAS_INTERNAL_LIBS@ \
@USE_ECORE_WAYLAND_INTERNAL_LIBS@ \
@USE_ECORE_DRM_INTERNAL_LIBS@
@USE_ECORE_DRM_INTERNAL_LIBS@ \
@USE_ECORE_FB_INTERNAL_LIBS@
if HAVE_ECORE_AUDIO
tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_audio.c
@ -229,6 +233,10 @@ if HAVE_ECORE_DRM
tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_drm.c
endif
if HAVE_ECORE_FB
tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_fb.c
endif
endif
EXTRA_DIST += \

View File

@ -35,6 +35,9 @@ static const Ecore_Test_Case etc[] = {
#endif
#if HAVE_ECORE_DRM
{ "Ecore_Drm", ecore_test_ecore_drm },
#endif
#if HAVE_ECORE_FB
{ "Ecore_Fb", ecore_test_ecore_fb },
#endif
{ NULL, NULL }
};

View File

@ -15,5 +15,6 @@ void ecore_test_animator(TCase *tc);
void ecore_test_ecore_thread_eina_thread_queue(TCase *tc);
void ecore_test_ecore_wayland(TCase *tc);
void ecore_test_ecore_drm(TCase *tc);
void ecore_test_ecore_fb(TCase *tc);
#endif /* _ECORE_SUITE_H */

View File

@ -0,0 +1,37 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <unistd.h>
#include <Ecore_Fb.h>
#include "ecore_suite.h"
#define MAX_ITER 10
START_TEST(ecore_test_ecore_fb_init)
{
int ret, i, j;
for (i = 1; i <= MAX_ITER; i++)
{
ret = ecore_fb_init("display");
fprintf(stderr, "Created %d ecore fb instance.\n", i);
fail_if(ret != i);
}
for (j = MAX_ITER - 1; j >= 0; j--)
{
ret = ecore_fb_shutdown();
fprintf(stderr, "Deleted %d ecore fb instance.\n", MAX_ITER - j);
fail_if(ret != j);
}
}
END_TEST
void ecore_test_ecore_fb(TCase *tc)
{
tcase_add_test(tc, ecore_test_ecore_fb_init);
}