From 5c13a0a429cd65381b72e23e16a0692b6bf8fec7 Mon Sep 17 00:00:00 2001 From: "kj7.sung" Date: Fri, 31 Jul 2015 18:36:46 +0900 Subject: [PATCH] Code sync with tizen_2.4 Change-Id: Ic4a917ce18d570f5d7e0c9b84dbc1a3a3839f989 Signed-off-by: kj7.sung --- capi-maps-service.changes | 15 ++++ doc/maps_plugin_doc.h | 2 +- include/maps_extra_types.h | 6 +- include/maps_place.h | 4 +- include/maps_place_category.h | 96 +++++++++++++++++++++-- include/maps_place_category_plugin.h | 122 ----------------------------- include/maps_place_plugin.h | 1 + include/maps_place_url.h | 4 +- include/maps_plugin.h | 3 +- include/maps_preference.h | 2 +- include/maps_route.h | 3 +- include/maps_route_maneuver.h | 2 +- include/maps_route_plugin.h | 1 + include/maps_route_segment.h | 4 +- include/maps_route_segment_plugin.h | 2 +- include/maps_service.h | 32 +++----- packaging/capi-maps-service.spec | 5 +- src/api/maps_place_category.cpp | 2 +- src/api/maps_preference.cpp | 3 - src/api/maps_route.cpp | 7 +- src/api/maps_route_segment.cpp | 4 +- src/api/maps_service.cpp | 47 +++++++----- src/maps_util.h | 26 ++++--- src/plugin/module.cpp | 4 +- src/session/command.h | 4 +- src/session/commands.cpp | 27 ++++--- test/src/api/maps_api_test.cpp | 123 +++++++++++++++++++----------- test/src/api/maps_area_test.cpp | 24 +----- test/src/api/maps_place_category_test.cpp | 2 +- test/src/api/maps_place_test.cpp | 2 +- test/src/util/maps_object.h | 2 +- 31 files changed, 293 insertions(+), 288 deletions(-) delete mode 100644 include/maps_place_category_plugin.h diff --git a/capi-maps-service.changes b/capi-maps-service.changes index 7d7b30c..5788da4 100644 --- a/capi-maps-service.changes +++ b/capi-maps-service.changes @@ -1,3 +1,18 @@ +[Version] capi-location-manager_0.4.2 +[Date] 22 July 2015 +[Title] Removed "resident" mode of plugin binaries; it allowed to release memory properly when many instances of Maps Service are used +[Developer] Alexey Shulga + +[Version] capi-location-manager_0.4.1 +[Date] 17 July 2015 +[Title] Changed parameter checks in Maps API requsts: preference allowed to be NULL +[Developer] Alexey Shulga + +[Version] capi-location-manager_0.4.0 +[Date] 14 July 2015 +[Title] [ACR-309] [2.4][capi-maps-service][Modify] Visibility of some APIs of Maps was changed +[Developer] Young-Ae Kang + [Version] capi-location-manager_0.3.2 [Date] 27 May 2015 [Title] [ACR-248][2.4][capi-maps-service][Modify] The name of API was changed. diff --git a/doc/maps_plugin_doc.h b/doc/maps_plugin_doc.h index 34b8efe..21a7e25 100644 --- a/doc/maps_plugin_doc.h +++ b/doc/maps_plugin_doc.h @@ -32,4 +32,4 @@ * The Maps Plugin provides maps service providers with interfaces to realize * Maps Service APIs. */ -#endif /*__MAPS_PLUGIN_DOC_H__ */ \ No newline at end of file +#endif /*__MAPS_PLUGIN_DOC_H__ */ diff --git a/include/maps_extra_types.h b/include/maps_extra_types.h index 033e9db..a709d0e 100644 --- a/include/maps_extra_types.h +++ b/include/maps_extra_types.h @@ -20,7 +20,7 @@ #include /** - * @ingroup CAPI_MAPS_PREFERENCE_MODULE + * @ingroup CAPI_MAPS_PLUGIN_AND_PROVIDERS_MODULE * @defgroup CAPI_MAPS_CONTAINERS_MODULE Container Data Types * * @file maps_extra_types.h @@ -868,7 +868,7 @@ int maps_item_hashtable_set_string(maps_item_hashtable_h table, /** * @brief Sets the association between string key and integer value in the * table. - * @details This sunction sets the association between string key and integer + * @details This function sets the association between string key and integer * value in the Hash Table. * @since_tizen 2.4 * @remark New instances of key and value will be put to the table. The key and @@ -1012,7 +1012,7 @@ int maps_item_hashtable_get_string(maps_item_hashtable_h table, /** * @brief Gets the association between string key and integer value in the * table. - * @details This sunction gets the association between string key and integer + * @details This function gets the association between string key and integer * value in the Hash Table. * @since_tizen 2.4 * diff --git a/include/maps_place.h b/include/maps_place.h index 0050c31..13f9ec6 100644 --- a/include/maps_place.h +++ b/include/maps_place.h @@ -17,6 +17,7 @@ #ifndef __MAPS_PLACE_H__ #define __MAPS_PLACE_H__ +#include #include #include #include @@ -27,7 +28,6 @@ #include #include #include -#include /** * @ingroup CAPI_MAPS_PLACE_MODULE @@ -542,7 +542,7 @@ int maps_place_foreach_image(const maps_place_h place, * * @param[in] place The place handle * @param[in] callback The callback function to invoke - * @param[in] user_data TThe user data to be passed to the callback + * @param[in] user_data The user data to be passed to the callback * function * @return 0 on success, otherwise a negative error value * @retval #MAPS_ERROR_NONE Successful diff --git a/include/maps_place_category.h b/include/maps_place_category.h index 49bf8a2..8637191 100644 --- a/include/maps_place_category.h +++ b/include/maps_place_category.h @@ -50,20 +50,24 @@ typedef void *maps_place_category_h; /*----------------------------------------------------------------------------*/ /** - * @brief Destroys the place category handle and releases all its - * resources. - * @details This function destroys the place category handle and releases all - * its resources. + * @brief Creates a new place category handle. + * @details This function creates a new place category handle and allocates all + * needed resources. * @since_tizen 2.4 + * @remarks @a category must be released using maps_place_category_destroy(). + * \n @a category may be cloned using maps_place_category_clone(). * - * @param[in] category The place category handle to destroy + * @param[out] category A handle of a new place category on success * @return 0 on success, otherwise a negative error value * @retval #MAPS_ERROR_NONE Successful + * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter * + * @see maps_place_category_destroy() * @see maps_place_category_clone() */ -int maps_place_category_destroy(maps_place_category_h category); +int maps_place_category_create(maps_place_category_h *category); + /** * @brief Clones the place category handle. @@ -82,11 +86,89 @@ int maps_place_category_destroy(maps_place_category_h category); * @see maps_place_category_destroy() */ int maps_place_category_clone(const maps_place_category_h origin, - maps_place_category_h *cloned); + maps_place_category_h *cloned); + + +/** + * @brief Destroys the place category handle and releases all its + * resources. + * @details This function destroys the place category handle and releases all + * its resources. + * @since_tizen 2.4 + * + * @param[in] category The place category handle to destroy + * @return 0 on success, otherwise a negative error value + * @retval #MAPS_ERROR_NONE Successful + * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see maps_place_category_clone() + */ +int maps_place_category_destroy(maps_place_category_h category); + /*----------------------------------------------------------------------------*/ /** + * @brief Sets the place category id. + * @details This function sets the place category id. + * @since_tizen 2.4 + * + * @param[in] category The handle of place category + * @param[in] id The place category id + * @return 0 on success, otherwise a negative error value + * @retval #MAPS_ERROR_NONE Successful + * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @pre @a category is created using maps_place_category_create(). + * + * @see maps_place_category_create() + * @see maps_place_category_get_id() + */ +int maps_place_category_set_id(maps_place_category_h category, + const char *id); + + +/** + * @brief Sets the place category name. + * @details This function sets the place category name. + * @since_tizen 2.4 + * + * @param[in] category The handle of place category + * @param[in] name The place category name + * @return 0 on success, otherwise a negative error value + * @retval #MAPS_ERROR_NONE Successful + * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @pre @a category is created using maps_place_category_create(). + * + * @see maps_place_category_create() + * @see maps_place_category_get_name() + */ +int maps_place_category_set_name(maps_place_category_h category, + const char *name); + + +/** + * @brief Sets the place category URL. + * @details This function sets the place category URL. + * @since_tizen 2.4 + * + * @param[in] category The handle of place category + * @param[in] url The place category URL + * @return 0 on success, otherwise a negative error value + * @retval #MAPS_ERROR_NONE Successful + * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @pre @a category is created using maps_place_category_create(). + * + * @see maps_place_category_create() + * @see maps_place_category_get_url() + */ +int maps_place_category_set_url(maps_place_category_h category, + const char *url); + + +/** * @brief Gets the place category id. * @details This function gets the place category id. * @since_tizen 2.4 diff --git a/include/maps_place_category_plugin.h b/include/maps_place_category_plugin.h deleted file mode 100644 index 5bbee13..0000000 --- a/include/maps_place_category_plugin.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __MAPS_PLACE_CATEGORY_PLUGIN_H__ -#define __MAPS_PLACE_CATEGORY_PLUGIN_H__ - -#include - -/** - * @ingroup CAPI_MAPS_PLUGIN_PLACE_MODULE - * @defgroup CAPI_MAPS_PLUGIN_PLACE_CATEGORY_MODULE Category - * - * @file maps_place_category_plugin.h - * @brief This file contains the functions related to Place Category - * information, needed in plug-in development. - * - * @addtogroup CAPI_MAPS_PLUGIN_PLACE_CATEGORY_MODULE - * @{ - * @brief This provides APIs related to place Category information, - * used in Place Discovery and Search, needed in plug-in development. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Creates a new place category handle. - * @details This function creates a new place category handle and allocates all - * needed resources. - * @since_tizen 2.4 - * @remarks @a category must be released using maps_place_category_destroy(). - * \n @a category may be cloned using maps_place_category_clone(). - * - * @param[out] category A handle of a new place category on success - * @return 0 on success, otherwise a negative error value - * @retval #MAPS_ERROR_NONE Successful - * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter - * - * @see maps_place_category_destroy() - * @see maps_place_category_clone() - */ -int maps_place_category_create(maps_place_category_h *category); - -/** - * @brief Sets the place category id. - * @details This function sets the place category id. - * @since_tizen 2.4 - * - * @param[in] category The handle of place category - * @param[in] id The place category id - * @return 0 on success, otherwise a negative error value - * @retval #MAPS_ERROR_NONE Successful - * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter - * - * @pre @a category is created using maps_place_category_create(). - * - * @see maps_place_category_create() - * @see maps_place_category_get_id() - */ -int maps_place_category_set_id(maps_place_category_h category, - const char *id); - -/** - * @brief Sets the place category name. - * @details This function sets the place category name. - * @since_tizen 2.4 - * - * @param[in] category The handle of place category - * @param[in] name The place category name - * @return 0 on success, otherwise a negative error value - * @retval #MAPS_ERROR_NONE Successful - * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter - * - * @pre @a category is created using maps_place_category_create(). - * - * @see maps_place_category_create() - * @see maps_place_category_get_name() - */ -int maps_place_category_set_name(maps_place_category_h category, - const char *name); - -/** - * @brief Sets the place category URL. - * @details This function sets the place category URL. - * @since_tizen 2.4 - * - * @param[in] category The handle of place category - * @param[in] url The place category URL - * @return 0 on success, otherwise a negative error value - * @retval #MAPS_ERROR_NONE Successful - * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter - * - * @pre @a category is created using maps_place_category_create(). - * - * @see maps_place_category_create() - * @see maps_place_category_get_url() - */ -int maps_place_category_set_url(maps_place_category_h category, - const char *url); - -#ifdef __cplusplus -} -#endif -/** - * @} - */ -#endif /* __MAPS_PLACE_CATEGORY_PLUGIN_H__ */ diff --git a/include/maps_place_plugin.h b/include/maps_place_plugin.h index 3711388..a1e71a4 100644 --- a/include/maps_place_plugin.h +++ b/include/maps_place_plugin.h @@ -18,6 +18,7 @@ #define __MAPS_PLACE_PLUGIN_H__ #include +#include /** * @ingroup CAPI_MAPS_PLUGIN_MODULE diff --git a/include/maps_place_url.h b/include/maps_place_url.h index 7835de2..47a31a8 100644 --- a/include/maps_place_url.h +++ b/include/maps_place_url.h @@ -100,8 +100,8 @@ int maps_place_url_clone(const maps_place_url_h origin, int maps_place_url_get_path(const maps_place_url_h url, char **path); /** - * @brief Gets the place URL desc. - * @details This function gets the place URL desc. + * @brief Gets the place URL description. + * @details This function gets the place URL description. * @since_tizen 2.4 * @remarks @a desc must be released using free(). * diff --git a/include/maps_plugin.h b/include/maps_plugin.h index 19b4ea3..e439613 100644 --- a/include/maps_plugin.h +++ b/include/maps_plugin.h @@ -19,6 +19,7 @@ #include #include +#include /** * @@ -50,7 +51,7 @@ typedef void *maps_plugin_h; */ /** - * @brief Init a new Maps Plugin. + * @brief Initialize a new Maps Plugin. * @details A maps plugin handle can be used to access a specified plugin. * @since_tizen 2.4 * @remarks @a plugin and it resources must be released in diff --git a/include/maps_preference.h b/include/maps_preference.h index d1d8643..6876915 100644 --- a/include/maps_preference.h +++ b/include/maps_preference.h @@ -409,7 +409,7 @@ int maps_preference_get_max_results(const maps_preference_h preference, * @brief Gets the country code. * @details This function gets the country code. * @since_tizen 2.4 - * @remarks @a countre_code must be released using free(). + * @remarks @a country_code must be released using free(). * * @param[in] preference The preference handle * @param[out] country_code The country code diff --git a/include/maps_route.h b/include/maps_route.h index f7239bb..ea7aa2b 100644 --- a/include/maps_route.h +++ b/include/maps_route.h @@ -17,8 +17,8 @@ #ifndef __MAPS_ROUTE_H__ #define __MAPS_ROUTE_H__ +#include #include -#include #include #include #include @@ -64,6 +64,7 @@ typedef void *maps_route_h; * * @param[in] index The current index of path point * @param[in] total The total amount of path points + * @param[in] coordinates The coordinates * @param[in] user_data The user data passed from * maps_route_foreach_path() * @return @c true to continue with the next iteration of the loop, \n @c diff --git a/include/maps_route_maneuver.h b/include/maps_route_maneuver.h index ba6615d..7285686 100755 --- a/include/maps_route_maneuver.h +++ b/include/maps_route_maneuver.h @@ -218,7 +218,7 @@ int maps_route_maneuver_get_instruction_text(const maps_route_maneuver_h char **instruction_text); /** - * @brief Gets the the route maneuver locale. + * @brief Gets the route maneuver locale. * @details This function gets the route maneuver locale. * @since_tizen 2.4 * @remarks @a locale must be released using free(). diff --git a/include/maps_route_plugin.h b/include/maps_route_plugin.h index 7aa15f5..fb54930 100644 --- a/include/maps_route_plugin.h +++ b/include/maps_route_plugin.h @@ -18,6 +18,7 @@ #define __MAPS_ROUTE_PLUGIN_H__ #include +#include /** * @ingroup CAPI_MAPS_PLUGIN_MODULE diff --git a/include/maps_route_segment.h b/include/maps_route_segment.h index 950310b..e042705 100644 --- a/include/maps_route_segment.h +++ b/include/maps_route_segment.h @@ -17,10 +17,10 @@ #ifndef __MAPS_SEGMENT_H__ #define __MAPS_SEGMENT_H__ +#include #include #include #include -#include /** * @ingroup CAPI_MAPS_ROUTE_MODULE @@ -141,7 +141,7 @@ int maps_route_segment_clone(const maps_route_segment_h origin, * @brief Gets the route segment origin. * @details This function gets the route segment origin. * @since_tizen 2.4 - * @remarks @a origin must be released using maps_cordinates_destroy(). + * @remarks @a origin must be released using maps_coordinates_destroy(). * * @param[in] segment The segment handle * @param[out] origin The origin of segment diff --git a/include/maps_route_segment_plugin.h b/include/maps_route_segment_plugin.h index 9566229..edcdf19 100644 --- a/include/maps_route_segment_plugin.h +++ b/include/maps_route_segment_plugin.h @@ -18,7 +18,7 @@ #define __MAPS_SEGMENT_PLUGIN_H__ #include - +#include /** * @ingroup CAPI_MAPS_PLUGIN_ROUTE_MODULE * @defgroup CAPI_MAPS_PLUGIN_ROUTE_SEGMENT_MODULE Segment diff --git a/include/maps_service.h b/include/maps_service.h index dc4bf9d..ff7bf0e 100644 --- a/include/maps_service.h +++ b/include/maps_service.h @@ -17,6 +17,7 @@ #ifndef __MAPS_SERVICE_H__ #define __MAPS_SERVICE_H__ +#include #include #include #include @@ -152,7 +153,7 @@ typedef bool(*maps_service_provider_info_cb) (char *maps_provider, * maps_service_provider_info_cb() callback. * @since_tizen 2.4 * - * @param[in] callback The callback function to receive avarilable Maps Providers + * @param[in] callback The callback function to receive available Maps Providers * information * @param[out] user_data The user data to be passed to the callback * function @@ -247,7 +248,7 @@ int maps_service_destroy(maps_service_h maps); * * @param[in] maps The Maps Service handle * @param[in] provider_key The Maps Key to be used - * \n In case of combinging two more strings, use slash("/") as a delimeter. + * \n In case of combining two more strings, use slash("/") as a delimiter. * \n e.g. For HERE "app_id/app_code" * @return 0 on success, otherwise a negative error value * @retval #MAPS_ERROR_NONE Successful @@ -532,8 +533,7 @@ typedef void (*maps_service_reverse_geocode_cb) (maps_error_e result, * @since_tizen 2.4 * @privlevel public * @privilege %http://tizen.org/privilege/mapservice - * @privilege %http://tizen.org/privilege/internet - * @remarks This function requires network access. + * @remarks %http://tizen.org/privilege/internet is needed to access internet. * \n To cancel the request use maps_service_cancel_request(). * \n To check if Maps Provider is capable of Geocoding and which Geocode * preferences are supported, see the lists of capacities and preferences above. @@ -583,8 +583,7 @@ int maps_service_geocode(const maps_service_h maps, const char *address, * @since_tizen 2.4 * @privlevel public * @privilege %http://tizen.org/privilege/mapservice - * @privilege %http://tizen.org/privilege/internet - * @remarks This function requires network access. + * @remarks %http://tizen.org/privilege/internet is needed to access internet. * \n Polygonal bounding box is not supported. * \n To cancel the request use maps_service_cancel_request(). * \n To check if Maps Provider is capable of Geocoding and which Geocode @@ -640,8 +639,7 @@ int maps_service_geocode_inside_area(const maps_service_h maps, * @since_tizen 2.4 * @privlevel public * @privilege %http://tizen.org/privilege/mapservice - * @privilege %http://tizen.org/privilege/internet - * @remarks This function requires network access. + * @remarks %http://tizen.org/privilege/internet is needed to access internet. * \n To cancel the request use maps_service_cancel_request(). * \n To check if Maps Provider is capable of Geocoding and which Geocode * preferences are supported see the lists of capacities and preferences above. @@ -693,8 +691,7 @@ int maps_service_geocode_by_structured_address(const maps_service_h maps, * @since_tizen 2.4 * @privlevel public * @privilege %http://tizen.org/privilege/mapservice - * @privilege %http://tizen.org/privilege/internet - * @remarks This function requires network access. + * @remarks %http://tizen.org/privilege/internet is needed to access internet. * \n To cancel the request use maps_service_cancel_request(). * \n To check if Maps Provider is capable of Reverse Geocoding and which * Reverse Geocode preferences are supported, see the lists of capacities and @@ -797,8 +794,7 @@ typedef bool(*maps_service_search_place_cb) (maps_error_e error, * @since_tizen 2.4 * @privlevel public * @privilege %http://tizen.org/privilege/mapservice - * @privilege %http://tizen.org/privilege/internet - * @remarks This function requires internet connection. + * @remarks %http://tizen.org/privilege/internet is needed to access internet. * \n To cancel the search request use maps_service_cancel_request(). * \n To check if Maps Provider is capable of Place Search and which Place * preferences are supported, see the lists of capacities and preferences above. @@ -852,8 +848,7 @@ int maps_service_search_place(const maps_service_h maps, * @since_tizen 2.4 * @privlevel public * @privilege %http://tizen.org/privilege/mapservice - * @privilege %http://tizen.org/privilege/internet - * @remarks This function requires network access. + * @remarks %http://tizen.org/privilege/internet is needed to access internet. * \n @a boundary is supporting only circle type bounds for search. * \n To cancel the search request use maps_service_cancel_request(). * \n To check if Maps Provider is capable of Place Search and which Place @@ -908,8 +903,7 @@ int maps_service_search_place_by_area(const maps_service_h maps, * @since_tizen 2.4 * @privlevel public * @privilege %http://tizen.org/privilege/mapservice - * @privilege %http://tizen.org/privilege/internet - * @remarks This function requires network access. + * @remarks %http://tizen.org/privilege/internet is needed to access internet. * \n @a boundary is supporting only circle type bounds for search. * \n To cancel the search request use maps_service_cancel_request(). * \n To check if Maps Provider is capable of Place Search and which Place @@ -1019,8 +1013,7 @@ typedef bool(*maps_service_search_route_cb) (maps_error_e error, * @since_tizen 2.4 * @privlevel public * @privilege %http://tizen.org/privilege/mapservice - * @privilege %http://tizen.org/privilege/internet - * @remarks This function requires network access. + * @remarks %http://tizen.org/privilege/internet is needed to access internet. * \n To cancel the search request use maps_service_cancel_request(). * \n To check if Maps Provider is capable of Route Search and which Route * preferences are supported, see the lists of capacities and preferences above. @@ -1068,8 +1061,7 @@ int maps_service_search_route(const maps_service_h maps, * @since_tizen 2.4 * @privlevel public * @privilege %http://tizen.org/privilege/mapservice - * @privilege %http://tizen.org/privilege/internet - * @remarks This function requires network access. + * @remarks %http://tizen.org/privilege/internet is needed to access internet. * \n To cancel the search request use maps_service_cancel_request(). * \n To check if Maps Provider is capable of Route Search and which Route * preferences are supported, see the lists of capacities and preferences above. diff --git a/packaging/capi-maps-service.spec b/packaging/capi-maps-service.spec index c806197..14caaf5 100644 --- a/packaging/capi-maps-service.spec +++ b/packaging/capi-maps-service.spec @@ -1,6 +1,6 @@ Name: capi-maps-service Summary: Tizen Maps Service API -Version: 0.3.3 +Version: 0.4.2 Release: 1 Group: Location/API License: Apache-2.0 @@ -79,6 +79,7 @@ This provides the Tizen Maps Service Library to access and handle the map data. %{_libdir}/libcapi-maps-service.so %exclude %{_includedir}/maps/maps_plugin*.h %exclude %{_includedir}/maps/maps_*_plugin.h +%exclude %{_includedir}/maps/maps_extra_types.h %package plugin-devel @@ -99,9 +100,9 @@ This provides the Tizen Map Service APIs to access and handle map data for the M %defattr(-,root,root,-) %{_includedir}/maps/maps_plugin*.h %{_includedir}/maps/maps_*plugin.h +%{_includedir}/maps/maps_extra_types.h -### Some API signatures are changed %package test Summary: Tizen Maps Service Library Test (Internal Dev) Group: Location/Testing diff --git a/src/api/maps_place_category.cpp b/src/api/maps_place_category.cpp index 997e0d2..130cac2 100755 --- a/src/api/maps_place_category.cpp +++ b/src/api/maps_place_category.cpp @@ -14,10 +14,10 @@ */ #include "maps_error.h" -#include "maps_place_category_plugin.h" #include "maps_extra_types.h" #include #include "maps_util.h" +#include "maps_place_category.h" typedef struct _maps_place_category_s { diff --git a/src/api/maps_preference.cpp b/src/api/maps_preference.cpp index 13ebc7f..4ce9e7b 100755 --- a/src/api/maps_preference.cpp +++ b/src/api/maps_preference.cpp @@ -225,9 +225,6 @@ EXPORT_API int maps_preference_get(const maps_preference_h preference, } - - - EXPORT_API int maps_preference_foreach_property(const maps_preference_h preference, maps_preference_properties_cb diff --git a/src/api/maps_route.cpp b/src/api/maps_route.cpp index b7b4400..4ddd9c4 100755 --- a/src/api/maps_route.cpp +++ b/src/api/maps_route.cpp @@ -14,20 +14,19 @@ * limitations under the License. */ +#include #include "maps_util.h" #include "maps_route_plugin.h" #include "maps_error.h" -#include "maps_place_category_plugin.h" -#include #include "maps_preference.h" #include "maps_route_segment_plugin.h" #include "maps_route_private.h" #include "maps_route_segment_private.h" -static bool __is_supported(const maps_route_h place, maps_service_data_e data) +static bool __is_supported(const maps_route_h route, maps_service_data_e data) { bool supported = false; - _maps_route_is_data_supported(place, data, &supported); + _maps_route_is_data_supported(route, data, &supported); return supported; } diff --git a/src/api/maps_route_segment.cpp b/src/api/maps_route_segment.cpp index d78880e..73c45e6 100755 --- a/src/api/maps_route_segment.cpp +++ b/src/api/maps_route_segment.cpp @@ -22,11 +22,11 @@ #include "maps_util.h" #include "maps_route_segment_private.h" -static bool __is_supported(const maps_route_segment_h place, +static bool __is_supported(const maps_route_segment_h route_segment, maps_service_data_e data) { bool supported = false; - _maps_route_segment_is_data_supported(place, data, &supported); + _maps_route_segment_is_data_supported(route_segment, data, &supported); return supported; } diff --git a/src/api/maps_service.cpp b/src/api/maps_service.cpp index 201f669..b7dcc86 100755 --- a/src/api/maps_service.cpp +++ b/src/api/maps_service.cpp @@ -135,7 +135,7 @@ EXPORT_API int maps_service_create(const char *maps_provider, /* 4. Initialize an output pointer to maps service */ *maps = maps_service; - /* 5. Set status of completelly correct plugin initialization */ + /* 5. Set status of completely correct plugin initialization */ error = MAPS_ERROR_NONE; } while (false); @@ -210,7 +210,8 @@ EXPORT_API int maps_service_provider_is_service_supported(const maps_service_h { if (not maps or not supported) return MAPS_ERROR_INVALID_PARAMETER; - if ((service < MAPS_SERVICE_GEOCODE) || (service > MAPS_SERVICE_CANCEL_REQUEST)) + if ((service < MAPS_SERVICE_GEOCODE) + || (service > MAPS_SERVICE_CANCEL_REQUEST)) return MAPS_ERROR_INVALID_PARAMETER; const plugin::plugin_s *p = __extract_plugin(maps); if (!p) @@ -226,7 +227,8 @@ EXPORT_API int maps_service_provider_is_data_supported(const maps_service_h { if (not maps or not supported) return MAPS_ERROR_INVALID_PARAMETER; - if ((data < MAPS_PLACE_ADDRESS) || (data > MAPS_ROUTE_SEGMENTS_MANEUVERS)) + if ((data < MAPS_PLACE_ADDRESS) + || (data > MAPS_ROUTE_SEGMENTS_MANEUVERS)) return MAPS_ERROR_INVALID_PARAMETER; const plugin::plugin_s *p = __extract_plugin(maps); if (!p) @@ -245,7 +247,8 @@ EXPORT_API int maps_service_geocode(const maps_service_h maps, void *user_data, int *request_id) { - if (!maps || !address || !preference || !callback || !request_id) + /*if (!maps || !address || !preference || !callback || !request_id)*/ + if (!maps || !address || !callback || !request_id) return MAPS_ERROR_INVALID_PARAMETER; if (not __maps_provider_supported(maps, MAPS_SERVICE_GEOCODE)) return MAPS_ERROR_NOT_SUPPORTED; @@ -260,8 +263,8 @@ EXPORT_API int maps_service_geocode_inside_area(const maps_service_h maps, maps_service_geocode_cb callback, void *user_data, int *request_id) { - if (!maps || !address || !bounds || !preference || !callback - || !request_id) + /*if (!maps || !address || !bounds || !preference || !callback*/ + if (!maps || !address || !bounds || !callback || !request_id) return MAPS_ERROR_INVALID_PARAMETER; if (not __maps_provider_supported(maps, MAPS_SERVICE_GEOCODE_INSIDE_AREA)) @@ -278,7 +281,8 @@ EXPORT_API int maps_service_geocode_by_structured_address(const maps_service_h maps_service_geocode_cb callback, void *user_data, int *request_id) { - if (!maps || !address || !preference || !callback || !request_id) + /*if (!maps || !address || !preference || !callback || !request_id)*/ + if (!maps || !address || !callback || !request_id) return MAPS_ERROR_INVALID_PARAMETER; if (not __maps_provider_supported(maps, MAPS_SERVICE_GEOCODE_BY_STRUCTURED_ADDRESS)) @@ -295,7 +299,12 @@ EXPORT_API int maps_service_reverse_geocode(const maps_service_h maps, callback, void * user_data, int *request_id) { - if (!maps || !preference || !callback || !request_id) + /*if (!maps || !preference || !callback || !request_id)*/ + if (!maps || !callback || !request_id) + return MAPS_ERROR_INVALID_PARAMETER; + if (latitude <= -90 && latitude >= 90) + return MAPS_ERROR_INVALID_PARAMETER; + if (longitude <= -180 && longitude >= 180) return MAPS_ERROR_INVALID_PARAMETER; if (not __maps_provider_supported(maps, MAPS_SERVICE_REVERSE_GEOCODE)) return MAPS_ERROR_NOT_SUPPORTED; @@ -316,8 +325,8 @@ EXPORT_API int maps_service_search_place(const maps_service_h maps, maps_service_search_place_cb callback, void *user_data, int *request_id) { - if (!maps || !position || !preference || !filter || !callback - || !request_id) + /*if (!maps || !position || !preference || !filter || !callback*/ + if (!maps || !position || !filter || !callback || !request_id) return MAPS_ERROR_INVALID_PARAMETER; if (not __maps_provider_supported(maps, MAPS_SERVICE_SEARCH_PLACE)) return MAPS_ERROR_NOT_SUPPORTED; @@ -336,8 +345,8 @@ EXPORT_API int maps_service_search_place_by_area(const maps_service_h maps, void *user_data, int *request_id) { - if (!maps || !boundary || !preference || !filter || !callback - || !request_id) + /*if (!maps || !boundary || !preference || !filter || !callback*/ + if (!maps || !boundary || !filter || !callback || !request_id) return MAPS_ERROR_INVALID_PARAMETER; if (not __maps_provider_supported(maps, MAPS_SERVICE_SEARCH_PLACE_BY_AREA)) @@ -359,8 +368,9 @@ EXPORT_API int maps_service_search_place_by_address(const maps_service_h maps, void *user_data, int *request_id) { - if (!maps || !address || !boundary || !preference || !filter - || !callback || !request_id) + /*if (!maps || !address || !boundary || !preference || !filter*/ + if (!maps || !address || !boundary || !filter || !callback + || !request_id) return MAPS_ERROR_INVALID_PARAMETER; if (not __maps_provider_supported(maps, MAPS_SERVICE_SEARCH_PLACE_BY_ADDRESS)) @@ -381,8 +391,8 @@ EXPORT_API int maps_service_search_route(const maps_service_h maps, maps_service_search_route_cb callback, void *user_data, int *request_id) { - if (!maps || !preference || !origin || !destination || !callback - || !request_id) + /*if (!maps || !preference || !origin || !destination || !callback*/ + if (!maps || !origin || !destination || !callback || !request_id) return MAPS_ERROR_INVALID_PARAMETER; if (not __maps_provider_supported(maps, MAPS_SERVICE_SEARCH_ROUTE)) return MAPS_ERROR_NOT_SUPPORTED; @@ -400,8 +410,9 @@ EXPORT_API int maps_service_search_route_waypoints(const maps_service_h maps, void *user_data, int *request_id) { - if (!maps || !preference || !waypoint_list || (waypoint_num < 2) - || !callback || !request_id) + /*if (!maps || !preference || !waypoint_list || (waypoint_num < 2)*/ + if (!maps || !waypoint_list || (waypoint_num < 2) || !callback + || !request_id) return MAPS_ERROR_INVALID_PARAMETER; if (not __maps_provider_supported(maps, MAPS_SERVICE_SEARCH_ROUTE_WAYPOINTS)) diff --git a/src/maps_util.h b/src/maps_util.h index b27c1b6..bb31b58 100644 --- a/src/maps_util.h +++ b/src/maps_util.h @@ -100,18 +100,19 @@ int maps_get_string(const char *src, const int max_length, char **dst); /* Prevent utility highlights defects in std::vector and std::string, so * simplified versions of that classes are implemented */ -template < class T > class vector { - private: +template class vector { +private: GArray *parray; unsigned int current_size; - public: +public: vector() : parray(NULL), current_size(0) { - parray = g_array_new(false, false, sizeof(T*)); + parray = g_array_new(false, false, sizeof(T *)); } ~vector() { - if (!parray || (current_size == 0)) + /*if (!parray || (current_size == 0))*/ + if (!parray) return; for (unsigned int i = 0; i < current_size; i++) { T *item = g_array_index(parray, T *, i); @@ -122,7 +123,7 @@ template < class T > class vector { parray = NULL; current_size = 0; } - public: +public: void push_back(const T &value) { T *clone = new T(value); @@ -142,12 +143,13 @@ template < class T > class vector { class string { - private: +private: char *pstring; - public: +public: string() : pstring(NULL) { - } string(const char *pstr) : pstring(NULL) + } + string(const char *pstr) : pstring(NULL) { pstring = g_strdup(pstr); } @@ -160,7 +162,7 @@ class string g_free(pstring); pstring = NULL; } - public: +public: string &operator=(const string &s) { if (this != &s) { @@ -177,7 +179,7 @@ class string { return !(*this == s); } - public: +public: char *c_str() const { return pstring; @@ -188,4 +190,4 @@ class string } }; -#endif /* __MAPS_UTIL_H__ */ \ No newline at end of file +#endif /* __MAPS_UTIL_H__ */ diff --git a/src/plugin/module.cpp b/src/plugin/module.cpp index 16b8c86..160ea49 100755 --- a/src/plugin/module.cpp +++ b/src/plugin/module.cpp @@ -355,8 +355,8 @@ plugin::GMod *plugin::binary_extractor::gmod_new(const string &module_file, return NULL; } MAPS_LOGD("open module"); - if (is_resident) - g_module_make_resident(gmod->module); + /*if (is_resident) + g_module_make_resident(gmod->module);*/ return gmod; } diff --git a/src/session/command.h b/src/session/command.h index 74816c5..1caad94 100644 --- a/src/session/command.h +++ b/src/session/command.h @@ -36,7 +36,7 @@ namespace session public: static command empty_instance; private: - command() + command() { } /* Please, do not construct an empty object */ public: @@ -53,7 +53,7 @@ namespace session return &empty_instance; } protected: - plugin::interface_s *interface() const; + plugin::interface_s *interface() const; maps_plugin_h handle() const; public: plugin::plugin_s *plugin()const; diff --git a/src/session/commands.cpp b/src/session/commands.cpp index bf499fe..81d49ae 100755 --- a/src/session/commands.cpp +++ b/src/session/commands.cpp @@ -51,7 +51,8 @@ session::command_geocode::command_geocode(maps_service_h ms, const string a, *request_id = command::command_request_id++; my_req_id = *request_id; - if (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE) + if (pref && + (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE)) error = MAPS_ERROR_INVALID_PARAMETER; } @@ -177,7 +178,8 @@ session::command_geocode_inside_bounds::command_geocode_inside_bounds( if (maps_area_clone(b, &bounds) != MAPS_ERROR_NONE) error = MAPS_ERROR_INVALID_PARAMETER; - if (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE) + if (pref && + (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE)) error = MAPS_ERROR_INVALID_PARAMETER; } @@ -258,7 +260,8 @@ session::command_geocode_by_structured_address:: if (maps_address_clone(a, &address) != MAPS_ERROR_NONE) error = MAPS_ERROR_INVALID_PARAMETER; - if (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE) + if (pref && + (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE)) error = MAPS_ERROR_INVALID_PARAMETER; } @@ -335,7 +338,8 @@ session::command_reverse_geocode::command_reverse_geocode(maps_service_h ms, *request_id = command::command_request_id++; my_req_id = *request_id; - if (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE) + if (pref && + (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE)) error = MAPS_ERROR_INVALID_PARAMETER; } @@ -462,7 +466,8 @@ session::command_search_place::command_search_place(maps_service_h ms, if (maps_coordinates_clone(pos, &position) != MAPS_ERROR_NONE) error = MAPS_ERROR_INVALID_PARAMETER; - if (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE) + if (pref && + (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE)) error = MAPS_ERROR_INVALID_PARAMETER; if (maps_place_filter_clone(flt, &filter) != MAPS_ERROR_NONE) @@ -630,7 +635,8 @@ session::command_search_by_area_place::command_search_by_area_place( if (maps_area_clone(b, &boundary) != MAPS_ERROR_NONE) error = MAPS_ERROR_INVALID_PARAMETER; - if (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE) + if (pref && + (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE)) error = MAPS_ERROR_INVALID_PARAMETER; if (maps_place_filter_clone(flt, &filter) != MAPS_ERROR_NONE) @@ -721,7 +727,8 @@ session::command_search_by_address_place::command_search_by_address_place( if (maps_area_clone(b, &boundary) != MAPS_ERROR_NONE) error = MAPS_ERROR_INVALID_PARAMETER; - if (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE) + if (pref && + (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE)) error = MAPS_ERROR_INVALID_PARAMETER; if (maps_place_filter_clone(flt, &filter) != MAPS_ERROR_NONE) @@ -806,7 +813,8 @@ session::command_search_route::command_search_route(maps_service_h ms, *request_id = command::command_request_id++; my_req_id = *request_id; - if (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE) + if (pref && + (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE)) error = MAPS_ERROR_INVALID_PARAMETER; if (maps_coordinates_clone(orig, &origin) != MAPS_ERROR_NONE) @@ -893,7 +901,8 @@ session::command_search_route_waypoints::command_search_route_waypoints( *request_id = command::command_request_id++; my_req_id = *request_id; - if (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE) + if (pref && + (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE)) error = MAPS_ERROR_INVALID_PARAMETER; waypoint_list = new maps_coordinates_h[num]; diff --git a/test/src/api/maps_api_test.cpp b/test/src/api/maps_api_test.cpp index 51d2125..8841610 100755 --- a/test/src/api/maps_api_test.cpp +++ b/test/src/api/maps_api_test.cpp @@ -79,9 +79,9 @@ class test_env /* Chose the Plugin for testing */ test_plugin_type = - DUMMY /* Dummy plugin */ + /*DUMMY*/ /* Dummy plugin */ /*MAPQUEST*/ /* MapQuest plugin */ - /*HERE*/ /* Nokia Here Maps */ + HERE /* Nokia Here Maps */ ; i = get_plugin_info(test_plugin_type); @@ -307,9 +307,14 @@ void utc_maps_service_provider_is_service_supported_n(void) MAPS_ERROR_INVALID_PARAMETER); g_assert(!supported); - g_assert_cmpint(maps_service_provider_is_service_supported(e.m, + /*g_assert_cmpint(maps_service_provider_is_service_supported(e.m, (maps_service_e) (-1), &supported), ==, - MAPS_ERROR_INVALID_PARAMETER); + MAPS_ERROR_NOT_SUPPORTED);*/ + int error = maps_service_provider_is_service_supported(e.m, + (maps_service_e) (-1), &supported); + if (error != MAPS_ERROR_INVALID_PARAMETER) + __utc_print_error_string(error); + g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); g_assert(!supported); g_assert_cmpint(maps_service_provider_is_service_supported(e.m, @@ -426,6 +431,8 @@ static bool __utc_maps_service_geocode_cb(maps_error_e result, int request_id, { /*g_print("\n\n__utc_maps_service_geocode_cb [%d of %d]\n\n", index, total_count);*/ + if (result != MAPS_ERROR_NONE) + __utc_print_error_string(result); g_assert_cmpint(result, ==, MAPS_ERROR_NONE); test_env* e = (test_env*) user_data; @@ -497,9 +504,9 @@ void utc_maps_service_geocode_n(void) __utc_maps_service_geocode_cb, NULL, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_geocode(e.m, "Seoul", NULL, + /*error = maps_service_geocode(e.m, "Seoul", NULL, __utc_maps_service_geocode_cb, NULL, &e.rid); - g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); + g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER);*/ error = maps_service_geocode(e.m, "Seoul", e.p, NULL, NULL, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); @@ -576,9 +583,9 @@ void utc_maps_service_geocode_inside_area_n(void) __utc_maps_service_geocode_cb, NULL, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_geocode_inside_area(e.m, "Seoul", bounds, NULL, + /*error = maps_service_geocode_inside_area(e.m, "Seoul", bounds, NULL, __utc_maps_service_geocode_cb, NULL, &e.rid); - g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); + g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER);*/ error = maps_service_geocode_inside_area(e.m, "Seoul", bounds, e.p, NULL, NULL, &e.rid); @@ -647,9 +654,9 @@ void utc_maps_service_geocode_by_structured_address_n(void) __utc_maps_service_geocode_cb, NULL, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_geocode_by_structured_address(e.m, address, NULL, + /*error = maps_service_geocode_by_structured_address(e.m, address, NULL, __utc_maps_service_geocode_cb, NULL, &e.rid); - g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); + g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER);*/ error = maps_service_geocode_by_structured_address(e.m, address, e.p, NULL, NULL, &e.rid); @@ -695,9 +702,10 @@ static void __utc_maps_service_reverse_geocode_cb(maps_error_e result, g_print("\tdistrict\t: %s\n", district); g_free(district); - char *city; + char *city = NULL; if (maps_address_get_city(address, &city) == MAPS_ERROR_NONE) g_print("\tcity\t: %s\n", city); + g_free(city); char *state = NULL; if (maps_address_get_state(address, &state) == MAPS_ERROR_NONE) @@ -763,6 +771,8 @@ void utc_maps_service_reverse_geocode_p(void) int error = maps_service_reverse_geocode(e->m, 12.944594, 77.554303, e->p, __utc_maps_service_reverse_geocode_cb, (void*) e, &e->rid); + if (error != MAPS_ERROR_NONE) + __utc_print_error_string(error); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); e->wait_for_response(); @@ -784,9 +794,9 @@ void utc_maps_service_reverse_geocode_n(void) __utc_maps_service_reverse_geocode_cb, NULL, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_reverse_geocode(e.m, 11.1, 22.2, NULL, + /*error = maps_service_reverse_geocode(e.m, 11.1, 22.2, NULL, __utc_maps_service_reverse_geocode_cb, NULL, &e.rid); - g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); + g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER);*/ error = maps_service_reverse_geocode(e.m, 11.1, 22.2, e.p, __utc_maps_service_reverse_geocode_cb, NULL, NULL); @@ -824,6 +834,7 @@ void utc_maps_cancel_geocode_p(void) void utc_maps_cancel_geocode_p02(void) { + /* TODO: figure out, why it is failed with MapQuest Plugin */ test_env e; maps_item_hashtable_set_string(e.p, "no_need_callback", @@ -1041,9 +1052,11 @@ static bool __utc_maps_service_search_place_cb(maps_error_e error, int request_id, int index, int length, maps_place_h place_h, void* user_data) { - if(error != MAPS_ERROR_NONE) + + if((error != MAPS_ERROR_NONE) && (error != MAPS_ERROR_NOT_FOUND)) { __utc_print_error_string(error); - g_assert_cmpint(error, ==, MAPS_ERROR_NONE); + g_assert_cmpint(error, ==, MAPS_ERROR_NONE); + } test_env* e = (test_env*) user_data; g_assert(e); @@ -1054,6 +1067,15 @@ static bool __utc_maps_service_search_place_cb(maps_error_e error, g_assert(index >= 0); g_assert(length > 0); + + if(error == MAPS_ERROR_NOT_FOUND) { + g_assert(index == 0); + g_assert(length == 1); + e->finish_response(); + return true; + } + + g_assert(place_h); maps::place place(place_h); @@ -1168,14 +1190,17 @@ void utc_maps_service_search_place_p(void) { test_env* e = new test_env; - maps::coordinates position(37.7942, -122.4070); + /*maps::coordinates position(37.7942, -122.4070);*/ + maps::coordinates position(37.7555302, 127.002253); maps::place_filter filter; int error = maps_place_filter_set_place_name(filter, "Seoul"); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); /* test start --------------------------------- */ - error = maps_service_search_place(e->m, position, 500, filter, e->p, + /* shlg, 20150716, as recommended by HERE Plugin developer, the distance + * is extended in 10 times to 50000 */ + error = maps_service_search_place(e->m, position, 50000, filter, e->p, __utc_maps_service_search_place_cb, (void*) e, &e->rid); if (error != MAPS_ERROR_NONE) __utc_print_error_string(error); @@ -1190,28 +1215,29 @@ void utc_maps_service_search_place_p(void) void utc_maps_service_search_place_n(void) { test_env e; - maps::coordinates position(37.7942, -122.4070); + /*maps::coordinates position(37.7942, -122.4070);*/ + maps::coordinates position(37.7555302, 127.002253); maps::place_filter filter; /* test start --------------------------------- */ int error = - maps_service_search_place(NULL, position, 500, filter, e.p, + maps_service_search_place(NULL, position, 5000, filter, e.p, __utc_maps_service_search_place_cb, &e, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_search_place(e.m, NULL, 500, filter, e.p, + error = maps_service_search_place(e.m, NULL, 5000, filter, e.p, __utc_maps_service_search_place_cb, &e, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_search_place(e.m, position, 500, filter, NULL, + /*error = maps_service_search_place(e.m, position, 5000, filter, NULL, __utc_maps_service_search_place_cb, &e, &e.rid); - g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); + g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER);*/ - error = maps_service_search_place(e.m, position, 500, NULL, e.p, + error = maps_service_search_place(e.m, position, 5000, NULL, e.p, __utc_maps_service_search_place_cb, &e, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_search_place(e.m, position, 500, filter, e.p, NULL, + error = maps_service_search_place(e.m, position, 5000, filter, e.p, NULL, &e, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); /* test finish --------------------------------- */ @@ -1230,13 +1256,16 @@ void utc_maps_service_search_place_by_area_p(void) g_assert_cmpint(error, ==, MAPS_ERROR_NONE); maps::place_category category; - error = maps_place_category_set_id(category, "eat-drink"); + //error = maps_place_category_set_id(category, "eat-drink"); + error = maps_place_category_set_id(category, "cafe"); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); error = maps_place_filter_set_category(filter, category); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); - maps::area area(37.7942 + 0.2, -122.407 - 0.2, 37.7942 - 0.2, - -122.407 + 0.2); + /*maps::area area(37.7942 + 0.2, -122.407 - 0.2, + 37.7942 - 0.2, -122.407 + 0.2);*/ + maps::area area(37.7555302 + 0.2, 127.002253 - 0.2, + 37.7555302 - 0.2, 127.002253 + 0.2); /* test start --------------------------------- */ error = maps_service_search_place_by_area(e->m, area, filter, e->p, @@ -1253,8 +1282,10 @@ void utc_maps_service_search_place_by_area_n(void) { test_env e; maps::place_filter filter; - maps::area area(37.7942 + 0.2, -122.407 - 0.2, 37.7942 - 0.2, - -122.407 + 0.2); + /*maps::area area(37.7942 + 0.2, -122.407 - 0.2, 37.7942 - 0.2, + -122.407 + 0.2);*/ + maps::area area(37.7555302 + 0.2, 127.002253 - 0.2, + 37.7555302 - 0.2, 127.002253 + 0.2); /* test start --------------------------------- */ int error = @@ -1266,9 +1297,9 @@ void utc_maps_service_search_place_by_area_n(void) __utc_maps_service_search_place_cb, &e, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_search_place_by_area(e.m, area, filter, NULL, + /*error = maps_service_search_place_by_area(e.m, area, filter, NULL, __utc_maps_service_search_place_cb, &e, &e.rid); - g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); + g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER);*/ error = maps_service_search_place_by_area(e.m, area, NULL, e.p, __utc_maps_service_search_place_cb, &e, &e.rid); @@ -1292,8 +1323,10 @@ void utc_maps_service_search_place_by_address_p(void) int error = maps_place_filter_set_place_name(filter, "Seoul"); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); - maps::area area(37.7942 + 0.2, -122.407 - 0.2, 37.7942 - 0.2, - -122.407 + 0.2); + maps::area area(37.7942 + 0.2, -122.407 - 0.2, + 37.7942 - 0.2, -122.407 + 0.2); + /*maps::area area(37.7555302 + 0.2, 127.002253 - 0.2, + 37.7555302 - 0.2, 127.002253 + 0.2);*/ /* test start --------------------------------- */ error = maps_service_search_place_by_address(e->m, "Jackson", area, @@ -1315,8 +1348,10 @@ void utc_maps_service_search_place_by_address_n(void) int error = maps_place_filter_set_place_name(filter, "Seoul"); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); - maps::area area(37.7942 + 0.2, -122.407 - 0.2, 37.7942 - 0.2, - -122.407 + 0.2); + /*maps::area area(37.7942 + 0.2, -122.407 - 0.2, 37.7942 - 0.2, + -122.407 + 0.2);*/ + maps::area area(37.7555302 + 0.2, 127.002253 - 0.2, + 37.7555302 - 0.2, 127.002253 + 0.2); /* test start --------------------------------- */ error = maps_service_search_place_by_address(NULL, "Seoul", area, @@ -1327,13 +1362,9 @@ void utc_maps_service_search_place_by_address_n(void) e.p, __utc_maps_service_search_place_cb, &e, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_search_place_by_address(e.m, "Seoul", filter, NULL, + /*error = maps_service_search_place_by_address(e.m, "Seoul", filter, NULL, filter, __utc_maps_service_search_place_cb, &e, &e.rid); - g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - - error = maps_service_search_place_by_address(e.m, "Seoul", area, filter, - NULL, __utc_maps_service_search_place_cb, &e, &e.rid); - g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); + g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER);*/ error = maps_service_search_place_by_address(e.m, "Seoul", area, NULL, e.p, __utc_maps_service_search_place_cb, &e, &e.rid); @@ -1365,7 +1396,7 @@ void utc_maps_cancel_place_p(void) int error = maps_place_filter_set_place_name(filter, "Seoul"); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); - error = maps_service_search_place(e.m, position, 500, filter, e.p, + error = maps_service_search_place(e.m, position, 5000, filter, e.p, __utc_maps_cancel_place_cb, (void*) &e, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); g_assert(e.rid > 0); @@ -1467,9 +1498,9 @@ void utc_maps_service_search_route_n(void) __utc_maps_service_search_route_cb, &e, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_search_route(e.m, origin, destination, NULL, + /*error = maps_service_search_route(e.m, origin, destination, NULL, __utc_maps_service_search_route_cb, &e, &e.rid); - g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); + g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER);*/ error = maps_service_search_route(e.m, NULL, destination, e.p, __utc_maps_service_search_route_cb, &e, &e.rid); @@ -1553,9 +1584,9 @@ void utc_maps_service_search_route_waypoints_n(void) __utc_maps_service_search_route_cb, &e, &e.rid); g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); - error = maps_service_search_route_waypoints(e.m, waypoint_list, 2, NULL, + /*error = maps_service_search_route_waypoints(e.m, waypoint_list, 2, NULL, __utc_maps_service_search_route_cb, &e, &e.rid); - g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER); + g_assert_cmpint(error, ==, MAPS_ERROR_INVALID_PARAMETER);*/ error = maps_service_search_route_waypoints(e.m, NULL, 2, e.p, __utc_maps_service_search_route_cb, &e, &e.rid); diff --git a/test/src/api/maps_area_test.cpp b/test/src/api/maps_area_test.cpp index 2678570..929bcbb 100644 --- a/test/src/api/maps_area_test.cpp +++ b/test/src/api/maps_area_test.cpp @@ -82,11 +82,7 @@ void utc_maps_area_create_rectangle_n(void) void utc_maps_area_create_circle_p(void) { maps_coordinates_h center = NULL; - int error = maps_coordinates_create(11.1, 22.2, -#if _MAPS_COORDS_3D_ - 33.3, -#endif - ¢er); + int error = maps_coordinates_create(11.1, 22.2, ¢er); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); maps_area_h area = NULL; @@ -104,11 +100,7 @@ void utc_maps_area_create_circle_p(void) void utc_maps_area_create_circle_n(void) { maps_coordinates_h center = NULL; - int error = maps_coordinates_create(11.1, 22.2, -#if _MAPS_COORDS_3D_ - 33.3, -#endif - ¢er); + int error = maps_coordinates_create(11.1, 22.2, ¢er); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); maps_area_h area = NULL; @@ -142,11 +134,7 @@ void utc_maps_area_clone_p(void) { /* Clone circular area */ maps_coordinates_h center = NULL; - int error = maps_coordinates_create(11.1, 22.2, -#if _MAPS_COORDS_3D_ - 33.3, -#endif - ¢er); + int error = maps_coordinates_create(11.1, 22.2, ¢er); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); maps_area_h area = NULL; @@ -206,11 +194,7 @@ void utc_maps_area_clone_p(void) void utc_maps_area_clone_n(void) { maps_coordinates_h center = NULL; - int error = maps_coordinates_create(11.1, 22.2, -#if _MAPS_COORDS_3D_ - 33.3, -#endif - ¢er); + int error = maps_coordinates_create(11.1, 22.2, ¢er); g_assert_cmpint(error, ==, MAPS_ERROR_NONE); maps_area_h area = NULL; diff --git a/test/src/api/maps_place_category_test.cpp b/test/src/api/maps_place_category_test.cpp index dc00dc0..b6a574d 100644 --- a/test/src/api/maps_place_category_test.cpp +++ b/test/src/api/maps_place_category_test.cpp @@ -15,7 +15,7 @@ */ #include "maps_place_category_test.h" -#include "maps_place_category_plugin.h" +#include "maps_place_category.h" #include "maps_error.h" #include diff --git a/test/src/api/maps_place_test.cpp b/test/src/api/maps_place_test.cpp index eb450ca..6fc095a 100644 --- a/test/src/api/maps_place_test.cpp +++ b/test/src/api/maps_place_test.cpp @@ -16,7 +16,7 @@ #include "maps_place_test.h" #include "maps_place_plugin.h" -#include "maps_place_category_plugin.h" +#include "maps_place_category.h" #include "maps_place_attribute_plugin.h" #include "maps_error.h" #include diff --git a/test/src/util/maps_object.h b/test/src/util/maps_object.h index 3b1e97b..357bd65 100644 --- a/test/src/util/maps_object.h +++ b/test/src/util/maps_object.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include -- 2.7.4