tests: split efl_loop tests out of efl_app_suite.c

Summary: Depends on D5894

Reviewers: stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5895
This commit is contained in:
Mike Blumenkrantz 2018-04-09 13:37:00 +02:00 committed by Stefan Schmidt
parent ab8237d36d
commit e02598cd4e
4 changed files with 53 additions and 35 deletions

View File

@ -329,6 +329,7 @@ tests_ecore_ecore_suite_DEPENDENCIES = \
@USE_ECORE_INPUT_INTERNAL_LIBS@
tests_ecore_efl_app_suite_SOURCES = \
tests/ecore/efl_app_test_loop.c \
tests/ecore/efl_app_suite.c \
tests/ecore/efl_app_suite.h

View File

@ -10,38 +10,6 @@
#include "efl_app_suite.h"
#include "../efl_check.h"
EFL_START_TEST(efl_app_test_efl_loop_register)
{
Efl_Object *t, *n;
ecore_init();
t = efl_provider_find(efl_app_get(), EFL_LOOP_CLASS);
fail_if(!efl_isa(t, EFL_LOOP_CLASS));
fail_if(!efl_isa(t, EFL_APP_CLASS));
t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
fail_if(t != NULL);
n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get());
fail_if(n != NULL);
n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get(),
efl_loop_timer_interval_set(efl_added, 1.0));
efl_loop_register(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);
t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
fail_if(!efl_isa(t, EFL_LOOP_TIMER_CLASS));
fail_if(t != n);
efl_loop_unregister(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);
t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
fail_if(t != NULL);
ecore_shutdown();
}
EFL_END_TEST
EFL_START_TEST(efl_app_test_efl_build_version)
{
@ -74,13 +42,12 @@ EFL_END_TEST
void efl_test_efl_app(TCase *tc)
{
tcase_add_test(tc, efl_app_test_efl_loop_register);
tcase_add_test(tc, efl_app_test_efl_build_version);
}
static const Efl_Test_Case etc[] = {
{ "Efl_App", efl_test_efl_app },
{ "App", efl_test_efl_app },
{ "Loop", efl_app_test_efl_loop },
{ NULL, NULL }
};

View File

@ -4,5 +4,6 @@
#include <check.h>
#include "../efl_check.h"
void efl_app_test_efl_app(TCase *tc);
void efl_app_test_efl_loop(TCase *tc);
#endif /* _EFL_APP_SUITE_H */

View File

@ -0,0 +1,49 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <unistd.h>
#define EFL_NOLEGACY_API_SUPPORT
#include <Efl_Core.h>
#include <Efl_Net.h>
#include "efl_app_suite.h"
#include "../efl_check.h"
EFL_START_TEST(efl_app_test_efl_loop_register)
{
Efl_Object *t, *n;
ecore_init();
t = efl_provider_find(efl_app_get(), EFL_LOOP_CLASS);
fail_if(!efl_isa(t, EFL_LOOP_CLASS));
fail_if(!efl_isa(t, EFL_APP_CLASS));
t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
fail_if(t != NULL);
n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get());
fail_if(n != NULL);
n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get(),
efl_loop_timer_interval_set(efl_added, 1.0));
efl_loop_register(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);
t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
fail_if(!efl_isa(t, EFL_LOOP_TIMER_CLASS));
fail_if(t != n);
efl_loop_unregister(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);
t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
fail_if(t != NULL);
ecore_shutdown();
}
EFL_END_TEST
void efl_app_test_efl_loop(TCase *tc)
{
tcase_add_test(tc, efl_app_test_efl_loop_register);
}