summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-03 18:56:11 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-03 18:56:11 -0200
commitff27c7b1cefbe43c90299871464ca1fd3ae157c2 (patch)
treefa2686b6ec300d646337927af334d972f43b05a3
parent308b29c3203d711474f1e7cd6b61ae96827d3e5e (diff)
ecordova: Reorganization
-rw-r--r--configure.ac25
-rw-r--r--src/lib/ecordova/ecordova_main.c122
-rw-r--r--src/modules/ecordova/linux/ecordova_linux.c27
-rw-r--r--src/modules/ecordova/tizen/ecordova_contact.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactaddress.c4
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactfield.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactname.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_contactorganization.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_contacts.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_contacts_record_utils.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_device.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_devicemotion.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_deviceorientation.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_geolocation.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_globalization.c2
-rw-r--r--src/modules/ecordova/tizen/ecordova_tizen.c4
-rw-r--r--src/tests/ecordova/ecordova_batterystatus_test.c21
-rw-r--r--src/tests/ecordova/ecordova_batterystatus_test.h9
-rw-r--r--src/tests/ecordova/ecordova_console_test.c3
-rw-r--r--src/tests/ecordova/ecordova_console_test.h9
-rw-r--r--src/tests/ecordova/ecordova_contacts_test.c47
-rw-r--r--src/tests/ecordova/ecordova_contacts_test.h9
-rw-r--r--src/tests/ecordova/ecordova_device_test.c21
-rw-r--r--src/tests/ecordova/ecordova_device_test.h9
-rw-r--r--src/tests/ecordova/ecordova_devicemotion_test.c26
-rw-r--r--src/tests/ecordova/ecordova_devicemotion_test.h9
-rw-r--r--src/tests/ecordova/ecordova_deviceorientation_test.c22
-rw-r--r--src/tests/ecordova/ecordova_deviceorientation_test.h9
-rw-r--r--src/tests/ecordova/ecordova_directoryentry_test.c3
-rw-r--r--src/tests/ecordova/ecordova_directoryreader_test.c3
-rw-r--r--src/tests/ecordova/ecordova_directoryreader_test.h9
-rw-r--r--src/tests/ecordova/ecordova_entry_test.c3
-rw-r--r--src/tests/ecordova/ecordova_entry_test.h14
-rw-r--r--src/tests/ecordova/ecordova_file_test.c2
-rw-r--r--src/tests/ecordova/ecordova_file_test.h9
-rw-r--r--src/tests/ecordova/ecordova_file_tests.h (renamed from src/tests/ecordova/ecordova_directoryentry_test.h)16
-rw-r--r--src/tests/ecordova/ecordova_fileentry_test.c4
-rw-r--r--src/tests/ecordova/ecordova_fileentry_test.h17
-rw-r--r--src/tests/ecordova/ecordova_filereader_test.c5
-rw-r--r--src/tests/ecordova/ecordova_filereader_test.h13
-rw-r--r--src/tests/ecordova/ecordova_filetransfer_test.c6
-rw-r--r--src/tests/ecordova/ecordova_filetransfer_test.h9
-rw-r--r--src/tests/ecordova/ecordova_filewriter_test.c6
-rw-r--r--src/tests/ecordova/ecordova_filewriter_test.h9
-rw-r--r--src/tests/ecordova/ecordova_geolocation_test.c21
-rw-r--r--src/tests/ecordova/ecordova_geolocation_test.h9
-rw-r--r--src/tests/ecordova/ecordova_globalization_test.c21
-rw-r--r--src/tests/ecordova/ecordova_globalization_test.h9
-rw-r--r--src/tests/ecordova/ecordova_media_test.c23
-rw-r--r--src/tests/ecordova/ecordova_media_test.h9
-rw-r--r--src/tests/ecordova/ecordova_mediafile_test.c3
-rw-r--r--src/tests/ecordova/ecordova_mediafile_test.h12
-rw-r--r--src/tests/ecordova/ecordova_networkinformation_test.c23
-rw-r--r--src/tests/ecordova/ecordova_networkinformation_test.h9
-rw-r--r--src/tests/ecordova/ecordova_suite.c56
-rw-r--r--src/tests/ecordova/ecordova_vibration_test.c23
-rw-r--r--src/tests/ecordova/ecordova_vibration_test.h9
57 files changed, 424 insertions, 329 deletions
diff --git a/configure.ac b/configure.ac
index 1af2baf072..2d291f8ef9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4598,20 +4598,17 @@ EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [eina])
4598EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [eo]) 4598EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [eo])
4599EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [efl]) 4599EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [efl])
4600EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [ecore]) 4600EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [ecore])
4601#EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [ecore-evas]) 4601
4602#EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [ecore-file]) 4602EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_CONTACTS_SERVICE], [contacts-service2])
4603 4603EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_INFO], [capi-system-info])
4604#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_VCONF], [vconf]) 4604EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_SENSOR], [capi-system-sensor])
4605#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_CONTACTS_SERVICE], [contacts-service2]) 4605EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_LOCATION_MANAGER], [capi-location-manager])
4606#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_INFO], [capi-system-info]) 4606EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_HAPTIC], [capi-system-haptic])
4607#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_SENSOR], [capi-system-sensor]) 4607EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_NETWORK_CONNECTION], [capi-network-connection])
4608#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_LOCATION_MANAGER], [capi-location-manager]) 4608EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_METADATA_EXTRACTOR], [capi-media-metadata-extractor])
4609#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_HAPTIC], [capi-system-haptic]) 4609EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_PLAYER], [capi-media-player])
4610#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_NETWORK_CONNECTION], [capi-network-connection]) 4610EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_RECORDER], [capi-media-recorder])
4611#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_METADATA_EXTRACTOR], [capi-media-metadata-extractor]) 4611EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_BASE_UTILS_I18N], [capi-base-utils-i18n])
4612#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_PLAYER], [capi-media-player])
4613#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_RECORDER], [capi-media-recorder])
4614#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_BASE_UTILS_I18N], [capi-base-utils-i18n])
4615 4612
4616#EFL_ADD_LIBS([ECORDOVA], [-lm]) 4613#EFL_ADD_LIBS([ECORDOVA], [-lm])
4617 4614
diff --git a/src/lib/ecordova/ecordova_main.c b/src/lib/ecordova/ecordova_main.c
index 043a601406..cab4dea656 100644
--- a/src/lib/ecordova/ecordova_main.c
+++ b/src/lib/ecordova/ecordova_main.c
@@ -3,7 +3,6 @@
3#endif 3#endif
4 4
5#include "ecordova_private.h" 5#include "ecordova_private.h"
6/* #include "ecordova_systeminfo.eo.h" */
7 6
8#include <unistd.h> 7#include <unistd.h>
9#include <dlfcn.h> 8#include <dlfcn.h>
@@ -75,29 +74,9 @@ ecordova_init(void)
75 if (!eo_init()) 74 if (!eo_init())
76 { 75 {
77 ERR("Unable to initialize ecore"); 76 ERR("Unable to initialize ecore");
78 goto on_error_2; 77 goto on_error_3;
79 } 78 }
80 79
81 /* if (!ecore_file_init()) */
82 /* { */
83 /* ERR("Unable to initialize ecore_file"); */
84 /* goto on_error_3; */
85 /* } */
86
87 /* if (!eio_init()) */
88 /* { */
89 /* ERR("Unable to initialize eio"); */
90 /* goto on_error_4; */
91 /* } */
92
93 /* _ecordova_systeminfo = eo_add(ECORDOVA_SYSTEMINFO_CLASS, NULL, */
94 /* ecordova_systeminfo_constructor()); */
95 /* if (!_ecordova_systeminfo) */
96 /* { */
97 /* ERR("Unable to initialize systeminfo service"); */
98 /* goto on_error_4; */
99 /* } */
100
101 _ecordova_pfx = eina_prefix_new(NULL, ecordova_init, 80 _ecordova_pfx = eina_prefix_new(NULL, ecordova_init,
102 "ECORDOVA", "ecordova", "checkme", 81 "ECORDOVA", "ecordova", "checkme",
103 PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, 82 PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
@@ -111,14 +90,11 @@ ecordova_init(void)
111 return _ecordova_init_count; 90 return _ecordova_init_count;
112 91
113on_error_4: 92on_error_4:
114/* ecore_file_shutdown(); */ 93 eo_shutdown();
115
116on_error_3: 94on_error_3:
117 ecore_shutdown(); 95 ecore_shutdown();
118
119on_error_2: 96on_error_2:
120 eina_log_domain_unregister(_ecordova_log_dom); 97 eina_log_domain_unregister(_ecordova_log_dom);
121
122on_error_1: 98on_error_1:
123 _ecordova_log_dom = -1; 99 _ecordova_log_dom = -1;
124 eina_shutdown(); 100 eina_shutdown();
@@ -128,9 +104,9 @@ on_error_1:
128EAPI int 104EAPI int
129ecordova_shutdown(void) 105ecordova_shutdown(void)
130{ 106{
131 if (_ecordova_init_count <= 0) 107 if (_ecordova_init_count <= 0)
132 { 108 {
133 ERR("Init count not greater than 0 in shutdown."); 109 ERR("init count not greater than 0 in shutdown.");
134 _ecordova_init_count = 0; 110 _ecordova_init_count = 0;
135 return 0; 111 return 0;
136 } 112 }
@@ -138,6 +114,8 @@ ecordova_shutdown(void)
138 if (--_ecordova_init_count) 114 if (--_ecordova_init_count)
139 return _ecordova_init_count; 115 return _ecordova_init_count;
140 116
117 eina_prefix_free(_ecordova_pfx);
118
141 if(_registered_engines) 119 if(_registered_engines)
142 { 120 {
143 eina_array_free(_registered_engines); 121 eina_array_free(_registered_engines);
@@ -145,9 +123,6 @@ ecordova_shutdown(void)
145 } 123 }
146 124
147 eo_shutdown(); 125 eo_shutdown();
148 /* eo_unref(_ecordova_systeminfo); */
149 /* eio_shutdown(); */
150 /* ecore_file_shutdown(); */
151 ecore_shutdown(); 126 ecore_shutdown();
152 eina_log_domain_unregister(_ecordova_log_dom); 127 eina_log_domain_unregister(_ecordova_log_dom);
153 _ecordova_log_dom = -1; 128 _ecordova_log_dom = -1;
@@ -254,7 +229,7 @@ void* ecordova_module_symbol_get(const char* symbol)
254 static const Eo_Class *(*class_get)(void); \ 229 static const Eo_Class *(*class_get)(void); \
255 if(!class_get) \ 230 if(!class_get) \
256 { \ 231 { \
257 fprintf(stderr, "%s:%d\n", __func__, __LINE__); fflush(stderr); \ 232 fprintf(stderr, "%s:%d\n", __func__, __LINE__); fflush(stderr);\
258 class_get = ecordova_module_symbol_get(ECORDOVA_symbol(name)); \ 233 class_get = ecordova_module_symbol_get(ECORDOVA_symbol(name)); \
259 if(!class_get) \ 234 if(!class_get) \
260 { \ 235 { \
@@ -262,7 +237,7 @@ void* ecordova_module_symbol_get(const char* symbol)
262 return NULL; \ 237 return NULL; \
263 } \ 238 } \
264 } \ 239 } \
265 fprintf(stderr, "%s:%d\n", __func__, __LINE__); fflush(stderr); \ 240 fprintf(stderr, "%s:%d symbol %p\n", __func__, __LINE__, class_get); fflush(stderr); \
266 return class_get(); \ 241 return class_get(); \
267 } 242 }
268 243
@@ -272,7 +247,17 @@ void* ecordova_module_symbol_get(const char* symbol)
272 ECORDOVA_concat_op(ECORDOVA_concat_op(Ecordova_, name), _Data); 247 ECORDOVA_concat_op(ECORDOVA_concat_op(Ecordova_, name), _Data);
273 248
274 249
250ECORDOVA_CLASS_GET(batterystatus)
275ECORDOVA_CLASS_GET(console) 251ECORDOVA_CLASS_GET(console)
252ECORDOVA_CLASS_GET(contactaddress)
253ECORDOVA_CLASS_GET(contact)
254ECORDOVA_CLASS_GET(contacts)
255ECORDOVA_CLASS_GET(contactfield)
256ECORDOVA_CLASS_GET(contactname)
257ECORDOVA_CLASS_GET(contactorganization)
258ECORDOVA_CLASS_GET(device)
259ECORDOVA_CLASS_GET(devicemotion)
260ECORDOVA_CLASS_GET(deviceorientation)
276ECORDOVA_CLASS_GET(directoryentry) 261ECORDOVA_CLASS_GET(directoryentry)
277ECORDOVA_CLASS_GET(directoryreader) 262ECORDOVA_CLASS_GET(directoryreader)
278ECORDOVA_CLASS_GET(entry) 263ECORDOVA_CLASS_GET(entry)
@@ -281,8 +266,26 @@ ECORDOVA_CLASS_GET(filewriter)
281ECORDOVA_CLASS_GET(file) 266ECORDOVA_CLASS_GET(file)
282ECORDOVA_CLASS_GET(filereader) 267ECORDOVA_CLASS_GET(filereader)
283ECORDOVA_CLASS_GET(filetransfer) 268ECORDOVA_CLASS_GET(filetransfer)
284 269ECORDOVA_CLASS_GET(geolocation)
270ECORDOVA_CLASS_GET(globalization)
271ECORDOVA_CLASS_GET(inappbrowser)
272ECORDOVA_CLASS_GET(media)
273ECORDOVA_CLASS_GET(mediafile)
274ECORDOVA_CLASS_GET(networkinformation)
275ECORDOVA_CLASS_GET(systeminfo)
276ECORDOVA_CLASS_GET(vibration)
277
278ECORDOVA_define_data(BatteryStatus)
279ECORDOVA_define_data(ContactAddress)
280ECORDOVA_define_data(Contact)
281ECORDOVA_define_data(Contacts)
282ECORDOVA_define_data(ContactField)
283ECORDOVA_define_data(ContactName)
284ECORDOVA_define_data(ContactOrganization)
285ECORDOVA_define_data(Console) 285ECORDOVA_define_data(Console)
286ECORDOVA_define_data(Device)
287ECORDOVA_define_data(DeviceMotion)
288ECORDOVA_define_data(DeviceOrientation)
286ECORDOVA_define_data(DirectoryEntry) 289ECORDOVA_define_data(DirectoryEntry)
287ECORDOVA_define_data(DirectoryReader) 290ECORDOVA_define_data(DirectoryReader)
288ECORDOVA_define_data(Entry) 291ECORDOVA_define_data(Entry)
@@ -291,6 +294,14 @@ ECORDOVA_define_data(FileWriter)
291ECORDOVA_define_data(File) 294ECORDOVA_define_data(File)
292ECORDOVA_define_data(FileReader) 295ECORDOVA_define_data(FileReader)
293ECORDOVA_define_data(FileTransfer) 296ECORDOVA_define_data(FileTransfer)
297ECORDOVA_define_data(Geolocation)
298ECORDOVA_define_data(Globalization)
299ECORDOVA_define_data(InAppBrowser)
300ECORDOVA_define_data(Media)
301ECORDOVA_define_data(MediaFile)
302ECORDOVA_define_data(NetworkInformation)
303ECORDOVA_define_data(SystemInfo)
304ECORDOVA_define_data(Vibration)
294 305
295#undef EO_DEFINE_CLASS 306#undef EO_DEFINE_CLASS
296#define EO_DEFINE_CLASS(...) 307#define EO_DEFINE_CLASS(...)
@@ -298,12 +309,55 @@ ECORDOVA_define_data(FileTransfer)
298#undef EOAPI 309#undef EOAPI
299#define EOAPI EAPI 310#define EOAPI EAPI
300 311
312#include "ecordova_batterystatus.eo.h"
313#include "ecordova_batterystatus.eo.c"
314#include "ecordova_contactaddress.eo.h"
315#include "ecordova_contactaddress.eo.c"
316#include "ecordova_contact.eo.h"
317#include "ecordova_contact.eo.c"
318#include "ecordova_contactfield.eo.h"
319#include "ecordova_contactfield.eo.c"
320#include "ecordova_contactname.eo.h"
321#include "ecordova_contactname.eo.c"
322#include "ecordova_contactorganization.eo.h"
323#include "ecordova_contactorganization.eo.c"
324#include "ecordova_console.eo.h"
301#include "ecordova_console.eo.c" 325#include "ecordova_console.eo.c"
326#include "ecordova_device.eo.h"
327#include "ecordova_device.eo.c"
328#include "ecordova_devicemotion.eo.h"
329#include "ecordova_devicemotion.eo.c"
330#include "ecordova_deviceorientation.eo.h"
331#include "ecordova_deviceorientation.eo.c"
332#include "ecordova_directoryentry.eo.h"
302#include "ecordova_directoryentry.eo.c" 333#include "ecordova_directoryentry.eo.c"
334#include "ecordova_directoryreader.eo.h"
303#include "ecordova_directoryreader.eo.c" 335#include "ecordova_directoryreader.eo.c"
336#include "ecordova_entry.eo.h"
304#include "ecordova_entry.eo.c" 337#include "ecordova_entry.eo.c"
338#include "ecordova_fileentry.eo.h"
305#include "ecordova_fileentry.eo.c" 339#include "ecordova_fileentry.eo.c"
340#include "ecordova_filewriter.eo.h"
306#include "ecordova_filewriter.eo.c" 341#include "ecordova_filewriter.eo.c"
342#include "ecordova_file.eo.h"
307#include "ecordova_file.eo.c" 343#include "ecordova_file.eo.c"
344#include "ecordova_filereader.eo.h"
308#include "ecordova_filereader.eo.c" 345#include "ecordova_filereader.eo.c"
346#include "ecordova_filetransfer.eo.h"
309#include "ecordova_filetransfer.eo.c" 347#include "ecordova_filetransfer.eo.c"
348#include "ecordova_geolocation.eo.h"
349#include "ecordova_geolocation.eo.c"
350#include "ecordova_globalization.eo.h"
351#include "ecordova_globalization.eo.c"
352#include "ecordova_inappbrowser.eo.h"
353#include "ecordova_inappbrowser.eo.c"
354#include "ecordova_media.eo.h"
355#include "ecordova_media.eo.c"
356#include "ecordova_mediafile.eo.h"
357#include "ecordova_mediafile.eo.c"
358#include "ecordova_networkinformation.eo.h"
359#include "ecordova_networkinformation.eo.c"
360#include "ecordova_systeminfo.eo.h"
361#include "ecordova_systeminfo.eo.c"
362#include "ecordova_vibration.eo.h"
363#include "ecordova_vibration.eo.c"
diff --git a/src/modules/ecordova/linux/ecordova_linux.c b/src/modules/ecordova/linux/ecordova_linux.c
index ae37dee862..f36686c9dd 100644
--- a/src/modules/ecordova/linux/ecordova_linux.c
+++ b/src/modules/ecordova/linux/ecordova_linux.c
@@ -15,37 +15,50 @@ int _ecordova_log_dom;
15static Eina_Bool 15static Eina_Bool
16_ecordova_linux_init(void) 16_ecordova_linux_init(void)
17{ 17{
18 fprintf(stderr, "%s:%s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); 18 if (!eina_init())
19 19 {
20 fputs("Ecordova: Unable to initialize eina\n", stderr);
21 goto on_error_1;
22 }
23
20 _ecordova_log_dom = eina_log_domain_register("ecordova_linux", EINA_COLOR_CYAN); 24 _ecordova_log_dom = eina_log_domain_register("ecordova_linux", EINA_COLOR_CYAN);
21 if (_ecordova_log_dom < 0) 25 if (_ecordova_log_dom < 0)
22 { 26 {
23 EINA_LOG_ERR("Unable to create an 'ecordova' log domain"); 27 EINA_LOG_ERR("Unable to create an 'ecordova' log domain");
24 //goto on_error_1; 28 goto on_error_2;
25 } 29 }
26 30
27 if (!ecore_file_init()) 31 if (!ecore_file_init())
28 { 32 {
29 ERR("Unable to initialize ecore_file"); 33 ERR("Unable to initialize ecore_file");
30 //goto on_error_3; 34 goto on_error_3;
31 } 35 }
32 36
33 if (!eio_init()) 37 if (!eio_init())
34 { 38 {
35 ERR("Unable to initialize eio"); 39 ERR("Unable to initialize eio");
36 //goto on_error_4; 40 goto on_error_4;
37 } 41 }
38 42
39
40 return EINA_TRUE; 43 return EINA_TRUE;
44
45on_error_4:
46 ecore_file_shutdown();
47on_error_3:
48 eina_log_domain_unregister(_ecordova_log_dom);
49on_error_2:
50 eina_shutdown();
51on_error_1:
52 return EINA_FALSE;
41} 53}
42 54
43static void 55static void
44_ecordova_linux_shutdown(void) 56_ecordova_linux_shutdown(void)
45{ 57{
46 fprintf(stderr, "%s:%s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr);
47 eio_shutdown(); 58 eio_shutdown();
48 ecore_file_shutdown(); 59 ecore_file_shutdown();
60 eina_log_domain_unregister(_ecordova_log_dom);
61 eina_shutdown();
49} 62}
50 63
51EINA_MODULE_INIT(_ecordova_linux_init); 64EINA_MODULE_INIT(_ecordova_linux_init);
diff --git a/src/modules/ecordova/tizen/ecordova_contact.c b/src/modules/ecordova/tizen/ecordova_contact.c
index 9b986c09e5..fbb88b4e77 100644
--- a/src/modules/ecordova/tizen/ecordova_contact.c
+++ b/src/modules/ecordova/tizen/ecordova_contact.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
5#include "ecordova_contact_private.h" 6#include "ecordova_contact_private.h"
6 7
7#include "ecordova_contactname_private.h" 8#include "ecordova_contactname_private.h"
@@ -1115,3 +1116,4 @@ _ecordova_contactorganizations_export(Eina_Array *organizations,
1115} 1116}
1116 1117
1117#include "ecordova_contact.eo.c" 1118#include "ecordova_contact.eo.c"
1119#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contactaddress.c b/src/modules/ecordova/tizen/ecordova_contactaddress.c
index 23918f2432..2aa209f24f 100644
--- a/src/modules/ecordova/tizen/ecordova_contactaddress.c
+++ b/src/modules/ecordova/tizen/ecordova_contactaddress.c
@@ -2,6 +2,8 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
6
5#include "ecordova_contactaddress_private.h" 7#include "ecordova_contactaddress_private.h"
6#include "ecordova_contacts_record_utils.h" 8#include "ecordova_contacts_record_utils.h"
7 9
@@ -310,3 +312,5 @@ ecordova_contactaddress_clone(Ecordova_ContactAddress *other)
310} 312}
311 313
312#include "ecordova_contactaddress.eo.c" 314#include "ecordova_contactaddress.eo.c"
315
316#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contactfield.c b/src/modules/ecordova/tizen/ecordova_contactfield.c
index 8397a1944d..f69978cc13 100644
--- a/src/modules/ecordova/tizen/ecordova_contactfield.c
+++ b/src/modules/ecordova/tizen/ecordova_contactfield.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
5#include "ecordova_contactfield_private.h" 6#include "ecordova_contactfield_private.h"
6#include "ecordova_contacts_record_utils.h" 7#include "ecordova_contacts_record_utils.h"
7 8
@@ -413,3 +414,4 @@ ecordova_contacturl_label2type(const char *label)
413} 414}
414 415
415#include "ecordova_contactfield.eo.c" 416#include "ecordova_contactfield.eo.c"
417#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contactname.c b/src/modules/ecordova/tizen/ecordova_contactname.c
index 87cdcbfaaf..655cee87a0 100644
--- a/src/modules/ecordova/tizen/ecordova_contactname.c
+++ b/src/modules/ecordova/tizen/ecordova_contactname.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
5#include "ecordova_contactname_private.h" 6#include "ecordova_contactname_private.h"
6#include "ecordova_contact_private.h" 7#include "ecordova_contact_private.h"
7#include "ecordova_contacts_record_utils.h" 8#include "ecordova_contacts_record_utils.h"
@@ -255,3 +256,4 @@ ecordova_contactname_clone(Ecordova_ContactName *other)
255 256
256 257
257#include "ecordova_contactname.eo.c" 258#include "ecordova_contactname.eo.c"
259#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contactorganization.c b/src/modules/ecordova/tizen/ecordova_contactorganization.c
index 50cbde09cf..b6df0db035 100644
--- a/src/modules/ecordova/tizen/ecordova_contactorganization.c
+++ b/src/modules/ecordova/tizen/ecordova_contactorganization.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
5#include "ecordova_contactorganization_private.h" 6#include "ecordova_contactorganization_private.h"
6#include "ecordova_contacts_record_utils.h" 7#include "ecordova_contacts_record_utils.h"
7 8
@@ -230,3 +231,4 @@ ecordova_contactorganization_clone(Ecordova_ContactOrganization *other)
230} 231}
231 232
232#include "ecordova_contactorganization.eo.c" 233#include "ecordova_contactorganization.eo.c"
234#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contacts.c b/src/modules/ecordova/tizen/ecordova_contacts.c
index c914ec08fb..845907b880 100644
--- a/src/modules/ecordova/tizen/ecordova_contacts.c
+++ b/src/modules/ecordova/tizen/ecordova_contacts.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
5#include "ecordova_contacts_private.h" 6#include "ecordova_contacts_private.h"
6#include "ecordova_contact_private.h" 7#include "ecordova_contact_private.h"
7#include "ecordova_contacts_record_utils.h" 8#include "ecordova_contacts_record_utils.h"
@@ -517,3 +518,4 @@ on_error:
517} 518}
518 519
519#include "ecordova_contacts.eo.c" 520#include "ecordova_contacts.eo.c"
521#endif
diff --git a/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c b/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c
index 09cab89d4f..b813779840 100644
--- a/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c
+++ b/src/modules/ecordova/tizen/ecordova_contacts_record_utils.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_CONTACTS_SERVICE
5#include "ecordova_contacts_record_utils.h" 6#include "ecordova_contacts_record_utils.h"
6 7
7#include <Eina.h> 8#include <Eina.h>
@@ -119,3 +120,4 @@ clear_all_contact_record(contacts_record_h contacts_record,
119 120
120 return true; 121 return true;
121} 122}
123#endif
diff --git a/src/modules/ecordova/tizen/ecordova_device.c b/src/modules/ecordova/tizen/ecordova_device.c
index 0971292111..0b2d166381 100644
--- a/src/modules/ecordova/tizen/ecordova_device.c
+++ b/src/modules/ecordova/tizen/ecordova_device.c
@@ -4,6 +4,7 @@
4 4
5#include "ecordova_device_private.h" 5#include "ecordova_device_private.h"
6 6
7#ifdef HAVE_TIZEN_INFO
7#include <system/system_info.h> 8#include <system/system_info.h>
8 9
9#define MY_CLASS ECORDOVA_DEVICE_CLASS 10#define MY_CLASS ECORDOVA_DEVICE_CLASS
@@ -105,3 +106,4 @@ _ecordova_device_version_get(Eo *obj EINA_UNUSED, Ecordova_Device_Data *pd)
105} 106}
106 107
107#include "ecordova_device.eo.c" 108#include "ecordova_device.eo.c"
109#endif
diff --git a/src/modules/ecordova/tizen/ecordova_devicemotion.c b/src/modules/ecordova/tizen/ecordova_devicemotion.c
index 3b6543cb42..381611994a 100644
--- a/src/modules/ecordova/tizen/ecordova_devicemotion.c
+++ b/src/modules/ecordova/tizen/ecordova_devicemotion.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_SENSOR
5#include "ecordova_devicemotion_private.h" 6#include "ecordova_devicemotion_private.h"
6 7
7#define MY_CLASS ECORDOVA_DEVICEMOTION_CLASS 8#define MY_CLASS ECORDOVA_DEVICEMOTION_CLASS
@@ -174,3 +175,4 @@ _hash_data_free(sensor_listener_h listener)
174} 175}
175 176
176#include "ecordova_devicemotion.eo.c" 177#include "ecordova_devicemotion.eo.c"
178#endif
diff --git a/src/modules/ecordova/tizen/ecordova_deviceorientation.c b/src/modules/ecordova/tizen/ecordova_deviceorientation.c
index 87a3d65dbe..a98ae23cfb 100644
--- a/src/modules/ecordova/tizen/ecordova_deviceorientation.c
+++ b/src/modules/ecordova/tizen/ecordova_deviceorientation.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_SENSOR
5#include "ecordova_deviceorientation_private.h" 6#include "ecordova_deviceorientation_private.h"
6 7
7#define MY_CLASS ECORDOVA_DEVICEORIENTATION_CLASS 8#define MY_CLASS ECORDOVA_DEVICEORIENTATION_CLASS
@@ -178,3 +179,4 @@ _hash_data_free(sensor_listener_h listener)
178} 179}
179 180
180#include "ecordova_deviceorientation.eo.c" 181#include "ecordova_deviceorientation.eo.c"
182#endif
diff --git a/src/modules/ecordova/tizen/ecordova_geolocation.c b/src/modules/ecordova/tizen/ecordova_geolocation.c
index dff3e7b476..e6303d1003 100644
--- a/src/modules/ecordova/tizen/ecordova_geolocation.c
+++ b/src/modules/ecordova/tizen/ecordova_geolocation.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef TIZEN_LOCATION_MANAGER
5#include "ecordova_geolocation_private.h" 6#include "ecordova_geolocation_private.h"
6#include <ecore_timer.eo.h> 7#include <ecore_timer.eo.h>
7 8
@@ -280,3 +281,4 @@ on_error_1:
280} 281}
281 282
282#include "ecordova_geolocation.eo.c" 283#include "ecordova_geolocation.eo.c"
284#endif
diff --git a/src/modules/ecordova/tizen/ecordova_globalization.c b/src/modules/ecordova/tizen/ecordova_globalization.c
index 9320c87cdb..8501794dc7 100644
--- a/src/modules/ecordova/tizen/ecordova_globalization.c
+++ b/src/modules/ecordova/tizen/ecordova_globalization.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#ifdef HAVE_TIZEN_BASE_UTILS_I18N
5#include "ecordova_globalization_private.h" 6#include "ecordova_globalization_private.h"
6 7
7#include <utils_i18n.h> 8#include <utils_i18n.h>
@@ -1120,3 +1121,4 @@ _date_time_options_to_style(const Ecordova_Globalization_DateTimeOptions *option
1120} 1121}
1121 1122
1122#include "ecordova_globalization.eo.c" 1123#include "ecordova_globalization.eo.c"
1124#endif
diff --git a/src/modules/ecordova/tizen/ecordova_tizen.c b/src/modules/ecordova/tizen/ecordova_tizen.c
index 4607e4841c..89ce9d3aa7 100644
--- a/src/modules/ecordova/tizen/ecordova_tizen.c
+++ b/src/modules/ecordova/tizen/ecordova_tizen.c
@@ -19,7 +19,7 @@ _ecordova_tizen_init(void)
19 if (_ecordova_log_dom < 0) 19 if (_ecordova_log_dom < 0)
20 { 20 {
21 EINA_LOG_ERR("Unable to create an 'ecordova' log domain"); 21 EINA_LOG_ERR("Unable to create an 'ecordova' log domain");
22 //goto on_error_1; 22 return EINA_FALSE;
23 } 23 }
24 24
25 return EINA_TRUE; 25 return EINA_TRUE;
@@ -28,6 +28,8 @@ _ecordova_tizen_init(void)
28static void 28static void
29_ecordova_tizen_shutdown(void) 29_ecordova_tizen_shutdown(void)
30{ 30{
31 eina_log_domain_unregister(_ecordova_log_dom);
32 _ecordova_log_dom = -1;
31} 33}
32 34
33EINA_MODULE_INIT(_ecordova_system_tizen_init); 35EINA_MODULE_INIT(_ecordova_system_tizen_init);
diff --git a/src/tests/ecordova/ecordova_batterystatus_test.c b/src/tests/ecordova/ecordova_batterystatus_test.c
index 140723402d..92d82f2d67 100644
--- a/src/tests/ecordova/ecordova_batterystatus_test.c
+++ b/src/tests/ecordova/ecordova_batterystatus_test.c
@@ -2,10 +2,11 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_batterystatus_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
8#include <stdbool.h> 9#include <check.h>
9 10
10static void 11static void
11_setup(void) 12_setup(void)
@@ -21,6 +22,7 @@ _teardown(void)
21 ck_assert_int_eq(ret, 0); 22 ck_assert_int_eq(ret, 0);
22} 23}
23 24
25#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
24static Ecordova_Device * 26static Ecordova_Device *
25_batterystatus_new(void) 27_batterystatus_new(void)
26{ 28{
@@ -42,3 +44,18 @@ ecordova_batterystatus_test(TCase *tc)
42 tcase_add_checked_fixture(tc, _setup, _teardown); 44 tcase_add_checked_fixture(tc, _setup, _teardown);
43 tcase_add_test(tc, smoke); 45 tcase_add_test(tc, smoke);
44} 46}
47#else
48START_TEST(batterystatus_load_fail)
49{
50 Ecordova_Device *batterystatus = eo_add(ECORDOVA_BATTERYSTATUS_CLASS, NULL);
51 ck_assert_ptr_eq(batterystatus, NULL);
52}
53END_TEST
54
55void
56ecordova_batterystatus_test(TCase *tc)
57{
58 tcase_add_checked_fixture(tc, _setup, _teardown);
59 tcase_add_test(tc, batterystatus_load_fail);
60}
61#endif
diff --git a/src/tests/ecordova/ecordova_batterystatus_test.h b/src/tests/ecordova/ecordova_batterystatus_test.h
deleted file mode 100644
index 55f29347e8..0000000000
--- a/src/tests/ecordova/ecordova_batterystatus_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_BATTERYSTATUS_TEST_H
2#define _ECORDOVA_BATTERYSTATUS_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_batterystatus_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_console_test.c b/src/tests/ecordova/ecordova_console_test.c
index 99f41a33dc..2c39de5d61 100644
--- a/src/tests/ecordova/ecordova_console_test.c
+++ b/src/tests/ecordova/ecordova_console_test.c
@@ -2,7 +2,8 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_console_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
8#include <stdbool.h> 9#include <stdbool.h>
diff --git a/src/tests/ecordova/ecordova_console_test.h b/src/tests/ecordova/ecordova_console_test.h
deleted file mode 100644
index 1d303fd499..0000000000
--- a/src/tests/ecordova/ecordova_console_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_CONSOLE_TEST_H
2#define _ECORDOVA_CONSOLE_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_console_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_contacts_test.c b/src/tests/ecordova/ecordova_contacts_test.c
index 106e35efcb..3b6a2213d6 100644
--- a/src/tests/ecordova/ecordova_contacts_test.c
+++ b/src/tests/ecordova/ecordova_contacts_test.c
@@ -2,13 +2,14 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_contacts_test.h"
6#include "ecordova_suite.h" 5#include "ecordova_suite.h"
7#include <Ecore.h> 6#include <Ecore.h>
8#include <ecore_timer.eo.h> 7#include <ecore_timer.eo.h>
9#include <Ecordova.h> 8#include <Ecordova.h>
10 9
11#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER 10#include <check.h>
11
12#if defined(HAVE_TIZEN_CONFIGURATION_MANAGER) && defined(HAVE_TIZEN_CONTACTS_SERVICE)
12#include <contact.h> 13#include <contact.h>
13 14
14#define CHECK(x) {int ret = x; ck_assert_int_eq(CONTACTS_ERROR_NONE, ret);} 15#define CHECK(x) {int ret = x; ck_assert_int_eq(CONTACTS_ERROR_NONE, ret);}
@@ -247,15 +248,51 @@ START_TEST(find_by_name)
247 eo_unref(contacts); 248 eo_unref(contacts);
248} 249}
249END_TEST 250END_TEST
250#endif
251 251
252void 252void
253ecordova_contacts_test(TCase *tc) 253ecordova_contacts_test(TCase *tc)
254{ 254{
255#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
256 tcase_add_checked_fixture(tc, _setup, _teardown); 255 tcase_add_checked_fixture(tc, _setup, _teardown);
257 tcase_add_test(tc, find_all); 256 tcase_add_test(tc, find_all);
258 tcase_add_test(tc, find_by_id); 257 tcase_add_test(tc, find_by_id);
259 tcase_add_test(tc, find_by_name); 258 tcase_add_test(tc, find_by_name);
260#endif
261} 259}
260#else
261START_TEST(contacts_fail_load)
262{
263 ecordova_init();
264
265 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr);
266 Ecordova_Contacts *contacts = eo_add(ECORDOVA_CONTACTS_CLASS, NULL);
267 ck_assert_ptr_eq(contacts, NULL);
268
269 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr);
270 Ecordova_Contact *contact = eo_add(ECORDOVA_CONTACT_CLASS, NULL);
271 ck_assert_ptr_eq(contact, NULL);
272
273 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr);
274 Ecordova_ContactAddress *contact_address = eo_add(ECORDOVA_CONTACTADDRESS_CLASS, NULL);
275 ck_assert_ptr_eq(contact_address, NULL);
276
277 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr);
278 Ecordova_ContactField *contact_field = eo_add(ECORDOVA_CONTACTFIELD_CLASS, NULL);
279 ck_assert_ptr_eq(contact_field, NULL);
280
281 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr);
282 Ecordova_ContactName *contact_name = eo_add(ECORDOVA_CONTACTNAME_CLASS, NULL);
283 ck_assert_ptr_eq(contact_name, NULL);
284
285 fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr);
286 Ecordova_ContactOrganization *contact_organization = eo_add(ECORDOVA_CONTACTORGANIZATION_CLASS, NULL);
287 ck_assert_ptr_eq(contact_organization, NULL);
288
289 ecordova_shutdown();
290}
291END_TEST
292
293void
294ecordova_contacts_test(TCase *tc)
295{
296 tcase_add_test(tc, contacts_fail_load);
297}
298#endif
diff --git a/src/tests/ecordova/ecordova_contacts_test.h b/src/tests/ecordova/ecordova_contacts_test.h
deleted file mode 100644
index 6a96318ae6..0000000000
--- a/src/tests/ecordova/ecordova_contacts_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_CONTACTS_TEST_H
2#define _ECORDOVA_CONTACTS_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_contacts_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_device_test.c b/src/tests/ecordova/ecordova_device_test.c
index 710b3b4e77..ebb19ed212 100644
--- a/src/tests/ecordova/ecordova_device_test.c
+++ b/src/tests/ecordova/ecordova_device_test.c
@@ -2,9 +2,12 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_device_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
9#include <check.h>
10
8static void 11static void
9_setup(void) 12_setup(void)
10{ 13{
@@ -19,6 +22,7 @@ _teardown(void)
19 ck_assert_int_eq(ret, 0); 22 ck_assert_int_eq(ret, 0);
20} 23}
21 24
25#if defined(HAVE_TIZEN_CONFIGURATION_MANAGER) && defined(HAVE_TIZEN_INFO)
22static Ecordova_Device * 26static Ecordova_Device *
23_device_new(void) 27_device_new(void)
24{ 28{
@@ -98,3 +102,18 @@ ecordova_device_test(TCase *tc)
98 //tcase_add_test(tc, uuid_get); // disabled: returns NULL 102 //tcase_add_test(tc, uuid_get); // disabled: returns NULL
99 tcase_add_test(tc, version_get); 103 tcase_add_test(tc, version_get);
100} 104}
105#else
106START_TEST(device_load_fail)
107{
108 Ecordova_Device *device = eo_add(ECORDOVA_DEVICE_CLASS, NULL);
109 ck_assert_ptr_eq(device, NULL);
110}
111END_TEST
112
113void
114ecordova_device_test(TCase *tc)
115{
116 tcase_add_checked_fixture(tc, _setup, _teardown);
117 tcase_add_test(tc, device_load_fail);
118}
119#endif
diff --git a/src/tests/ecordova/ecordova_device_test.h b/src/tests/ecordova/ecordova_device_test.h
deleted file mode 100644
index 7d943cc323..0000000000
--- a/src/tests/ecordova/ecordova_device_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_DEVICE_TEST_H
2#define _ECORDOVA_DEVICE_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_device_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_devicemotion_test.c b/src/tests/ecordova/ecordova_devicemotion_test.c
index fec15b5538..c0a2179480 100644
--- a/src/tests/ecordova/ecordova_devicemotion_test.c
+++ b/src/tests/ecordova/ecordova_devicemotion_test.c
@@ -2,11 +2,13 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_devicemotion_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
8#include <stdbool.h> 9#include <check.h>
9 10
11#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
10static void 12static void
11_setup(void) 13_setup(void)
12{ 14{
@@ -87,3 +89,23 @@ ecordova_devicemotion_test(TCase *tc)
87 tcase_add_test(tc, smoke); 89 tcase_add_test(tc, smoke);
88 //tcase_add_test(tc, current_acceleration_get); // disabled: not supported 90 //tcase_add_test(tc, current_acceleration_get); // disabled: not supported
89} 91}
92#else
93START_TEST(devicemotion_fail_load)
94{
95 ecordova_init();
96
97 Ecordova_Device *devicemotion
98 = eo_add(ECORDOVA_DEVICEMOTION_CLASS, NULL);
99
100 ck_assert_ptr_eq(devicemotion, NULL);
101
102 ecordova_shutdown();
103}
104END_TEST
105
106void
107ecordova_devicemotion_test(TCase *tc)
108{
109 tcase_add_test(tc, devicemotion_fail_load);
110}
111#endif
diff --git a/src/tests/ecordova/ecordova_devicemotion_test.h b/src/tests/ecordova/ecordova_devicemotion_test.h
deleted file mode 100644
index dcc3d6ce9a..0000000000
--- a/src/tests/ecordova/ecordova_devicemotion_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_DEVICEMOTION_TEST_H
2#define _ECORDOVA_DEVICEMOTION_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_devicemotion_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_deviceorientation_test.c b/src/tests/ecordova/ecordova_deviceorientation_test.c
index df814eb19c..4e3d4059e0 100644
--- a/src/tests/ecordova/ecordova_deviceorientation_test.c
+++ b/src/tests/ecordova/ecordova_deviceorientation_test.c
@@ -2,10 +2,11 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_deviceorientation_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
8#include <stdbool.h> 9#include <check.h>
9 10
10static void 11static void
11_setup(void) 12_setup(void)
@@ -21,6 +22,7 @@ _teardown(void)
21 ck_assert_int_eq(ret, 0); 22 ck_assert_int_eq(ret, 0);
22} 23}
23 24
25#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
24static Ecordova_Device * 26static Ecordova_Device *
25_deviceorientation_new(void) 27_deviceorientation_new(void)
26{ 28{
@@ -87,3 +89,19 @@ ecordova_deviceorientation_test(TCase *tc)
87 tcase_add_test(tc, smoke); 89 tcase_add_test(tc, smoke);
88 //tcase_add_test(tc, current_heading_get); // disabled: not supported 90 //tcase_add_test(tc, current_heading_get); // disabled: not supported
89} 91}
92#else
93START_TEST(deviceorientation_fail_load)
94{
95 Ecordova_Device *deviceorientation = eo_add(ECORDOVA_DEVICEORIENTATION_CLASS, NULL);
96
97 ck_assert_ptr_eq(deviceorientation, NULL);
98}
99END_TEST
100
101void
102ecordova_deviceorientation_test(TCase *tc)
103{
104 tcase_add_checked_fixture(tc, _setup, _teardown);
105 tcase_add_test(tc, deviceorientation_fail_load);
106}
107#endif
diff --git a/src/tests/ecordova/ecordova_deviceorientation_test.h b/src/tests/ecordova/ecordova_deviceorientation_test.h
deleted file mode 100644
index 12249a9bfd..0000000000
--- a/src/tests/ecordova/ecordova_deviceorientation_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_DEVICEORIENTATION_TEST_H
2#define _ECORDOVA_DEVICEORIENTATION_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_deviceorientation_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_directoryentry_test.c b/src/tests/ecordova/ecordova_directoryentry_test.c
index 51477cd5b8..c22704c96d 100644
--- a/src/tests/ecordova/ecordova_directoryentry_test.c
+++ b/src/tests/ecordova/ecordova_directoryentry_test.c
@@ -2,8 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_directoryentry_test.h" 5#include "ecordova_file_tests.h"
6#include "ecordova_entry_test.h"
7#include "ecordova_suite.h" 6#include "ecordova_suite.h"
8 7
9#include <Eio.h> 8#include <Eio.h>
diff --git a/src/tests/ecordova/ecordova_directoryreader_test.c b/src/tests/ecordova/ecordova_directoryreader_test.c
index 555f75623a..dd10e5d909 100644
--- a/src/tests/ecordova/ecordova_directoryreader_test.c
+++ b/src/tests/ecordova/ecordova_directoryreader_test.c
@@ -2,7 +2,8 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_directoryreader_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
8static void 9static void
diff --git a/src/tests/ecordova/ecordova_directoryreader_test.h b/src/tests/ecordova/ecordova_directoryreader_test.h
deleted file mode 100644
index e01bad91e4..0000000000
--- a/src/tests/ecordova/ecordova_directoryreader_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_DIRECTORYREADER_TEST_H
2#define _ECORDOVA_DIRECTORYREADER_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_directoryreader_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_entry_test.c b/src/tests/ecordova/ecordova_entry_test.c
index 49d9c72479..d92ae6d039 100644
--- a/src/tests/ecordova/ecordova_entry_test.c
+++ b/src/tests/ecordova/ecordova_entry_test.c
@@ -2,8 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_entry_test.h" 5#include "ecordova_file_tests.h"
6#include "ecordova_directoryentry_test.h"
7#include "ecordova_suite.h" 6#include "ecordova_suite.h"
8 7
9#include <Eio.h> 8#include <Eio.h>
diff --git a/src/tests/ecordova/ecordova_entry_test.h b/src/tests/ecordova/ecordova_entry_test.h
deleted file mode 100644
index ba737f3b09..0000000000
--- a/src/tests/ecordova/ecordova_entry_test.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef _ECORDOVA_ENTRY_TEST_H
2#define _ECORDOVA_ENTRY_TEST_H
3
4#include <Ecordova.h>
5
6#include <check.h>
7
8#include <stdbool.h>
9
10void ecordova_entry_test(TCase *);
11bool entry_remove(Ecordova_Entry *);
12bool entry_do(Ecordova_Entry *, const Eo_Event_Description *, void(*)());
13
14#endif
diff --git a/src/tests/ecordova/ecordova_file_test.c b/src/tests/ecordova/ecordova_file_test.c
index 7696062a50..724637cb09 100644
--- a/src/tests/ecordova/ecordova_file_test.c
+++ b/src/tests/ecordova/ecordova_file_test.c
@@ -2,7 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_file_test.h" 5#include "ecordova_file_tests.h"
6#include "ecordova_suite.h" 6#include "ecordova_suite.h"
7 7
8static void 8static void
diff --git a/src/tests/ecordova/ecordova_file_test.h b/src/tests/ecordova/ecordova_file_test.h
deleted file mode 100644
index 766006404e..0000000000
--- a/src/tests/ecordova/ecordova_file_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_FILE_TEST_H
2#define _ECORDOVA_FILE_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_file_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_directoryentry_test.h b/src/tests/ecordova/ecordova_file_tests.h
index 7220400550..f9842da10d 100644
--- a/src/tests/ecordova/ecordova_directoryentry_test.h
+++ b/src/tests/ecordova/ecordova_file_tests.h
@@ -1,5 +1,5 @@
1#ifndef _ECORDOVA_DIRECTORYENTRY_TEST_H 1#ifndef ECORDOVA_FILE_TESTS_H
2#define _ECORDOVA_DIRECTORYENTRY_TEST_H 2#define ECORDOVA_FILE_TESTS_H
3 3
4#include <Ecordova.h> 4#include <Ecordova.h>
5 5
@@ -9,7 +9,6 @@
9 9
10#include <stdbool.h> 10#include <stdbool.h>
11 11
12void ecordova_directoryentry_test(TCase *);
13Ecordova_DirectoryEntry *_create_tmpdir(Eina_Tmpstr **); 12Ecordova_DirectoryEntry *_create_tmpdir(Eina_Tmpstr **);
14Eina_Bool _timeout_cb(void *); 13Eina_Bool _timeout_cb(void *);
15Eina_Bool _entry_get_cb(void *, Eo *, const Eo_Event_Description *, void *); 14Eina_Bool _entry_get_cb(void *, Eo *, const Eo_Event_Description *, void *);
@@ -21,4 +20,15 @@ void check_exists(const char *url);
21void check_doesnt_exist(const char *url); 20void check_doesnt_exist(const char *url);
22Ecordova_DirectoryEntry *directoryentry_new(const char *, const char *, const char *); 21Ecordova_DirectoryEntry *directoryentry_new(const char *, const char *, const char *);
23 22
23bool entry_remove(Ecordova_Entry *);
24bool entry_do(Ecordova_Entry *, const Eo_Event_Description *, void(*)());
25
26Ecordova_FileEntry *create_tmpfile(Eina_Tmpstr **, unsigned char **, size_t *);
27Ecordova_FileEntry *create_tmpfile_size(Eina_Tmpstr **, unsigned char **, size_t);
28bool fileentry_file_get(Ecordova_FileEntry *, Ecordova_File **);
29unsigned char * generate_random_buffer(size_t*);
30unsigned char * generate_random_buffer_size(size_t);
31
32bool filereader_read(Ecordova_File *file, char **content, size_t *length);
33
24#endif 34#endif
diff --git a/src/tests/ecordova/ecordova_fileentry_test.c b/src/tests/ecordova/ecordova_fileentry_test.c
index 452c290cfe..06e172bc01 100644
--- a/src/tests/ecordova/ecordova_fileentry_test.c
+++ b/src/tests/ecordova/ecordova_fileentry_test.c
@@ -2,9 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_fileentry_test.h" 5#include "ecordova_file_tests.h"
6#include "ecordova_directoryentry_test.h"
7#include "ecordova_entry_test.h"
8#include "ecordova_suite.h" 6#include "ecordova_suite.h"
9 7
10#include <Eio.h> 8#include <Eio.h>
diff --git a/src/tests/ecordova/ecordova_fileentry_test.h b/src/tests/ecordova/ecordova_fileentry_test.h
deleted file mode 100644
index f1c4f04321..0000000000
--- a/src/tests/ecordova/ecordova_fileentry_test.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _ECORDOVA_FILEENTRY_TEST_H
2#define _ECORDOVA_FILEENTRY_TEST_H
3
4#include <Ecordova.h>
5
6#include <check.h>
7
8#include <stdbool.h>
9
10void ecordova_fileentry_test(TCase *);
11Ecordova_FileEntry *create_tmpfile(Eina_Tmpstr **, unsigned char **, size_t *);
12Ecordova_FileEntry *create_tmpfile_size(Eina_Tmpstr **, unsigned char **, size_t);
13bool fileentry_file_get(Ecordova_FileEntry *, Ecordova_File **);
14unsigned char * generate_random_buffer(size_t*);
15unsigned char * generate_random_buffer_size(size_t);
16
17#endif
diff --git a/src/tests/ecordova/ecordova_filereader_test.c b/src/tests/ecordova/ecordova_filereader_test.c
index d4ed04309e..e5ca32797f 100644
--- a/src/tests/ecordova/ecordova_filereader_test.c
+++ b/src/tests/ecordova/ecordova_filereader_test.c
@@ -2,10 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_filereader_test.h" 5#include "ecordova_file_tests.h"
6#include "ecordova_fileentry_test.h"
7#include "ecordova_directoryentry_test.h"
8#include "ecordova_entry_test.h"
9#include "ecordova_suite.h" 6#include "ecordova_suite.h"
10 7
11#include <Eio.h> 8#include <Eio.h>
diff --git a/src/tests/ecordova/ecordova_filereader_test.h b/src/tests/ecordova/ecordova_filereader_test.h
deleted file mode 100644
index d7f59ce4fd..0000000000
--- a/src/tests/ecordova/ecordova_filereader_test.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _ECORDOVA_FILEREADER_TEST_H
2#define _ECORDOVA_FILEREADER_TEST_H
3
4#include <Ecordova.h>
5
6#include <check.h>
7
8#include <stdbool.h>
9
10void ecordova_filereader_test(TCase *);
11bool filereader_read(Ecordova_File *file, char **content, size_t *length);
12
13#endif
diff --git a/src/tests/ecordova/ecordova_filetransfer_test.c b/src/tests/ecordova/ecordova_filetransfer_test.c
index 0aa435a388..a24579f373 100644
--- a/src/tests/ecordova/ecordova_filetransfer_test.c
+++ b/src/tests/ecordova/ecordova_filetransfer_test.c
@@ -2,11 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_filetransfer_test.h" 5#include "ecordova_file_tests.h"
6#include "ecordova_fileentry_test.h"
7#include "ecordova_directoryentry_test.h"
8#include "ecordova_entry_test.h"
9#include "ecordova_filereader_test.h"
10#include "ecordova_suite.h" 6#include "ecordova_suite.h"
11 7
12#include <Ecore_Con.h> 8#include <Ecore_Con.h>
diff --git a/src/tests/ecordova/ecordova_filetransfer_test.h b/src/tests/ecordova/ecordova_filetransfer_test.h
deleted file mode 100644
index 1aab4ddbe6..0000000000
--- a/src/tests/ecordova/ecordova_filetransfer_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_FILETRANSFER_TEST_H
2#define _ECORDOVA_FILETRANSFER_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_filetransfer_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_filewriter_test.c b/src/tests/ecordova/ecordova_filewriter_test.c
index 8fdc86f49a..f7662e8499 100644
--- a/src/tests/ecordova/ecordova_filewriter_test.c
+++ b/src/tests/ecordova/ecordova_filewriter_test.c
@@ -2,11 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_filewriter_test.h" 5#include "ecordova_file_tests.h"
6#include "ecordova_fileentry_test.h"
7#include "ecordova_directoryentry_test.h"
8#include "ecordova_entry_test.h"
9#include "ecordova_filereader_test.h"
10#include "ecordova_suite.h" 6#include "ecordova_suite.h"
11 7
12#include <Eio.h> 8#include <Eio.h>
diff --git a/src/tests/ecordova/ecordova_filewriter_test.h b/src/tests/ecordova/ecordova_filewriter_test.h
deleted file mode 100644
index b7ac34ade2..0000000000
--- a/src/tests/ecordova/ecordova_filewriter_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_FILEWRITER_TEST_H
2#define _ECORDOVA_FILEWRITER_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_filewriter_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_geolocation_test.c b/src/tests/ecordova/ecordova_geolocation_test.c
index 04bc8f573f..e212f3be51 100644
--- a/src/tests/ecordova/ecordova_geolocation_test.c
+++ b/src/tests/ecordova/ecordova_geolocation_test.c
@@ -2,10 +2,11 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_geolocation_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
8#include <stdbool.h> 9#include <check.h>
9 10
10static void 11static void
11_setup(void) 12_setup(void)
@@ -21,6 +22,7 @@ _teardown(void)
21 ck_assert_int_eq(ret, 0); 22 ck_assert_int_eq(ret, 0);
22} 23}
23 24
25#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
24static Ecordova_Device * 26static Ecordova_Device *
25_geolocation_new(void) 27_geolocation_new(void)
26{ 28{
@@ -91,3 +93,18 @@ ecordova_geolocation_test(TCase *tc)
91 tcase_add_test(tc, smoke); 93 tcase_add_test(tc, smoke);
92 //tcase_add_test(tc, current_position_get); // disabled: not supported 94 //tcase_add_test(tc, current_position_get); // disabled: not supported
93} 95}
96#else
97START_TEST(geolocation_fail_load)
98{
99 Ecordova_Device *geolocation = eo_add(ECORDOVA_GEOLOCATION_CLASS, NULL);
100 ck_assert_ptr_eq(geolocation, NULL);
101}
102END_TEST
103
104void
105ecordova_geolocation_test(TCase *tc)
106{
107 tcase_add_checked_fixture(tc, _setup, _teardown);
108 tcase_add_test(tc, geolocation_fail_load);
109}
110#endif
diff --git a/src/tests/ecordova/ecordova_geolocation_test.h b/src/tests/ecordova/ecordova_geolocation_test.h
deleted file mode 100644
index a65c34df59..0000000000
--- a/src/tests/ecordova/ecordova_geolocation_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_GEOLOCATION_TEST_H
2#define _ECORDOVA_GEOLOCATION_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_geolocation_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_globalization_test.c b/src/tests/ecordova/ecordova_globalization_test.c
index d55ab728a5..93cdbfcf28 100644
--- a/src/tests/ecordova/ecordova_globalization_test.c
+++ b/src/tests/ecordova/ecordova_globalization_test.c
@@ -2,10 +2,11 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_globalization_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
8#include <stdbool.h> 9#include <check.h>
9 10
10static void 11static void
11_setup(void) 12_setup(void)
@@ -21,6 +22,7 @@ _teardown(void)
21 ck_assert_int_eq(ret, 0); 22 ck_assert_int_eq(ret, 0);
22} 23}
23 24
25#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
24static Ecordova_Device * 26static Ecordova_Device *
25_globalization_new(void) 27_globalization_new(void)
26{ 28{
@@ -592,3 +594,18 @@ ecordova_globalization_test(TCase *tc)
592 tcase_add_test(tc, string_to_date); 594 tcase_add_test(tc, string_to_date);
593 tcase_add_test(tc, string_to_number); 595 tcase_add_test(tc, string_to_number);
594} 596}
597#else
598START_TEST(globalization_fail_load)
599{
600 Ecordova_Globalization *globalization = eo_add(ECORDOVA_GLOBALIZATION_CLASS, NULL);
601 ck_assert_ptr_eq(globalization, NULL);
602}
603END_TEST
604
605void
606ecordova_globalization_test(TCase *tc)
607{
608 tcase_add_checked_fixture(tc, _setup, _teardown);
609 tcase_add_test(tc, globalization_fail_load);
610}
611#endif
diff --git a/src/tests/ecordova/ecordova_globalization_test.h b/src/tests/ecordova/ecordova_globalization_test.h
deleted file mode 100644
index a64102b838..0000000000
--- a/src/tests/ecordova/ecordova_globalization_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_GLOBALIZATION_TEST_H
2#define _ECORDOVA_GLOBALIZATION_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_globalization_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_media_test.c b/src/tests/ecordova/ecordova_media_test.c
index c8d79ca314..3b1e36ebf0 100644
--- a/src/tests/ecordova/ecordova_media_test.c
+++ b/src/tests/ecordova/ecordova_media_test.c
@@ -2,10 +2,11 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_media_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
8#include <stdbool.h> 9#include <check.h>
9 10
10static void 11static void
11_setup(void) 12_setup(void)
@@ -21,6 +22,7 @@ _teardown(void)
21 ck_assert_int_eq(ret, 0); 22 ck_assert_int_eq(ret, 0);
22} 23}
23 24
25#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
24static Ecordova_Device * 26static Ecordova_Device *
25_media_new(void) 27_media_new(void)
26{ 28{
@@ -40,5 +42,20 @@ void
40ecordova_media_test(TCase *tc) 42ecordova_media_test(TCase *tc)
41{ 43{
42 tcase_add_checked_fixture(tc, _setup, _teardown); 44 tcase_add_checked_fixture(tc, _setup, _teardown);
43 //tcase_add_test(tc, smoke); // disabled: not supported on common profile 45 tcase_add_test(tc, smoke); // not supported on common profile
46}
47#else
48START_TEST(media_load_fail)
49{
50 Ecordova_Device *media = eo_add(ECORDOVA_MEDIA_CLASS, NULL);
51 ck_assert_ptr_eq(media, NULL);
44} 52}
53END_TEST
54
55void
56ecordova_media_test(TCase *tc)
57{
58 tcase_add_checked_fixture(tc, _setup, _teardown);
59 tcase_add_test(tc, media_load_fail);
60}
61#endif
diff --git a/src/tests/ecordova/ecordova_media_test.h b/src/tests/ecordova/ecordova_media_test.h
deleted file mode 100644
index f26291efb1..0000000000
--- a/src/tests/ecordova/ecordova_media_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_MEDIA_TEST_H
2#define _ECORDOVA_MEDIA_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_media_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_mediafile_test.c b/src/tests/ecordova/ecordova_mediafile_test.c
index e58e954ccd..8b139a727d 100644
--- a/src/tests/ecordova/ecordova_mediafile_test.c
+++ b/src/tests/ecordova/ecordova_mediafile_test.c
@@ -2,8 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_mediafile_test.h" 5#include "ecordova_file_tests.h"
6#include "ecordova_directoryentry_test.h"
7#include "ecordova_suite.h" 6#include "ecordova_suite.h"
8 7
9#include <Eio.h> 8#include <Eio.h>
diff --git a/src/tests/ecordova/ecordova_mediafile_test.h b/src/tests/ecordova/ecordova_mediafile_test.h
deleted file mode 100644
index ace9eac0dc..0000000000
--- a/src/tests/ecordova/ecordova_mediafile_test.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ECORDOVA_MEDIAFILE_TEST_H
2#define _ECORDOVA_MEDIAFILE_TEST_H
3
4#include <Ecordova.h>
5
6#include <check.h>
7
8#include <stdbool.h>
9
10void ecordova_mediafile_test(TCase *);
11
12#endif
diff --git a/src/tests/ecordova/ecordova_networkinformation_test.c b/src/tests/ecordova/ecordova_networkinformation_test.c
index a3b98b53dc..cce42f43d6 100644
--- a/src/tests/ecordova/ecordova_networkinformation_test.c
+++ b/src/tests/ecordova/ecordova_networkinformation_test.c
@@ -2,10 +2,11 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_networkinformation_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
8#include <stdbool.h> 9#include <check.h>
9 10
10static void 11static void
11_setup(void) 12_setup(void)
@@ -21,6 +22,7 @@ _teardown(void)
21 ck_assert_int_eq(ret, 0); 22 ck_assert_int_eq(ret, 0);
22} 23}
23 24
25#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
24static Ecordova_Device * 26static Ecordova_Device *
25_networkinformation_new(void) 27_networkinformation_new(void)
26{ 28{
@@ -40,5 +42,20 @@ void
40ecordova_networkinformation_test(TCase *tc) 42ecordova_networkinformation_test(TCase *tc)
41{ 43{
42 tcase_add_checked_fixture(tc, _setup, _teardown); 44 tcase_add_checked_fixture(tc, _setup, _teardown);
43 //tcase_add_test(tc, smoke); // disabled: not supported on common profile 45 tcase_add_test(tc, smoke); // not supported on common profile
46}
47#else
48START_TEST(networkinformation_load_fail)
49{
50 Ecordova_Device *networkinformation = eo_add(ECORDOVA_NETWORKINFORMATION_CLASS, NULL);
51 ck_assert_ptr_eq(networkinformation, NULL);
44} 52}
53END_TEST
54
55void
56ecordova_networkinformation_test(TCase *tc)
57{
58 tcase_add_checked_fixture(tc, _setup, _teardown);
59 tcase_add_test(tc, networkinformation_load_fail);
60}
61#endif
diff --git a/src/tests/ecordova/ecordova_networkinformation_test.h b/src/tests/ecordova/ecordova_networkinformation_test.h
deleted file mode 100644
index dadce8818c..0000000000
--- a/src/tests/ecordova/ecordova_networkinformation_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_NETWORKINFORMATION_TEST_H
2#define _ECORDOVA_NETWORKINFORMATION_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_networkinformation_test(TCase *);
8
9#endif
diff --git a/src/tests/ecordova/ecordova_suite.c b/src/tests/ecordova/ecordova_suite.c
index 5f070698e6..caf2b37da2 100644
--- a/src/tests/ecordova/ecordova_suite.c
+++ b/src/tests/ecordova/ecordova_suite.c
@@ -2,27 +2,6 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5/* #include "ecordova_contacts_test.h" */
6/* #include "ecordova_device_test.h" */
7/* #include "ecordova_devicemotion_test.h" */
8/* #include "ecordova_deviceorientation_test.h" */
9/* #include "ecordova_geolocation_test.h" */
10/* #include "ecordova_batterystatus_test.h" */
11#include "ecordova_console_test.h"
12#include "ecordova_filetransfer_test.h"
13/* #include "ecordova_media_test.h" */
14/* #include "ecordova_networkinformation_test.h" */
15/* #include "ecordova_vibration_test.h" */
16#include "ecordova_directoryreader_test.h"
17#include "ecordova_directoryentry_test.h"
18#include "ecordova_entry_test.h"
19#include "ecordova_file_test.h"
20#include "ecordova_fileentry_test.h"
21#include "ecordova_filereader_test.h"
22#include "ecordova_filewriter_test.h"
23/* #include "ecordova_mediafile_test.h" */
24/* #include "ecordova_globalization_test.h" */
25
26#include <Eina.h> 5#include <Eina.h>
27 6
28#include <stdbool.h> 7#include <stdbool.h>
@@ -32,6 +11,27 @@
32 11
33#include "ecordova_suite.h" 12#include "ecordova_suite.h"
34 13
14void ecordova_batterystatus_test(TCase *);
15void ecordova_contacts_test(TCase *);
16void ecordova_device_test(TCase *);
17void ecordova_devicemotion_test(TCase *);
18void ecordova_deviceorientation_test(TCase *);
19void ecordova_geolocation_test(TCase *);
20void ecordova_console_test(TCase *);
21void ecordova_filetransfer_test(TCase *);
22void ecordova_media_test(TCase *);
23void ecordova_networkinformation_test(TCase *);
24void ecordova_vibration_test(TCase *);
25void ecordova_directoryreader_test(TCase *);
26void ecordova_directoryentry_test(TCase *);
27void ecordova_entry_test(TCase *);
28void ecordova_file_test(TCase *);
29void ecordova_fileentry_test(TCase *);
30void ecordova_filereader_test(TCase *);
31void ecordova_filewriter_test(TCase *);
32void ecordova_mediafile_test(TCase *);
33void ecordova_globalization_test(TCase *);
34
35int _test_ecordova_log_dom = -1; 35int _test_ecordova_log_dom = -1;
36 36
37typedef struct _Ecordova_Test_Case Ecordova_Test_Case; 37typedef struct _Ecordova_Test_Case Ecordova_Test_Case;
@@ -43,15 +43,15 @@ struct _Ecordova_Test_Case
43}; 43};
44 44
45static const Ecordova_Test_Case etc[] = { 45static const Ecordova_Test_Case etc[] = {
46 //{ "contacts", ecordova_contacts_test }, 46 { "contacts", ecordova_contacts_test },
47 /* { "device", ecordova_device_test }, */ 47 { "device", ecordova_device_test },
48 /* { "devicemotion", ecordova_devicemotion_test }, */ 48 { "devicemotion", ecordova_devicemotion_test },
49 /* { "deviceorientation", ecordova_deviceorientation_test }, */ 49 { "deviceorientation", ecordova_deviceorientation_test },
50 /* { "geolocation", ecordova_geolocation_test }, */ 50 { "geolocation", ecordova_geolocation_test },
51 /* { "batterystatus", ecordova_batterystatus_test }, */ 51 { "batterystatus", ecordova_batterystatus_test },
52 { "console", ecordova_console_test }, 52 { "console", ecordova_console_test },
53 { "filetransfer", ecordova_filetransfer_test }, 53 { "filetransfer", ecordova_filetransfer_test },
54 /* { "media", ecordova_media_test }, */ 54 { "media", ecordova_media_test },
55 /* { "networkinformation", ecordova_networkinformation_test }, */ 55 /* { "networkinformation", ecordova_networkinformation_test }, */
56 /* { "vibration", ecordova_vibration_test }, */ 56 /* { "vibration", ecordova_vibration_test }, */
57 { "directoryreader", ecordova_directoryreader_test }, 57 { "directoryreader", ecordova_directoryreader_test },
diff --git a/src/tests/ecordova/ecordova_vibration_test.c b/src/tests/ecordova/ecordova_vibration_test.c
index aaf228da4d..38f761504e 100644
--- a/src/tests/ecordova/ecordova_vibration_test.c
+++ b/src/tests/ecordova/ecordova_vibration_test.c
@@ -2,10 +2,11 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include "ecordova_vibration_test.h" 5#include <Ecordova.h>
6
6#include "ecordova_suite.h" 7#include "ecordova_suite.h"
7 8
8#include <stdbool.h> 9#include <check.h>
9 10
10static void 11static void
11_setup(void) 12_setup(void)
@@ -21,6 +22,7 @@ _teardown(void)
21 ck_assert_int_eq(ret, 0); 22 ck_assert_int_eq(ret, 0);
22} 23}
23 24
25#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
24static Ecordova_Device * 26static Ecordova_Device *
25_vibration_new(void) 27_vibration_new(void)
26{ 28{
@@ -40,5 +42,20 @@ void
40ecordova_vibration_test(TCase *tc) 42ecordova_vibration_test(TCase *tc)
41{ 43{
42 tcase_add_checked_fixture(tc, _setup, _teardown); 44 tcase_add_checked_fixture(tc, _setup, _teardown);
43 //tcase_add_test(tc, smoke); // disabled: not supported on common profile 45 tcase_add_test(tc, smoke); // not supported on common profile
46}
47#else
48START_TEST(vibration_load_fail)
49{
50 Ecordova_Device *vibration = eo_add(ECORDOVA_VIBRATION_CLASS, NULL);
51 ck_assert_ptr_eq(vibration, NULL);
44} 52}
53END_TEST
54
55void
56ecordova_vibration_test(TCase *tc)
57{
58 tcase_add_checked_fixture(tc, _setup, _teardown);
59 tcase_add_test(tc, vibration_load_fail);
60}
61#endif
diff --git a/src/tests/ecordova/ecordova_vibration_test.h b/src/tests/ecordova/ecordova_vibration_test.h
deleted file mode 100644
index 84792a3a7e..0000000000
--- a/src/tests/ecordova/ecordova_vibration_test.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ECORDOVA_VIBRATION_TEST_H
2#define _ECORDOVA_VIBRATION_TEST_H
3
4#include <Ecordova.h>
5#include <check.h>
6
7void ecordova_vibration_test(TCase *);
8
9#endif