diff options
author | Felipe Magno de Almeida <felipe@expertisesolutions.com.br> | 2015-11-03 18:56:11 -0200 |
---|---|---|
committer | Felipe Magno de Almeida <felipe@expertisesolutions.com.br> | 2015-11-03 18:56:11 -0200 |
commit | ff27c7b1cefbe43c90299871464ca1fd3ae157c2 (patch) | |
tree | fa2686b6ec300d646337927af334d972f43b05a3 | |
parent | 308b29c3203d711474f1e7cd6b61ae96827d3e5e (diff) | |
download | efl-ff27c7b1cefbe43c90299871464ca1fd3ae157c2.tar.gz |
ecordova: Reorganization
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]) EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [eo]) EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [efl]) EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [ecore]) -#EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [ecore-evas]) -#EFL_INTERNAL_DEPEND_PKG([ECORDOVA], [ecore-file]) - -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_VCONF], [vconf]) -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_CONTACTS_SERVICE], [contacts-service2]) -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_INFO], [capi-system-info]) -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_SENSOR], [capi-system-sensor]) -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_LOCATION_MANAGER], [capi-location-manager]) -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_HAPTIC], [capi-system-haptic]) -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_NETWORK_CONNECTION], [capi-network-connection]) -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_METADATA_EXTRACTOR], [capi-media-metadata-extractor]) -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_PLAYER], [capi-media-player]) -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_RECORDER], [capi-media-recorder]) -#EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_BASE_UTILS_I18N], [capi-base-utils-i18n]) + +EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_CONTACTS_SERVICE], [contacts-service2]) +EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_INFO], [capi-system-info]) +EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_SENSOR], [capi-system-sensor]) +EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_LOCATION_MANAGER], [capi-location-manager]) +EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_HAPTIC], [capi-system-haptic]) +EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_NETWORK_CONNECTION], [capi-network-connection]) +EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_METADATA_EXTRACTOR], [capi-media-metadata-extractor]) +EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_PLAYER], [capi-media-player]) +EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_MEDIA_RECORDER], [capi-media-recorder]) +EFL_OPTIONAL_DEPEND_PKG([ECORDOVA], [${want_tizen}], [TIZEN_BASE_UTILS_I18N], [capi-base-utils-i18n]) #EFL_ADD_LIBS([ECORDOVA], [-lm]) 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 @@ #endif #include "ecordova_private.h" -/* #include "ecordova_systeminfo.eo.h" */ #include <unistd.h> #include <dlfcn.h> @@ -75,29 +74,9 @@ ecordova_init(void) if (!eo_init()) { ERR("Unable to initialize ecore"); - goto on_error_2; + goto on_error_3; } - /* if (!ecore_file_init()) */ - /* { */ - /* ERR("Unable to initialize ecore_file"); */ - /* goto on_error_3; */ - /* } */ - - /* if (!eio_init()) */ - /* { */ - /* ERR("Unable to initialize eio"); */ - /* goto on_error_4; */ - /* } */ - - /* _ecordova_systeminfo = eo_add(ECORDOVA_SYSTEMINFO_CLASS, NULL, */ - /* ecordova_systeminfo_constructor()); */ - /* if (!_ecordova_systeminfo) */ - /* { */ - /* ERR("Unable to initialize systeminfo service"); */ - /* goto on_error_4; */ - /* } */ - _ecordova_pfx = eina_prefix_new(NULL, ecordova_init, "ECORDOVA", "ecordova", "checkme", PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, @@ -111,14 +90,11 @@ ecordova_init(void) return _ecordova_init_count; on_error_4: -/* ecore_file_shutdown(); */ - + eo_shutdown(); on_error_3: ecore_shutdown(); - on_error_2: eina_log_domain_unregister(_ecordova_log_dom); - on_error_1: _ecordova_log_dom = -1; eina_shutdown(); @@ -128,9 +104,9 @@ on_error_1: EAPI int ecordova_shutdown(void) { - if (_ecordova_init_count <= 0) + if (_ecordova_init_count <= 0) { - ERR("Init count not greater than 0 in shutdown."); + ERR("init count not greater than 0 in shutdown."); _ecordova_init_count = 0; return 0; } @@ -138,6 +114,8 @@ ecordova_shutdown(void) if (--_ecordova_init_count) return _ecordova_init_count; + eina_prefix_free(_ecordova_pfx); + if(_registered_engines) { eina_array_free(_registered_engines); @@ -145,9 +123,6 @@ ecordova_shutdown(void) } eo_shutdown(); - /* eo_unref(_ecordova_systeminfo); */ - /* eio_shutdown(); */ - /* ecore_file_shutdown(); */ ecore_shutdown(); eina_log_domain_unregister(_ecordova_log_dom); _ecordova_log_dom = -1; @@ -254,7 +229,7 @@ void* ecordova_module_symbol_get(const char* symbol) static const Eo_Class *(*class_get)(void); \ if(!class_get) \ { \ - fprintf(stderr, "%s:%d\n", __func__, __LINE__); fflush(stderr); \ + fprintf(stderr, "%s:%d\n", __func__, __LINE__); fflush(stderr);\ class_get = ecordova_module_symbol_get(ECORDOVA_symbol(name)); \ if(!class_get) \ { \ @@ -262,7 +237,7 @@ void* ecordova_module_symbol_get(const char* symbol) return NULL; \ } \ } \ - fprintf(stderr, "%s:%d\n", __func__, __LINE__); fflush(stderr); \ + fprintf(stderr, "%s:%d symbol %p\n", __func__, __LINE__, class_get); fflush(stderr); \ return class_get(); \ } @@ -272,7 +247,17 @@ void* ecordova_module_symbol_get(const char* symbol) ECORDOVA_concat_op(ECORDOVA_concat_op(Ecordova_, name), _Data); +ECORDOVA_CLASS_GET(batterystatus) ECORDOVA_CLASS_GET(console) +ECORDOVA_CLASS_GET(contactaddress) +ECORDOVA_CLASS_GET(contact) +ECORDOVA_CLASS_GET(contacts) +ECORDOVA_CLASS_GET(contactfield) +ECORDOVA_CLASS_GET(contactname) +ECORDOVA_CLASS_GET(contactorganization) +ECORDOVA_CLASS_GET(device) +ECORDOVA_CLASS_GET(devicemotion) +ECORDOVA_CLASS_GET(deviceorientation) ECORDOVA_CLASS_GET(directoryentry) ECORDOVA_CLASS_GET(directoryreader) ECORDOVA_CLASS_GET(entry) @@ -281,8 +266,26 @@ ECORDOVA_CLASS_GET(filewriter) ECORDOVA_CLASS_GET(file) ECORDOVA_CLASS_GET(filereader) ECORDOVA_CLASS_GET(filetransfer) - +ECORDOVA_CLASS_GET(geolocation) +ECORDOVA_CLASS_GET(globalization) +ECORDOVA_CLASS_GET(inappbrowser) +ECORDOVA_CLASS_GET(media) +ECORDOVA_CLASS_GET(mediafile) +ECORDOVA_CLASS_GET(networkinformation) +ECORDOVA_CLASS_GET(systeminfo) +ECORDOVA_CLASS_GET(vibration) + +ECORDOVA_define_data(BatteryStatus) +ECORDOVA_define_data(ContactAddress) +ECORDOVA_define_data(Contact) +ECORDOVA_define_data(Contacts) +ECORDOVA_define_data(ContactField) +ECORDOVA_define_data(ContactName) +ECORDOVA_define_data(ContactOrganization) ECORDOVA_define_data(Console) +ECORDOVA_define_data(Device) +ECORDOVA_define_data(DeviceMotion) +ECORDOVA_define_data(DeviceOrientation) ECORDOVA_define_data(DirectoryEntry) ECORDOVA_define_data(DirectoryReader) ECORDOVA_define_data(Entry) @@ -291,6 +294,14 @@ ECORDOVA_define_data(FileWriter) ECORDOVA_define_data(File) ECORDOVA_define_data(FileReader) ECORDOVA_define_data(FileTransfer) +ECORDOVA_define_data(Geolocation) +ECORDOVA_define_data(Globalization) +ECORDOVA_define_data(InAppBrowser) +ECORDOVA_define_data(Media) +ECORDOVA_define_data(MediaFile) +ECORDOVA_define_data(NetworkInformation) +ECORDOVA_define_data(SystemInfo) +ECORDOVA_define_data(Vibration) #undef EO_DEFINE_CLASS #define EO_DEFINE_CLASS(...) @@ -298,12 +309,55 @@ ECORDOVA_define_data(FileTransfer) #undef EOAPI #define EOAPI EAPI +#include "ecordova_batterystatus.eo.h" +#include "ecordova_batterystatus.eo.c" +#include "ecordova_contactaddress.eo.h" +#include "ecordova_contactaddress.eo.c" +#include "ecordova_contact.eo.h" +#include "ecordova_contact.eo.c" +#include "ecordova_contactfield.eo.h" +#include "ecordova_contactfield.eo.c" +#include "ecordova_contactname.eo.h" +#include "ecordova_contactname.eo.c" +#include "ecordova_contactorganization.eo.h" +#include "ecordova_contactorganization.eo.c" +#include "ecordova_console.eo.h" #include "ecordova_console.eo.c" +#include "ecordova_device.eo.h" +#include "ecordova_device.eo.c" +#include "ecordova_devicemotion.eo.h" +#include "ecordova_devicemotion.eo.c" +#include "ecordova_deviceorientation.eo.h" +#include "ecordova_deviceorientation.eo.c" +#include "ecordova_directoryentry.eo.h" #include "ecordova_directoryentry.eo.c" +#include "ecordova_directoryreader.eo.h" #include "ecordova_directoryreader.eo.c" +#include "ecordova_entry.eo.h" #include "ecordova_entry.eo.c" +#include "ecordova_fileentry.eo.h" #include "ecordova_fileentry.eo.c" +#include "ecordova_filewriter.eo.h" #include "ecordova_filewriter.eo.c" +#include "ecordova_file.eo.h" #include "ecordova_file.eo.c" +#include "ecordova_filereader.eo.h" #include "ecordova_filereader.eo.c" +#include "ecordova_filetransfer.eo.h" #include "ecordova_filetransfer.eo.c" +#include "ecordova_geolocation.eo.h" +#include "ecordova_geolocation.eo.c" +#include "ecordova_globalization.eo.h" +#include "ecordova_globalization.eo.c" +#include "ecordova_inappbrowser.eo.h" +#include "ecordova_inappbrowser.eo.c" +#include "ecordova_media.eo.h" +#include "ecordova_media.eo.c" +#include "ecordova_mediafile.eo.h" +#include "ecordova_mediafile.eo.c" +#include "ecordova_networkinformation.eo.h" +#include "ecordova_networkinformation.eo.c" +#include "ecordova_systeminfo.eo.h" +#include "ecordova_systeminfo.eo.c" +#include "ecordova_vibration.eo.h" +#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; static Eina_Bool _ecordova_linux_init(void) { - fprintf(stderr, "%s:%s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); - + if (!eina_init()) + { + fputs("Ecordova: Unable to initialize eina\n", stderr); + goto on_error_1; + } + _ecordova_log_dom = eina_log_domain_register("ecordova_linux", EINA_COLOR_CYAN); if (_ecordova_log_dom < 0) { EINA_LOG_ERR("Unable to create an 'ecordova' log domain"); - //goto on_error_1; + goto on_error_2; } if (!ecore_file_init()) { ERR("Unable to initialize ecore_file"); - //goto on_error_3; + goto on_error_3; } if (!eio_init()) { ERR("Unable to initialize eio"); - //goto on_error_4; + goto on_error_4; } - return EINA_TRUE; + +on_error_4: + ecore_file_shutdown(); +on_error_3: + eina_log_domain_unregister(_ecordova_log_dom); +on_error_2: + eina_shutdown(); +on_error_1: + return EINA_FALSE; } static void _ecordova_linux_shutdown(void) { - fprintf(stderr, "%s:%s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); eio_shutdown(); ecore_file_shutdown(); + eina_log_domain_unregister(_ecordova_log_dom); + eina_shutdown(); } EINA_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 @@ # include <config.h> #endif +#ifdef HAVE_TIZEN_CONTACTS_SERVICE #include "ecordova_contact_private.h" #include "ecordova_contactname_private.h" @@ -1115,3 +1116,4 @@ _ecordova_contactorganizations_export(Eina_Array *organizations, } #include "ecordova_contact.eo.c" +#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 @@ # include <config.h> #endif +#ifdef HAVE_TIZEN_CONTACTS_SERVICE + #include "ecordova_contactaddress_private.h" #include "ecordova_contacts_record_utils.h" @@ -310,3 +312,5 @@ ecordova_contactaddress_clone(Ecordova_ContactAddress *other) } #include "ecordova_contactaddress.eo.c" + +#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 @@ # include <config.h> #endif +#ifdef HAVE_TIZEN_CONTACTS_SERVICE #include "ecordova_contactfield_private.h" #include "ecordova_contacts_record_utils.h" @@ -413,3 +414,4 @@ ecordova_contacturl_label2type(const char *label) } #include "ecordova_contactfield.eo.c" +#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 @@ # include <config.h> #endif +#ifdef HAVE_TIZEN_CONTACTS_SERVICE #include "ecordova_contactname_private.h" #include "ecordova_contact_private.h" #include "ecordova_contacts_record_utils.h" @@ -255,3 +256,4 @@ ecordova_contactname_clone(Ecordova_ContactName *other) #include "ecordova_contactname.eo.c" +#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 @@ # include <config.h> #endif +#ifdef HAVE_TIZEN_CONTACTS_SERVICE #include "ecordova_contactorganization_private.h" #include "ecordova_contacts_record_utils.h" @@ -230,3 +231,4 @@ ecordova_contactorganization_clone(Ecordova_ContactOrganization *other) } #include "ecordova_contactorganization.eo.c" +#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 @@ # include <config.h> #endif +#ifdef HAVE_TIZEN_CONTACTS_SERVICE #include "ecordova_contacts_private.h" #include "ecordova_contact_private.h" #include "ecordova_contacts_record_utils.h" @@ -517,3 +518,4 @@ on_error: } #include "ecordova_contacts.eo.c" +#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 @@ # include <config.h> #endif +#ifdef HAVE_TIZEN_CONTACTS_SERVICE #include "ecordova_contacts_record_utils.h" #include <Eina.h> @@ -119,3 +120,4 @@ clear_all_contact_record(contacts_record_h contacts_record, return true; } +#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 @@ #include "ecordova_device_private.h" +#ifdef HAVE_TIZEN_INFO #include <system/system_info.h> #define MY_CLASS ECORDOVA_DEVICE_CLASS @@ -105,3 +106,4 @@ _ecordova_device_version_get(Eo *obj EINA_UNUSED, Ecordova_Device_Data *pd) } #include "ecordova_device.eo.c" +#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 @@ # include <config.h> #endif +#ifdef HAVE_TIZEN_SENSOR #include "ecordova_devicemotion_private.h" #define MY_CLASS ECORDOVA_DEVICEMOTION_CLASS @@ -174,3 +175,4 @@ _hash_data_free(sensor_listener_h listener) } #include "ecordova_devicemotion.eo.c" +#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 @@ # include <config.h> #endif +#ifdef HAVE_TIZEN_SENSOR #include "ecordova_deviceorientation_private.h" #define MY_CLASS ECORDOVA_DEVICEORIENTATION_CLASS @@ -178,3 +179,4 @@ _hash_data_free(sensor_listener_h listener) } #include "ecordova_deviceorientation.eo.c" +#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 @@ # include <config.h> #endif +#ifdef TIZEN_LOCATION_MANAGER #include "ecordova_geolocation_private.h" #include <ecore_timer.eo.h> @@ -280,3 +281,4 @@ on_error_1: } #include "ecordova_geolocation.eo.c" +#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 @@ # include <config.h> #endif +#ifdef HAVE_TIZEN_BASE_UTILS_I18N #include "ecordova_globalization_private.h" #include <utils_i18n.h> @@ -1120,3 +1121,4 @@ _date_time_options_to_style(const Ecordova_Globalization_DateTimeOptions *option } #include "ecordova_globalization.eo.c" +#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) if (_ecordova_log_dom < 0) { EINA_LOG_ERR("Unable to create an 'ecordova' log domain"); - //goto on_error_1; + return EINA_FALSE; } return EINA_TRUE; @@ -28,6 +28,8 @@ _ecordova_tizen_init(void) static void _ecordova_tizen_shutdown(void) { + eina_log_domain_unregister(_ecordova_log_dom); + _ecordova_log_dom = -1; } EINA_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 @@ # include <config.h> #endif -#include "ecordova_batterystatus_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" -#include <stdbool.h> +#include <check.h> static void _setup(void) @@ -21,6 +22,7 @@ _teardown(void) ck_assert_int_eq(ret, 0); } +#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER static Ecordova_Device * _batterystatus_new(void) { @@ -42,3 +44,18 @@ ecordova_batterystatus_test(TCase *tc) tcase_add_checked_fixture(tc, _setup, _teardown); tcase_add_test(tc, smoke); } +#else +START_TEST(batterystatus_load_fail) +{ + Ecordova_Device *batterystatus = eo_add(ECORDOVA_BATTERYSTATUS_CLASS, NULL); + ck_assert_ptr_eq(batterystatus, NULL); +} +END_TEST + +void +ecordova_batterystatus_test(TCase *tc) +{ + tcase_add_checked_fixture(tc, _setup, _teardown); + tcase_add_test(tc, batterystatus_load_fail); +} +#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 @@ -#ifndef _ECORDOVA_BATTERYSTATUS_TEST_H -#define _ECORDOVA_BATTERYSTATUS_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_batterystatus_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_console_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" #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 @@ -#ifndef _ECORDOVA_CONSOLE_TEST_H -#define _ECORDOVA_CONSOLE_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_console_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_contacts_test.h" #include "ecordova_suite.h" #include <Ecore.h> #include <ecore_timer.eo.h> #include <Ecordova.h> -#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER +#include <check.h> + +#if defined(HAVE_TIZEN_CONFIGURATION_MANAGER) && defined(HAVE_TIZEN_CONTACTS_SERVICE) #include <contact.h> #define CHECK(x) {int ret = x; ck_assert_int_eq(CONTACTS_ERROR_NONE, ret);} @@ -247,15 +248,51 @@ START_TEST(find_by_name) eo_unref(contacts); } END_TEST -#endif void ecordova_contacts_test(TCase *tc) { -#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER tcase_add_checked_fixture(tc, _setup, _teardown); tcase_add_test(tc, find_all); tcase_add_test(tc, find_by_id); tcase_add_test(tc, find_by_name); -#endif } +#else +START_TEST(contacts_fail_load) +{ + ecordova_init(); + + fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); + Ecordova_Contacts *contacts = eo_add(ECORDOVA_CONTACTS_CLASS, NULL); + ck_assert_ptr_eq(contacts, NULL); + + fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); + Ecordova_Contact *contact = eo_add(ECORDOVA_CONTACT_CLASS, NULL); + ck_assert_ptr_eq(contact, NULL); + + fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); + Ecordova_ContactAddress *contact_address = eo_add(ECORDOVA_CONTACTADDRESS_CLASS, NULL); + ck_assert_ptr_eq(contact_address, NULL); + + fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); + Ecordova_ContactField *contact_field = eo_add(ECORDOVA_CONTACTFIELD_CLASS, NULL); + ck_assert_ptr_eq(contact_field, NULL); + + fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); + Ecordova_ContactName *contact_name = eo_add(ECORDOVA_CONTACTNAME_CLASS, NULL); + ck_assert_ptr_eq(contact_name, NULL); + + fprintf(stderr, "contacts_fail_load %s %s:%d\n", __func__, __FILE__, __LINE__); fflush(stderr); + Ecordova_ContactOrganization *contact_organization = eo_add(ECORDOVA_CONTACTORGANIZATION_CLASS, NULL); + ck_assert_ptr_eq(contact_organization, NULL); + + ecordova_shutdown(); +} +END_TEST + +void +ecordova_contacts_test(TCase *tc) +{ + tcase_add_test(tc, contacts_fail_load); +} +#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 @@ -#ifndef _ECORDOVA_CONTACTS_TEST_H -#define _ECORDOVA_CONTACTS_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_contacts_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_device_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" +#include <check.h> + static void _setup(void) { @@ -19,6 +22,7 @@ _teardown(void) ck_assert_int_eq(ret, 0); } +#if defined(HAVE_TIZEN_CONFIGURATION_MANAGER) && defined(HAVE_TIZEN_INFO) static Ecordova_Device * _device_new(void) { @@ -98,3 +102,18 @@ ecordova_device_test(TCase *tc) //tcase_add_test(tc, uuid_get); // disabled: returns NULL tcase_add_test(tc, version_get); } +#else +START_TEST(device_load_fail) +{ + Ecordova_Device *device = eo_add(ECORDOVA_DEVICE_CLASS, NULL); + ck_assert_ptr_eq(device, NULL); +} +END_TEST + +void +ecordova_device_test(TCase *tc) +{ + tcase_add_checked_fixture(tc, _setup, _teardown); + tcase_add_test(tc, device_load_fail); +} +#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 @@ -#ifndef _ECORDOVA_DEVICE_TEST_H -#define _ECORDOVA_DEVICE_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_device_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_devicemotion_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" -#include <stdbool.h> +#include <check.h> +#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER static void _setup(void) { @@ -87,3 +89,23 @@ ecordova_devicemotion_test(TCase *tc) tcase_add_test(tc, smoke); //tcase_add_test(tc, current_acceleration_get); // disabled: not supported } +#else +START_TEST(devicemotion_fail_load) +{ + ecordova_init(); + + Ecordova_Device *devicemotion + = eo_add(ECORDOVA_DEVICEMOTION_CLASS, NULL); + + ck_assert_ptr_eq(devicemotion, NULL); + + ecordova_shutdown(); +} +END_TEST + +void +ecordova_devicemotion_test(TCase *tc) +{ + tcase_add_test(tc, devicemotion_fail_load); +} +#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 @@ -#ifndef _ECORDOVA_DEVICEMOTION_TEST_H -#define _ECORDOVA_DEVICEMOTION_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_devicemotion_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_deviceorientation_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" -#include <stdbool.h> +#include <check.h> static void _setup(void) @@ -21,6 +22,7 @@ _teardown(void) ck_assert_int_eq(ret, 0); } +#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER static Ecordova_Device * _deviceorientation_new(void) { @@ -87,3 +89,19 @@ ecordova_deviceorientation_test(TCase *tc) tcase_add_test(tc, smoke); //tcase_add_test(tc, current_heading_get); // disabled: not supported } +#else +START_TEST(deviceorientation_fail_load) +{ + Ecordova_Device *deviceorientation = eo_add(ECORDOVA_DEVICEORIENTATION_CLASS, NULL); + + ck_assert_ptr_eq(deviceorientation, NULL); +} +END_TEST + +void +ecordova_deviceorientation_test(TCase *tc) +{ + tcase_add_checked_fixture(tc, _setup, _teardown); + tcase_add_test(tc, deviceorientation_fail_load); +} +#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 @@ -#ifndef _ECORDOVA_DEVICEORIENTATION_TEST_H -#define _ECORDOVA_DEVICEORIENTATION_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_deviceorientation_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_directoryentry_test.h" -#include "ecordova_entry_test.h" +#include "ecordova_file_tests.h" #include "ecordova_suite.h" #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 @@ # include <config.h> #endif -#include "ecordova_directoryreader_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" static 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 @@ -#ifndef _ECORDOVA_DIRECTORYREADER_TEST_H -#define _ECORDOVA_DIRECTORYREADER_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_directoryreader_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_entry_test.h" -#include "ecordova_directoryentry_test.h" +#include "ecordova_file_tests.h" #include "ecordova_suite.h" #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 @@ -#ifndef _ECORDOVA_ENTRY_TEST_H -#define _ECORDOVA_ENTRY_TEST_H - -#include <Ecordova.h> - -#include <check.h> - -#include <stdbool.h> - -void ecordova_entry_test(TCase *); -bool entry_remove(Ecordova_Entry *); -bool entry_do(Ecordova_Entry *, const Eo_Event_Description *, void(*)()); - -#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 @@ # include <config.h> #endif -#include "ecordova_file_test.h" +#include "ecordova_file_tests.h" #include "ecordova_suite.h" static 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 @@ -#ifndef _ECORDOVA_FILE_TEST_H -#define _ECORDOVA_FILE_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_file_test(TCase *); - -#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 @@ -#ifndef _ECORDOVA_DIRECTORYENTRY_TEST_H -#define _ECORDOVA_DIRECTORYENTRY_TEST_H +#ifndef ECORDOVA_FILE_TESTS_H +#define ECORDOVA_FILE_TESTS_H #include <Ecordova.h> @@ -9,7 +9,6 @@ #include <stdbool.h> -void ecordova_directoryentry_test(TCase *); Ecordova_DirectoryEntry *_create_tmpdir(Eina_Tmpstr **); Eina_Bool _timeout_cb(void *); Eina_Bool _entry_get_cb(void *, Eo *, const Eo_Event_Description *, void *); @@ -21,4 +20,15 @@ void check_exists(const char *url); void check_doesnt_exist(const char *url); Ecordova_DirectoryEntry *directoryentry_new(const char *, const char *, const char *); +bool entry_remove(Ecordova_Entry *); +bool entry_do(Ecordova_Entry *, const Eo_Event_Description *, void(*)()); + +Ecordova_FileEntry *create_tmpfile(Eina_Tmpstr **, unsigned char **, size_t *); +Ecordova_FileEntry *create_tmpfile_size(Eina_Tmpstr **, unsigned char **, size_t); +bool fileentry_file_get(Ecordova_FileEntry *, Ecordova_File **); +unsigned char * generate_random_buffer(size_t*); +unsigned char * generate_random_buffer_size(size_t); + +bool filereader_read(Ecordova_File *file, char **content, size_t *length); + #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 @@ # include <config.h> #endif -#include "ecordova_fileentry_test.h" -#include "ecordova_directoryentry_test.h" -#include "ecordova_entry_test.h" +#include "ecordova_file_tests.h" #include "ecordova_suite.h" #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 @@ -#ifndef _ECORDOVA_FILEENTRY_TEST_H -#define _ECORDOVA_FILEENTRY_TEST_H - -#include <Ecordova.h> - -#include <check.h> - -#include <stdbool.h> - -void ecordova_fileentry_test(TCase *); -Ecordova_FileEntry *create_tmpfile(Eina_Tmpstr **, unsigned char **, size_t *); -Ecordova_FileEntry *create_tmpfile_size(Eina_Tmpstr **, unsigned char **, size_t); -bool fileentry_file_get(Ecordova_FileEntry *, Ecordova_File **); -unsigned char * generate_random_buffer(size_t*); -unsigned char * generate_random_buffer_size(size_t); - -#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 @@ # include <config.h> #endif -#include "ecordova_filereader_test.h" -#include "ecordova_fileentry_test.h" -#include "ecordova_directoryentry_test.h" -#include "ecordova_entry_test.h" +#include "ecordova_file_tests.h" #include "ecordova_suite.h" #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 @@ -#ifndef _ECORDOVA_FILEREADER_TEST_H -#define _ECORDOVA_FILEREADER_TEST_H - -#include <Ecordova.h> - -#include <check.h> - -#include <stdbool.h> - -void ecordova_filereader_test(TCase *); -bool filereader_read(Ecordova_File *file, char **content, size_t *length); - -#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 @@ # include <config.h> #endif -#include "ecordova_filetransfer_test.h" -#include "ecordova_fileentry_test.h" -#include "ecordova_directoryentry_test.h" -#include "ecordova_entry_test.h" -#include "ecordova_filereader_test.h" +#include "ecordova_file_tests.h" #include "ecordova_suite.h" #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 @@ -#ifndef _ECORDOVA_FILETRANSFER_TEST_H -#define _ECORDOVA_FILETRANSFER_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_filetransfer_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_filewriter_test.h" -#include "ecordova_fileentry_test.h" -#include "ecordova_directoryentry_test.h" -#include "ecordova_entry_test.h" -#include "ecordova_filereader_test.h" +#include "ecordova_file_tests.h" #include "ecordova_suite.h" #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 @@ -#ifndef _ECORDOVA_FILEWRITER_TEST_H -#define _ECORDOVA_FILEWRITER_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_filewriter_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_geolocation_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" -#include <stdbool.h> +#include <check.h> static void _setup(void) @@ -21,6 +22,7 @@ _teardown(void) ck_assert_int_eq(ret, 0); } +#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER static Ecordova_Device * _geolocation_new(void) { @@ -91,3 +93,18 @@ ecordova_geolocation_test(TCase *tc) tcase_add_test(tc, smoke); //tcase_add_test(tc, current_position_get); // disabled: not supported } +#else +START_TEST(geolocation_fail_load) +{ + Ecordova_Device *geolocation = eo_add(ECORDOVA_GEOLOCATION_CLASS, NULL); + ck_assert_ptr_eq(geolocation, NULL); +} +END_TEST + +void +ecordova_geolocation_test(TCase *tc) +{ + tcase_add_checked_fixture(tc, _setup, _teardown); + tcase_add_test(tc, geolocation_fail_load); +} +#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 @@ -#ifndef _ECORDOVA_GEOLOCATION_TEST_H -#define _ECORDOVA_GEOLOCATION_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_geolocation_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_globalization_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" -#include <stdbool.h> +#include <check.h> static void _setup(void) @@ -21,6 +22,7 @@ _teardown(void) ck_assert_int_eq(ret, 0); } +#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER static Ecordova_Device * _globalization_new(void) { @@ -592,3 +594,18 @@ ecordova_globalization_test(TCase *tc) tcase_add_test(tc, string_to_date); tcase_add_test(tc, string_to_number); } +#else +START_TEST(globalization_fail_load) +{ + Ecordova_Globalization *globalization = eo_add(ECORDOVA_GLOBALIZATION_CLASS, NULL); + ck_assert_ptr_eq(globalization, NULL); +} +END_TEST + +void +ecordova_globalization_test(TCase *tc) +{ + tcase_add_checked_fixture(tc, _setup, _teardown); + tcase_add_test(tc, globalization_fail_load); +} +#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 @@ -#ifndef _ECORDOVA_GLOBALIZATION_TEST_H -#define _ECORDOVA_GLOBALIZATION_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_globalization_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_media_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" -#include <stdbool.h> +#include <check.h> static void _setup(void) @@ -21,6 +22,7 @@ _teardown(void) ck_assert_int_eq(ret, 0); } +#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER static Ecordova_Device * _media_new(void) { @@ -40,5 +42,20 @@ void ecordova_media_test(TCase *tc) { tcase_add_checked_fixture(tc, _setup, _teardown); - //tcase_add_test(tc, smoke); // disabled: not supported on common profile + tcase_add_test(tc, smoke); // not supported on common profile +} +#else +START_TEST(media_load_fail) +{ + Ecordova_Device *media = eo_add(ECORDOVA_MEDIA_CLASS, NULL); + ck_assert_ptr_eq(media, NULL); } +END_TEST + +void +ecordova_media_test(TCase *tc) +{ + tcase_add_checked_fixture(tc, _setup, _teardown); + tcase_add_test(tc, media_load_fail); +} +#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 @@ -#ifndef _ECORDOVA_MEDIA_TEST_H -#define _ECORDOVA_MEDIA_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_media_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_mediafile_test.h" -#include "ecordova_directoryentry_test.h" +#include "ecordova_file_tests.h" #include "ecordova_suite.h" #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 @@ -#ifndef _ECORDOVA_MEDIAFILE_TEST_H -#define _ECORDOVA_MEDIAFILE_TEST_H - -#include <Ecordova.h> - -#include <check.h> - -#include <stdbool.h> - -void ecordova_mediafile_test(TCase *); - -#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 @@ # include <config.h> #endif -#include "ecordova_networkinformation_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" -#include <stdbool.h> +#include <check.h> static void _setup(void) @@ -21,6 +22,7 @@ _teardown(void) ck_assert_int_eq(ret, 0); } +#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER static Ecordova_Device * _networkinformation_new(void) { @@ -40,5 +42,20 @@ void ecordova_networkinformation_test(TCase *tc) { tcase_add_checked_fixture(tc, _setup, _teardown); - //tcase_add_test(tc, smoke); // disabled: not supported on common profile + tcase_add_test(tc, smoke); // not supported on common profile +} +#else +START_TEST(networkinformation_load_fail) +{ + Ecordova_Device *networkinformation = eo_add(ECORDOVA_NETWORKINFORMATION_CLASS, NULL); + ck_assert_ptr_eq(networkinformation, NULL); } +END_TEST + +void +ecordova_networkinformation_test(TCase *tc) +{ + tcase_add_checked_fixture(tc, _setup, _teardown); + tcase_add_test(tc, networkinformation_load_fail); +} +#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 @@ -#ifndef _ECORDOVA_NETWORKINFORMATION_TEST_H -#define _ECORDOVA_NETWORKINFORMATION_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_networkinformation_test(TCase *); - -#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 @@ # include <config.h> #endif -/* #include "ecordova_contacts_test.h" */ -/* #include "ecordova_device_test.h" */ -/* #include "ecordova_devicemotion_test.h" */ -/* #include "ecordova_deviceorientation_test.h" */ -/* #include "ecordova_geolocation_test.h" */ -/* #include "ecordova_batterystatus_test.h" */ -#include "ecordova_console_test.h" -#include "ecordova_filetransfer_test.h" -/* #include "ecordova_media_test.h" */ -/* #include "ecordova_networkinformation_test.h" */ -/* #include "ecordova_vibration_test.h" */ -#include "ecordova_directoryreader_test.h" -#include "ecordova_directoryentry_test.h" -#include "ecordova_entry_test.h" -#include "ecordova_file_test.h" -#include "ecordova_fileentry_test.h" -#include "ecordova_filereader_test.h" -#include "ecordova_filewriter_test.h" -/* #include "ecordova_mediafile_test.h" */ -/* #include "ecordova_globalization_test.h" */ - #include <Eina.h> #include <stdbool.h> @@ -32,6 +11,27 @@ #include "ecordova_suite.h" +void ecordova_batterystatus_test(TCase *); +void ecordova_contacts_test(TCase *); +void ecordova_device_test(TCase *); +void ecordova_devicemotion_test(TCase *); +void ecordova_deviceorientation_test(TCase *); +void ecordova_geolocation_test(TCase *); +void ecordova_console_test(TCase *); +void ecordova_filetransfer_test(TCase *); +void ecordova_media_test(TCase *); +void ecordova_networkinformation_test(TCase *); +void ecordova_vibration_test(TCase *); +void ecordova_directoryreader_test(TCase *); +void ecordova_directoryentry_test(TCase *); +void ecordova_entry_test(TCase *); +void ecordova_file_test(TCase *); +void ecordova_fileentry_test(TCase *); +void ecordova_filereader_test(TCase *); +void ecordova_filewriter_test(TCase *); +void ecordova_mediafile_test(TCase *); +void ecordova_globalization_test(TCase *); + int _test_ecordova_log_dom = -1; typedef struct _Ecordova_Test_Case Ecordova_Test_Case; @@ -43,15 +43,15 @@ struct _Ecordova_Test_Case }; static const Ecordova_Test_Case etc[] = { - //{ "contacts", ecordova_contacts_test }, - /* { "device", ecordova_device_test }, */ - /* { "devicemotion", ecordova_devicemotion_test }, */ - /* { "deviceorientation", ecordova_deviceorientation_test }, */ - /* { "geolocation", ecordova_geolocation_test }, */ - /* { "batterystatus", ecordova_batterystatus_test }, */ + { "contacts", ecordova_contacts_test }, + { "device", ecordova_device_test }, + { "devicemotion", ecordova_devicemotion_test }, + { "deviceorientation", ecordova_deviceorientation_test }, + { "geolocation", ecordova_geolocation_test }, + { "batterystatus", ecordova_batterystatus_test }, { "console", ecordova_console_test }, { "filetransfer", ecordova_filetransfer_test }, - /* { "media", ecordova_media_test }, */ + { "media", ecordova_media_test }, /* { "networkinformation", ecordova_networkinformation_test }, */ /* { "vibration", ecordova_vibration_test }, */ { "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 @@ # include <config.h> #endif -#include "ecordova_vibration_test.h" +#include <Ecordova.h> + #include "ecordova_suite.h" -#include <stdbool.h> +#include <check.h> static void _setup(void) @@ -21,6 +22,7 @@ _teardown(void) ck_assert_int_eq(ret, 0); } +#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER static Ecordova_Device * _vibration_new(void) { @@ -40,5 +42,20 @@ void ecordova_vibration_test(TCase *tc) { tcase_add_checked_fixture(tc, _setup, _teardown); - //tcase_add_test(tc, smoke); // disabled: not supported on common profile + tcase_add_test(tc, smoke); // not supported on common profile +} +#else +START_TEST(vibration_load_fail) +{ + Ecordova_Device *vibration = eo_add(ECORDOVA_VIBRATION_CLASS, NULL); + ck_assert_ptr_eq(vibration, NULL); } +END_TEST + +void +ecordova_vibration_test(TCase *tc) +{ + tcase_add_checked_fixture(tc, _setup, _teardown); + tcase_add_test(tc, vibration_load_fail); +} +#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 @@ -#ifndef _ECORDOVA_VIBRATION_TEST_H -#define _ECORDOVA_VIBRATION_TEST_H - -#include <Ecordova.h> -#include <check.h> - -void ecordova_vibration_test(TCase *); - -#endif |