summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-04-09 13:37:00 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2018-04-10 11:28:01 +0200
commite02598cd4e0d040af7d35cd71a98a8710141324c (patch)
tree0e82bd6eab9db7041f9e062b016f1bba8711f43a
parentab8237d36d2359bd073a887b00c5db175152d54d (diff)
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
-rw-r--r--src/Makefile_Ecore.am1
-rw-r--r--src/tests/ecore/efl_app_suite.c37
-rw-r--r--src/tests/ecore/efl_app_suite.h1
-rw-r--r--src/tests/ecore/efl_app_test_loop.c49
4 files changed, 53 insertions, 35 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index c49b6ea1bf..3430ce196a 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -329,6 +329,7 @@ tests_ecore_ecore_suite_DEPENDENCIES = \
329@USE_ECORE_INPUT_INTERNAL_LIBS@ 329@USE_ECORE_INPUT_INTERNAL_LIBS@
330 330
331tests_ecore_efl_app_suite_SOURCES = \ 331tests_ecore_efl_app_suite_SOURCES = \
332tests/ecore/efl_app_test_loop.c \
332tests/ecore/efl_app_suite.c \ 333tests/ecore/efl_app_suite.c \
333tests/ecore/efl_app_suite.h 334tests/ecore/efl_app_suite.h
334 335
diff --git a/src/tests/ecore/efl_app_suite.c b/src/tests/ecore/efl_app_suite.c
index 93c972323f..1618120f46 100644
--- a/src/tests/ecore/efl_app_suite.c
+++ b/src/tests/ecore/efl_app_suite.c
@@ -10,38 +10,6 @@
10#include "efl_app_suite.h" 10#include "efl_app_suite.h"
11#include "../efl_check.h" 11#include "../efl_check.h"
12 12
13EFL_START_TEST(efl_app_test_efl_loop_register)
14{
15 Efl_Object *t, *n;
16
17 ecore_init();
18
19 t = efl_provider_find(efl_app_get(), EFL_LOOP_CLASS);
20 fail_if(!efl_isa(t, EFL_LOOP_CLASS));
21 fail_if(!efl_isa(t, EFL_APP_CLASS));
22
23 t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
24 fail_if(t != NULL);
25
26 n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get());
27 fail_if(n != NULL);
28
29 n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get(),
30 efl_loop_timer_interval_set(efl_added, 1.0));
31 efl_loop_register(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);
32
33 t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
34 fail_if(!efl_isa(t, EFL_LOOP_TIMER_CLASS));
35 fail_if(t != n);
36
37 efl_loop_unregister(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);
38
39 t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
40 fail_if(t != NULL);
41
42 ecore_shutdown();
43}
44EFL_END_TEST
45 13
46EFL_START_TEST(efl_app_test_efl_build_version) 14EFL_START_TEST(efl_app_test_efl_build_version)
47{ 15{
@@ -74,13 +42,12 @@ EFL_END_TEST
74 42
75void efl_test_efl_app(TCase *tc) 43void efl_test_efl_app(TCase *tc)
76{ 44{
77 tcase_add_test(tc, efl_app_test_efl_loop_register);
78 tcase_add_test(tc, efl_app_test_efl_build_version); 45 tcase_add_test(tc, efl_app_test_efl_build_version);
79} 46}
80 47
81
82static const Efl_Test_Case etc[] = { 48static const Efl_Test_Case etc[] = {
83 { "Efl_App", efl_test_efl_app }, 49 { "App", efl_test_efl_app },
50 { "Loop", efl_app_test_efl_loop },
84 { NULL, NULL } 51 { NULL, NULL }
85}; 52};
86 53
diff --git a/src/tests/ecore/efl_app_suite.h b/src/tests/ecore/efl_app_suite.h
index 5309a79657..ae273c0a76 100644
--- a/src/tests/ecore/efl_app_suite.h
+++ b/src/tests/ecore/efl_app_suite.h
@@ -4,5 +4,6 @@
4#include <check.h> 4#include <check.h>
5#include "../efl_check.h" 5#include "../efl_check.h"
6void efl_app_test_efl_app(TCase *tc); 6void efl_app_test_efl_app(TCase *tc);
7void efl_app_test_efl_loop(TCase *tc);
7 8
8#endif /* _EFL_APP_SUITE_H */ 9#endif /* _EFL_APP_SUITE_H */
diff --git a/src/tests/ecore/efl_app_test_loop.c b/src/tests/ecore/efl_app_test_loop.c
new file mode 100644
index 0000000000..ddf0724449
--- /dev/null
+++ b/src/tests/ecore/efl_app_test_loop.c
@@ -0,0 +1,49 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdio.h>
6#include <unistd.h>
7#define EFL_NOLEGACY_API_SUPPORT
8#include <Efl_Core.h>
9#include <Efl_Net.h>
10#include "efl_app_suite.h"
11#include "../efl_check.h"
12
13EFL_START_TEST(efl_app_test_efl_loop_register)
14{
15 Efl_Object *t, *n;
16
17 ecore_init();
18
19 t = efl_provider_find(efl_app_get(), EFL_LOOP_CLASS);
20 fail_if(!efl_isa(t, EFL_LOOP_CLASS));
21 fail_if(!efl_isa(t, EFL_APP_CLASS));
22
23 t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
24 fail_if(t != NULL);
25
26 n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get());
27 fail_if(n != NULL);
28
29 n = efl_add(EFL_LOOP_TIMER_CLASS, efl_app_get(),
30 efl_loop_timer_interval_set(efl_added, 1.0));
31 efl_loop_register(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);
32
33 t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
34 fail_if(!efl_isa(t, EFL_LOOP_TIMER_CLASS));
35 fail_if(t != n);
36
37 efl_loop_unregister(efl_app_get(), EFL_LOOP_TIMER_CLASS, n);
38
39 t = efl_provider_find(efl_app_get(), EFL_LOOP_TIMER_CLASS);
40 fail_if(t != NULL);
41
42 ecore_shutdown();
43}
44EFL_END_TEST
45
46void efl_app_test_efl_loop(TCase *tc)
47{
48 tcase_add_test(tc, efl_app_test_efl_loop_register);
49}