summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore_imf.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 17:19:43 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 17:19:43 +0000
commit733425c62c7b9a23ad465b5b9700612fae3ee356 (patch)
treefdc2f4e310d964cb96fa56a73d66fdba246d06b8 /src/tests/ecore/ecore_test_ecore_imf.c
parent365a4acf97c59470c317a3e80d7586efe9344bb5 (diff)
efl: make libraries aware of EFL_RUN_IN_TREE.
this variable tells that the build is being done in tree and we should not look at install locations. SVN revision: 82217
Diffstat (limited to 'src/tests/ecore/ecore_test_ecore_imf.c')
-rw-r--r--src/tests/ecore/ecore_test_ecore_imf.c85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_imf.c b/src/tests/ecore/ecore_test_ecore_imf.c
new file mode 100644
index 0000000..84deafc
--- /dev/null
+++ b/src/tests/ecore/ecore_test_ecore_imf.c
@@ -0,0 +1,85 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Ecore_IMF.h>
6
7#include "ecore_suite.h"
8
9START_TEST(ecore_test_ecore_imf_init)
10{
11 ecore_imf_init();
12 ecore_imf_shutdown();
13}
14END_TEST
15
16static const char *built_modules[] = {
17#ifdef ENABLE_XIM
18 "xim",
19#endif
20#ifdef BUILD_ECORE_IMF_IBUS
21 "ibus",
22#endif
23#ifdef BUILD_ECORE_IMF_SCIM
24 "scim",
25#endif
26 NULL
27};
28
29static Eina_Bool
30_find_list(const Eina_List *lst, const char *item)
31{
32 const Eina_List *n;
33 const char *s;
34 EINA_LIST_FOREACH(lst, n, s)
35 {
36 if (strcmp(s, item) == 0)
37 return EINA_TRUE;
38 }
39 return EINA_FALSE;
40}
41
42START_TEST(ecore_test_ecore_imf_modules)
43{
44 Eina_List *modules;
45 const char **itr;
46
47 ecore_imf_init();
48 modules = ecore_imf_context_available_ids_get();
49
50 for (itr = built_modules; *itr != NULL; itr++)
51 {
52 Eina_Bool found = _find_list(modules, *itr);
53 fail_if(!found, "imf module should be built, but was not found: %s",
54 *itr);
55 }
56
57 eina_list_free(modules);
58 ecore_imf_shutdown();
59}
60END_TEST
61
62START_TEST(ecore_test_ecore_imf_modules_load)
63{
64 Eina_List *modules;
65 const char **itr;
66
67 ecore_imf_init();
68
69 for (itr = built_modules; *itr != NULL; itr++)
70 {
71 Ecore_IMF_Context *ctx = ecore_imf_context_add(*itr);
72 fail_if(ctx == NULL, "could not add imf context: %s", *itr);
73 ecore_imf_context_del(ctx);
74 }
75
76 ecore_imf_shutdown();
77}
78END_TEST
79
80void ecore_test_ecore_imf(TCase *tc)
81{
82 tcase_add_test(tc, ecore_test_ecore_imf_init);
83 tcase_add_test(tc, ecore_test_ecore_imf_modules);
84 tcase_add_test(tc, ecore_test_ecore_imf_modules_load);
85}