--- /dev/null
+#!/bin/sh
+
+. ./config
+export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+export TET_ROOT=$TET_TARGET_PATH
--- /dev/null
+#!/bin/sh
+
+. ./config
+export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to path
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+export TET_ROOT=$TET_TARGET_PATH
--- /dev/null
+#!/bin/sh
+
+. ./_export_env.sh # setting environment variables
+
+export TET_SUITE_ROOT=`pwd`
+FILE_NAME_EXTENSION=`date +%s`
+
+RESULT_DIR=results
+HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir -p $RESULT_DIR
+
+tcc -c -p ./
+tcc -b -j $JOURNAL_RESULT -p ./
+grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
--- /dev/null
+#!/bin/sh
+
+. ./_export_env.sh # setting environment variables
+
+export TET_SUITE_ROOT=`pwd`
+RESULT_DIR=results
+
+tcc -c -p ./ # executing tcc, with clean option (-c)
+rm -r $RESULT_DIR
+rm -r tet_tmp_dir
+rm testcase/tet_captured
--- /dev/null
+TET_INSTALL_HOST_PATH=/home/genie/git/tool/tetware/TETware
+TET_INSTALL_TARGET_PATH=/mnt/nfs/tool/tetware/TETware
--- /dev/null
+#!/bin/sh
+
+. ./_export_target_env.sh # setting environment variables
+
+export TET_SUITE_ROOT=`pwd`
+FILE_NAME_EXTENSION=`date +%s`
+
+RESULT_DIR=results
+HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir -p $RESULT_DIR
+
+tcc -e -j $JOURNAL_RESULT -p ./
+grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
--- /dev/null
+CC ?= gcc
+
+C_FILES = $(shell ls *.c)
+
+PKGS = capi-location-route dlog glib-2.0 gthread-2.0
+
+LDFLAGS = `pkg-config --libs $(PKGS)`
+LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
+
+CFLAGS = -I. `pkg-config --cflags $(PKGS)`
+CFLAGS += -I$(TET_ROOT)/inc/tet3
+CFLAGS += -Wall
+
+#TARGETS = $(C_FILES:%.c=tc-%)
+TCS := $(shell ls -1 *.c | cut -d. -f1)
+
+all: $(TCS)
+
+%: %.c
+ $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+
+clean:
+ rm -f $(TCS)
--- /dev/null
+/testcase/utc_location_route_service
+/testcase/utc_location_route_preference
+/testcase/utc_location_route
--- /dev/null
+/*
+* Copyright (c) 2011 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.
+*/
+
+#include <tet_api.h>
+
+#include <route_service.h>
+#include <route_preference.h>
+#include <route.h>
+#include <glib.h>
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup) (void) = startup;
+void (*tet_cleanup) (void) = cleanup;
+
+static void utc_location_route_clone_p(void);
+static void utc_location_route_clone_n(void);
+static void utc_location_route_destroy_p(void);
+static void utc_location_route_destroy_n(void);
+static void utc_location_route_get_request_id_p(void);
+static void utc_location_route_get_request_id_n(void);
+static void utc_location_route_get_request_id_n_02(void);
+static void utc_location_route_get_origin_p(void);
+static void utc_location_route_get_origin_n(void);
+static void utc_location_route_get_origin_n_02(void);
+static void utc_location_route_get_destination_p(void);
+static void utc_location_route_get_destination_n(void);
+static void utc_location_route_get_destination_n_02(void);
+static void utc_location_route_get_geometry_bounding_box_p(void);
+static void utc_location_route_get_geometry_bounding_box_n(void);
+static void utc_location_route_get_geometry_bounding_box_n_02(void);
+static void utc_location_route_get_geometry_bounding_box_n_03(void);
+static void utc_location_route_get_distance_unit_p(void);
+static void utc_location_route_get_distance_unit_n(void);
+static void utc_location_route_get_distance_unit_n_02(void);
+static void utc_location_route_get_total_distance_p(void);
+static void utc_location_route_get_total_distance_n(void);
+static void utc_location_route_get_total_distance_n_02(void);
+static void utc_location_route_get_total_duration_p(void);
+static void utc_location_route_get_total_duration_n(void);
+static void utc_location_route_get_total_duration_n_02(void);
+static void utc_location_route_foreach_properties_p(void);
+static void utc_location_route_foreach_properties_n(void);
+static void utc_location_route_foreach_properties_n_02(void);
+static void utc_location_route_foreach_segments_p(void);
+static void utc_location_route_foreach_segments_n(void);
+static void utc_location_route_foreach_segments_n_02(void);
+static void utc_location_route_segment_clone_p(void);
+static void utc_location_route_segment_clone_n(void);
+static void utc_location_route_segment_destroy_p(void);
+static void utc_location_route_segment_destroy_n(void);
+static void utc_location_route_segment_get_origin_p(void);
+static void utc_location_route_segment_get_origin_n(void);
+static void utc_location_route_segment_get_origin_n_02(void);
+static void utc_location_route_segment_get_destination_p(void);
+static void utc_location_route_segment_get_destination_n(void);
+static void utc_location_route_segment_get_destination_n_02(void);
+static void utc_location_route_segment_get_geometry_bounding_box_p(void);
+static void utc_location_route_segment_get_geometry_bounding_box_n(void);
+static void utc_location_route_segment_get_geometry_bounding_box_n_02(void);
+static void utc_location_route_segment_get_geometry_bounding_box_n_03(void);
+static void utc_location_route_segment_get_distance_p(void);
+static void utc_location_route_segment_get_distance_n(void);
+static void utc_location_route_segment_get_distance_n_02(void);
+static void utc_location_route_segment_get_duration_p(void);
+static void utc_location_route_segment_get_duration_n(void);
+static void utc_location_route_segment_get_duration_n_02(void);
+static void utc_location_route_segment_foreach_properties_p(void);
+static void utc_location_route_segment_foreach_properties_n(void);
+static void utc_location_route_segment_foreach_properties_n_02(void);
+static void utc_location_route_segment_foreach_steps_p(void);
+static void utc_location_route_segment_foreach_steps_n(void);
+static void utc_location_route_segment_foreach_steps_n_02(void);
+static void utc_location_route_step_clone_p(void);
+static void utc_location_route_step_clone_n(void);
+static void utc_location_route_step_destroy_p(void);
+static void utc_location_route_step_destroy_n(void);
+static void utc_location_route_step_get_origin_p(void);
+static void utc_location_route_step_get_origin_n(void);
+static void utc_location_route_step_get_origin_n_02(void);
+static void utc_location_route_step_get_destination_p(void);
+static void utc_location_route_step_get_destination_n(void);
+static void utc_location_route_step_get_destination_n_02(void);
+static void utc_location_route_step_get_geometry_bounding_box_p(void);
+static void utc_location_route_step_get_geometry_bounding_box_n(void);
+static void utc_location_route_step_get_geometry_bounding_box_n_02(void);
+static void utc_location_route_step_get_geometry_bounding_box_n_03(void);
+static void utc_location_route_step_get_distance_p(void);
+static void utc_location_route_step_get_distance_n(void);
+static void utc_location_route_step_get_distance_n_02(void);
+static void utc_location_route_step_get_duration_p(void);
+static void utc_location_route_step_get_duration_n(void);
+static void utc_location_route_step_get_duration_n_02(void);
+static void utc_location_route_step_get_transport_mode_p(void);
+static void utc_location_route_step_get_transport_mode_n(void);
+static void utc_location_route_step_get_transport_mode_n_02(void);
+static void utc_location_route_step_get_instruction_p(void);
+static void utc_location_route_step_get_instruction_n(void);
+static void utc_location_route_step_get_instruction_n_02(void);
+static void utc_location_route_step_foreach_geometries_p(void);
+static void utc_location_route_step_foreach_geometries_n(void);
+static void utc_location_route_step_foreach_geometries_n_02(void);
+static void utc_location_route_step_foreach_properties_p(void);
+static void utc_location_route_step_foreach_properties_n(void);
+static void utc_location_route_step_foreach_properties_n_02(void);
+
+struct tet_testlist tet_testlist[] = {
+ {utc_location_route_clone_p, POSITIVE_TC_IDX},
+ {utc_location_route_clone_n, NEGATIVE_TC_IDX},
+ {utc_location_route_destroy_p, POSITIVE_TC_IDX},
+ {utc_location_route_destroy_n, NEGATIVE_TC_IDX},
+ {utc_location_route_get_request_id_p, POSITIVE_TC_IDX},
+ {utc_location_route_get_request_id_n, NEGATIVE_TC_IDX},
+ {utc_location_route_get_request_id_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_get_origin_p, POSITIVE_TC_IDX},
+ {utc_location_route_get_origin_n, NEGATIVE_TC_IDX},
+ {utc_location_route_get_origin_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_get_destination_p, POSITIVE_TC_IDX},
+ {utc_location_route_get_destination_n, NEGATIVE_TC_IDX},
+ {utc_location_route_get_destination_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_get_geometry_bounding_box_p, POSITIVE_TC_IDX},
+ {utc_location_route_get_geometry_bounding_box_n, NEGATIVE_TC_IDX},
+ {utc_location_route_get_geometry_bounding_box_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_get_geometry_bounding_box_n_03, NEGATIVE_TC_IDX},
+ {utc_location_route_get_distance_unit_p, POSITIVE_TC_IDX},
+ {utc_location_route_get_distance_unit_n, NEGATIVE_TC_IDX},
+ {utc_location_route_get_distance_unit_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_get_total_distance_p, POSITIVE_TC_IDX},
+ {utc_location_route_get_total_distance_n, NEGATIVE_TC_IDX},
+ {utc_location_route_get_total_distance_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_get_total_duration_p, POSITIVE_TC_IDX},
+ {utc_location_route_get_total_duration_n, NEGATIVE_TC_IDX},
+ {utc_location_route_get_total_duration_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_foreach_properties_p, POSITIVE_TC_IDX},
+ {utc_location_route_foreach_properties_n, NEGATIVE_TC_IDX},
+ {utc_location_route_foreach_properties_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_foreach_segments_p, POSITIVE_TC_IDX},
+ {utc_location_route_foreach_segments_n, NEGATIVE_TC_IDX},
+ {utc_location_route_foreach_segments_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_clone_p, POSITIVE_TC_IDX},
+ {utc_location_route_segment_clone_n, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_destroy_p, POSITIVE_TC_IDX},
+ {utc_location_route_segment_destroy_n, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_origin_p, POSITIVE_TC_IDX},
+ {utc_location_route_segment_get_origin_n, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_origin_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_destination_p, POSITIVE_TC_IDX},
+ {utc_location_route_segment_get_destination_n, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_destination_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_geometry_bounding_box_p, POSITIVE_TC_IDX},
+ {utc_location_route_segment_get_geometry_bounding_box_n, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_geometry_bounding_box_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_geometry_bounding_box_n_03, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_distance_p, POSITIVE_TC_IDX},
+ {utc_location_route_segment_get_distance_n, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_distance_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_duration_p, POSITIVE_TC_IDX},
+ {utc_location_route_segment_get_duration_n, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_get_duration_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_foreach_properties_p, POSITIVE_TC_IDX},
+ {utc_location_route_segment_foreach_properties_n, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_foreach_properties_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_foreach_steps_p, POSITIVE_TC_IDX},
+ {utc_location_route_segment_foreach_steps_n, NEGATIVE_TC_IDX},
+ {utc_location_route_segment_foreach_steps_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_step_clone_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_clone_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_destroy_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_destroy_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_origin_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_get_origin_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_origin_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_destination_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_get_destination_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_destination_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_geometry_bounding_box_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_get_geometry_bounding_box_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_geometry_bounding_box_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_geometry_bounding_box_n_03, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_distance_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_get_distance_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_distance_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_duration_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_get_duration_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_duration_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_transport_mode_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_get_transport_mode_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_transport_mode_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_instruction_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_get_instruction_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_get_instruction_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_step_foreach_geometries_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_foreach_geometries_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_foreach_geometries_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_step_foreach_properties_p, POSITIVE_TC_IDX},
+ {utc_location_route_step_foreach_properties_n, NEGATIVE_TC_IDX},
+ {utc_location_route_step_foreach_properties_n_02, NEGATIVE_TC_IDX},
+
+ {NULL, 0},
+};
+
+static bool service_enabled = FALSE;
+
+static GMainLoop *g_mainloop = NULL;
+static GThread *event_thread;
+
+gpointer GmainThread(gpointer data)
+{
+ g_mainloop = g_main_loop_new(NULL, 0);
+ g_main_loop_run(g_mainloop);
+
+ return NULL;
+}
+
+static void validate_and_next(char *api_name, int act_ret, int ext_ret, char *fail_msg)
+{
+ dts_message(api_name, "Actual Result : %d, Expected Result : %d", act_ret, ext_ret);
+ if (act_ret != ext_ret) {
+ dts_message(api_name, "Fail Message: %s", fail_msg);
+ dts_fail(api_name);
+ }
+}
+
+static void validate_eq(char *api_name, int act_ret, int ext_ret)
+{
+ dts_message(api_name, "Actual Result : %d, Expected Result : %d", act_ret, ext_ret);
+ if (act_ret == ext_ret) {
+ dts_pass(api_name);
+ } else {
+ dts_fail(api_name);
+ }
+}
+
+static void wait_for_service(char *api_name)
+{
+ int timeout = 0;
+ for (timeout; timeout < 180; timeout++) {
+ if (service_enabled) {
+ dts_message(api_name, "Find Routes!!!!");
+ break;
+ } else {
+ dts_message(api_name, "Did not find Routes!!!!");
+ sleep(1);
+ }
+ }
+}
+
+static route_service_h g_service;
+static route_h g_route;
+static route_segment_h g_segment;
+static route_step_h g_step;
+
+static bool route_segment_step_callback(route_step_h step, void *user_data)
+{
+ if (step == NULL) {
+ return FALSE;
+ }
+
+ int ret = route_step_clone(&g_step, step);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_step_clone() is failed");
+ return TRUE;
+}
+
+static bool route_segment_callback(route_segment_h segment, void *user_data)
+{
+ if (segment == NULL) {
+ return FALSE;
+ }
+
+ int ret = route_segment_clone(&g_segment, segment);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_segment_clone() is failed");
+ ret = route_segment_foreach_steps(segment, route_segment_step_callback, NULL);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_segment_foreach_steps() is failed");
+ return TRUE;
+}
+
+static bool route_service_found_callback(route_error_e error, int index, int total, route_h route, void *user_data)
+{
+ if (error != ROUTE_ERROR_NONE) {
+ return FALSE;
+ }
+
+ service_enabled = TRUE;
+
+ int ret = route_clone(&g_route, route);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_clone() is failed");
+ ret = route_foreach_segments(route, route_segment_callback, NULL);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_foreach_segments() is failed");
+ return TRUE;
+}
+
+void request_route_service_start()
+{
+ int ret, request_id;
+ location_coords_s origin, destination;
+
+ ret = route_service_create(&g_service);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_service_create() is failed");
+
+ origin.latitude = 37.564263;
+ origin.longitude = 126.974676;
+ destination.latitude = 37.55712;
+ destination.longitude = 126.99241;
+
+ ret = route_service_find(g_service, origin, destination, NULL, 0, route_service_found_callback, NULL, &request_id);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_service_find() is failed");
+}
+
+void request_route_service_stop()
+{
+ if (g_service) {
+ route_service_destroy(g_service);
+ }
+
+ if (g_route) {
+ route_destroy(g_route);
+ }
+
+ if (g_segment) {
+ route_segment_destroy(g_segment);
+ }
+
+ if (g_step) {
+ route_step_destroy(g_step);
+ }
+}
+
+static void startup(void)
+{
+ g_setenv("PKG_NAME", "com.samsung.capi-location-route-test", 1);
+ g_setenv("LOCATION_TEST_ENABLE", "1", 1);
+
+#if !GLIB_CHECK_VERSION (2, 31, 0)
+ if (!g_thread_supported()) {
+ g_thread_init(NULL);
+ }
+#endif
+
+ event_thread = g_thread_create(GmainThread, NULL, 1, NULL);
+
+ request_route_service_start();
+ wait_for_service(__func__);
+}
+
+static void cleanup(void)
+{
+ request_route_service_stop();
+ g_main_loop_quit(g_mainloop);
+ g_thread_join(event_thread);
+}
+
+static bool capi_route_foreach_property_cb(const char *key, const char *value, void *user_data)
+{
+ return TRUE;
+}
+
+static bool capi_route_foreach_segment_cb(route_segment_h segment, void *user_data)
+{
+ return TRUE;
+}
+
+static bool capi_segment_foreach_property_cb(const char *key, const char *value, void *user_data)
+{
+ return TRUE;
+}
+
+static bool capi_segment_foreach_step_cb(route_step_h step, void *user_data)
+{
+ return TRUE;
+}
+
+static bool capi_step_foreach_geometry_cb(location_coords_s * geometry, void *user_data)
+{
+ return TRUE;
+}
+
+static bool capi_step_foreach_property_cb(const char *key, const char *value, void *user_datea)
+{
+ return TRUE;
+}
+
+static void utc_location_route_clone_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ route_h cloned;
+
+ ret = route_clone(&cloned, g_route);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_clone_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_clone(NULL, g_route);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_destroy_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ route_h cloned;
+
+ ret = route_clone(&cloned, g_route);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_clone() is failed");
+
+ ret = route_destroy(cloned);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_destroy_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_destroy(NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_request_id_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ int id = 0;
+
+ ret = route_get_request_id(g_route, &id);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_get_request_id_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ int id = 0;
+
+ ret = route_get_request_id(NULL, &id);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_request_id_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_get_request_id(g_route, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_origin_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s origin;
+
+ ret = route_get_origin(g_route, &origin);
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_get_origin_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s origin;
+
+ ret = route_get_origin(NULL, &origin);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_origin_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_get_origin(g_route, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_destination_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s destination;
+
+ ret = route_get_destination(g_route, &destination);
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_get_destination_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s destination;
+
+ ret = route_get_destination(NULL, &destination);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_destination_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_get_destination(g_route, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_geometry_bounding_box_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+ location_coords_s bottom_right;
+
+ ret = route_get_geometry_bounding_box(g_route, &top_left, &bottom_right);
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_get_geometry_bounding_box_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+ location_coords_s bottom_right;
+
+ ret = route_get_geometry_bounding_box(NULL, &top_left, &bottom_right);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_geometry_bounding_box_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s bottom_right;
+
+ ret = route_get_geometry_bounding_box(g_route, NULL, &bottom_right);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_geometry_bounding_box_n_03(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+
+ ret = route_get_geometry_bounding_box(g_route, &top_left, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_distance_unit_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ route_distance_unit_e unit = ROUTE_DISTANCE_UNIT_M;
+
+ ret = route_get_distance_unit(g_route, &unit);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_get_distance_unit_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ route_distance_unit_e unit = ROUTE_DISTANCE_UNIT_M;
+
+ ret = route_get_distance_unit(NULL, &unit);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_distance_unit_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_get_distance_unit(g_route, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_total_distance_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ double distance;
+
+ ret = route_get_total_distance(g_route, &distance);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_get_total_distance_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ double distance;
+
+ ret = route_get_total_distance(NULL, &distance);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_total_distance_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_get_total_distance(g_route, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_total_duration_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ long duration;
+
+ ret = route_get_total_duration(g_route, &duration);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_get_total_duration_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ long duration;
+
+ ret = route_get_total_duration(NULL, &duration);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_get_total_duration_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_get_total_duration(g_route, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_foreach_properties_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_foreach_properties(g_route, capi_route_foreach_property_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_foreach_properties_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_foreach_properties(NULL, capi_route_foreach_property_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_foreach_properties_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_foreach_properties(g_route, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_foreach_segments_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_foreach_segments(g_route, capi_route_foreach_segment_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_foreach_segments_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_foreach_segments(NULL, capi_route_foreach_segment_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_foreach_segments_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_foreach_segments(g_route, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_clone_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ route_segment_h cloned;
+
+ ret = route_segment_clone(&cloned, g_segment);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_segment_clone_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_clone(NULL, g_segment);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_destroy_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ route_segment_h cloned;
+
+ ret = route_segment_clone(&cloned, g_segment);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_segment_clone() is failed");
+
+ ret = route_segment_destroy(cloned);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_segment_destroy_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_destroy(NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_origin_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s origin;
+
+ ret = route_segment_get_origin(g_segment, &origin);
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_segment_get_origin_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s origin;
+
+ ret = route_segment_get_origin(NULL, &origin);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_origin_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_get_origin(g_segment, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_destination_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s destination;
+
+ ret = route_segment_get_destination(g_segment, &destination);
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_segment_get_destination_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s destination;
+
+ ret = route_segment_get_destination(NULL, &destination);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_destination_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_get_destination(g_segment, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_geometry_bounding_box_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+ location_coords_s bottom_right;
+
+ ret = route_segment_get_geometry_bounding_box(g_segment, &top_left, &bottom_right);
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_segment_get_geometry_bounding_box_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+ location_coords_s bottom_right;
+
+ ret = route_segment_get_geometry_bounding_box(NULL, &top_left, &bottom_right);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_geometry_bounding_box_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+
+ ret = route_segment_get_geometry_bounding_box(g_segment, &top_left, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_geometry_bounding_box_n_03(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s bottom_right;
+
+ ret = route_segment_get_geometry_bounding_box(g_segment, NULL, &bottom_right);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_distance_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ double distance;
+
+ ret = route_segment_get_distance(g_segment, &distance);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_segment_get_distance_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ double distance;
+
+ ret = route_segment_get_distance(NULL, &distance);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_distance_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_get_distance(g_segment, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_duration_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ long duration;
+
+ ret = route_segment_get_duration(g_segment, &duration);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_segment_get_duration_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ long duration;
+
+ ret = route_segment_get_duration(NULL, &duration);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_get_duration_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_get_duration(g_segment, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_foreach_properties_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_foreach_properties(g_segment, capi_segment_foreach_property_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_segment_foreach_properties_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_foreach_properties(NULL, capi_segment_foreach_property_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_foreach_properties_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_foreach_properties(g_segment, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_foreach_steps_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_foreach_steps(g_segment, capi_segment_foreach_step_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_segment_foreach_steps_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_foreach_steps(NULL, capi_segment_foreach_step_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_segment_foreach_steps_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_segment_foreach_steps(g_segment, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_clone_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ route_step_h cloned;
+
+ ret = route_step_clone(&cloned, g_step);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_step_clone_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_clone(NULL, g_step);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_destroy_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ route_step_h cloned;
+
+ ret = route_step_clone(&cloned, g_step);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_step_clone() is failed");
+
+ ret = route_step_destroy(cloned);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_step_destroy_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_destroy(NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_origin_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s origin;
+
+ ret = route_step_get_origin(g_step, &origin);
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_step_get_origin_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s origin;
+
+ ret = route_step_get_origin(NULL, &origin);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_origin_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_get_origin(g_step, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_destination_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s destination;
+
+ ret = route_step_get_destination(g_step, &destination);
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_step_get_destination_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s destination;
+
+ ret = route_step_get_destination(NULL, &destination);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_destination_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_get_destination(g_step, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_geometry_bounding_box_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+ location_coords_s bottom_right;
+
+ ret = route_step_get_geometry_bounding_box(g_step, &top_left, &bottom_right);
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_step_get_geometry_bounding_box_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+ location_coords_s bottom_right;
+
+ ret = route_step_get_geometry_bounding_box(NULL, &top_left, &bottom_right);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_geometry_bounding_box_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+
+ ret = route_step_get_geometry_bounding_box(g_step, &top_left, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_geometry_bounding_box_n_03(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s bottom_right;
+
+ ret = route_step_get_geometry_bounding_box(g_step, NULL, &bottom_right);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_distance_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ double distance;
+
+ ret = route_step_get_distance(g_step, &distance);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_step_get_distance_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ double distance;
+
+ ret = route_step_get_distance(NULL, &distance);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_distance_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_get_distance(g_step, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_duration_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ long duration;
+
+ ret = route_step_get_duration(g_step, &duration);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_step_get_duration_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ long duration;
+
+ ret = route_step_get_duration(NULL, &duration);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_duration_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_get_duration(g_step, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_transport_mode_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *mode = NULL;
+
+ ret = route_step_get_transport_mode(g_step, &mode);
+ if (mode != NULL) {
+ free(mode);
+ }
+
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_step_get_transport_mode_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *mode = NULL;
+
+ ret = route_step_get_transport_mode(NULL, &mode);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_transport_mode_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_get_transport_mode(g_step, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_instruction_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *instruction = NULL;
+
+ ret = route_step_get_instruction(g_step, &instruction);
+ if (instruction != NULL) {
+ free(instruction);
+ }
+
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_step_get_instruction_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *instruction = NULL;
+
+ ret = route_step_get_instruction(NULL, &instruction);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_get_instruction_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_get_instruction(g_step, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_foreach_geometries_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_foreach_geometries(g_step, capi_step_foreach_geometry_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_step_foreach_geometries_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_foreach_geometries(NULL, capi_step_foreach_geometry_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_foreach_geometries_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_foreach_geometries(g_step, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_foreach_properties_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_foreach_properties(g_step, capi_step_foreach_property_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_step_foreach_properties_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_foreach_properties(NULL, capi_step_foreach_property_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_step_foreach_properties_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_step_foreach_properties(g_step, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
--- /dev/null
+/*
+* Copyright (c) 2011 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.
+*/
+
+/*
+ * This testcase is only for decarta.
+ */
+#include <tet_api.h>
+
+#include <route_service.h>
+#include <route_preference.h>
+#include <glib.h>
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup) (void) = startup;
+void (*tet_cleanup) (void) = cleanup;
+
+static void utc_location_route_preference_create_p(void);
+static void utc_location_route_preference_create_n(void);
+static void utc_location_route_preference_foreach_addresses_to_avoid_p(void);
+static void utc_location_route_preference_foreach_addresses_to_avoid_n(void);
+static void utc_location_route_preference_foreach_addresses_to_avoid_n_02(void);
+static void utc_location_route_preference_foreach_areas_to_avoid_p(void);
+static void utc_location_route_preference_foreach_areas_to_avoid_n(void);
+static void utc_location_route_preference_foreach_areas_to_avoid_n_02(void);
+static void utc_location_route_preference_foreach_constraints_p(void);
+static void utc_location_route_preference_foreach_constraints_n(void);
+static void utc_location_route_preference_foreach_constraints_n_02(void);
+static void utc_location_route_preference_foreach_properties_p(void);
+static void utc_location_route_preference_foreach_properties_n(void);
+static void utc_location_route_preference_foreach_properties_n_02(void);
+static void utc_location_route_preference_get_geometry_bounding_box_p(void);
+static void utc_location_route_preference_get_geometry_bounding_box_n(void);
+static void utc_location_route_preference_get_geometry_bounding_box_n_02(void);
+static void utc_location_route_preference_get_geometry_bounding_box_n_03(void);
+static void utc_location_route_preference_get_max_results_p(void);
+static void utc_location_route_preference_get_max_results_n(void);
+static void utc_location_route_preference_get_max_results_n_02(void);
+static void utc_location_route_preference_get_goal_p(void);
+static void utc_location_route_preference_get_goal_n(void);
+static void utc_location_route_preference_get_goal_n_02(void);
+static void utc_location_route_preference_get_transport_mode_p(void);
+static void utc_location_route_preference_get_transport_mode_n(void);
+static void utc_location_route_preference_get_transport_mode_n_02(void);
+static void utc_location_route_preference_is_geometry_used_p(void);
+static void utc_location_route_preference_is_geometry_used_n(void);
+static void utc_location_route_preference_is_instruction_bounding_box_used_p(void);
+static void utc_location_route_preference_is_instruction_bounding_box_used_n(void);
+static void utc_location_route_preference_is_instruction_geometry_used_p(void);
+static void utc_location_route_preference_is_instruction_geometry_used_n(void);
+static void utc_location_route_preference_is_instruction_used_p(void);
+static void utc_location_route_preference_is_instruction_used_n(void);
+static void utc_location_route_preference_is_traffic_data_used_p(void);
+static void utc_location_route_preference_is_traffic_data_used_n(void);
+static void utc_location_route_preference_get_p(void);
+static void utc_location_route_preference_get_n(void);
+static void utc_location_route_preference_get_n_02(void);
+static void utc_location_route_preference_get_n_03(void);
+static void utc_location_route_preference_set_p(void);
+static void utc_location_route_preference_set_n(void);
+static void utc_location_route_preference_set_n_02(void);
+static void utc_location_route_preference_set_n_03(void);
+static void utc_location_route_preference_add_address_to_avoid_p(void);
+static void utc_location_route_preference_add_address_to_avoid_n(void);
+static void utc_location_route_preference_add_address_to_avoid_n_02(void);
+static void utc_location_route_preference_clear_addresses_to_avoid_p(void);
+static void utc_location_route_preference_clear_addresses_to_avoid_n(void);
+static void utc_location_route_preference_add_area_to_avoid_p(void);
+static void utc_location_route_preference_add_area_to_avoid_n(void);
+static void utc_location_route_preference_add_area_to_avoid_n_02(void);
+static void utc_location_route_preference_clear_areas_to_avoid_p(void);
+static void utc_location_route_preference_clear_areas_to_avoid_n(void);
+static void utc_location_route_preference_add_constraint_p(void);
+static void utc_location_route_preference_add_constraint_n(void);
+static void utc_location_route_preference_add_constraint_n_02(void);
+static void utc_location_route_preference_clear_constraints_p(void);
+static void utc_location_route_preference_clear_constraints_n(void);
+static void utc_location_route_preference_set_geometry_bounding_box_p(void);
+static void utc_location_route_preference_set_geometry_bounding_box_n(void);
+static void utc_location_route_preference_set_max_results_p(void);
+static void utc_location_route_preference_set_max_results_n(void);
+static void utc_location_route_preference_set_goal_p(void);
+static void utc_location_route_preference_set_goal_n(void);
+static void utc_location_route_preference_set_goal_n_02(void);
+static void utc_location_route_preference_set_transport_mode_p(void);
+static void utc_location_route_preference_set_transport_mode_n(void);
+static void utc_location_route_preference_set_transport_mode_n_02(void);
+static void utc_location_route_preference_set_geometry_used_p(void);
+static void utc_location_route_preference_set_geometry_used_p_02(void);
+static void utc_location_route_preference_set_geometry_used_n(void);
+static void utc_location_route_preference_set_instruction_bounding_box_used_p(void);
+static void utc_location_route_preference_set_instruction_bounding_box_used_p_02(void);
+static void utc_location_route_preference_set_instruction_bounding_box_used_n(void);
+static void utc_location_route_preference_set_instruction_geometry_used_p(void);
+static void utc_location_route_preference_set_instruction_geometry_used_p_02(void);
+static void utc_location_route_preference_set_instruction_geometry_used_n(void);
+static void utc_location_route_preference_set_instruction_used_p(void);
+static void utc_location_route_preference_set_instruction_used_p_02(void);
+static void utc_location_route_preference_set_instruction_used_n(void);
+static void utc_location_route_preference_set_traffic_data_used_p(void);
+static void utc_location_route_preference_set_traffic_data_used_p_02(void);
+static void utc_location_route_preference_set_traffic_data_used_n(void);
+static void utc_location_route_preference_is_area_to_avoid_supported_p(void);
+static void utc_location_route_preference_is_area_to_avoid_supported_p_02(void);
+static void utc_location_route_preference_is_area_to_avoid_supported_p_03(void);
+static void utc_location_route_preference_is_area_to_avoid_supported_n(void);
+static void utc_location_route_preference_is_address_to_avoid_supported_p(void);
+static void utc_location_route_preference_is_address_to_avoid_supported_n(void);
+static void utc_location_route_preference_is_geometry_bounding_box_supported_p(void);
+static void utc_location_route_preference_is_geometry_bounding_box_supported_n(void);
+static void utc_location_route_preference_is_geometry_supported_p(void);
+static void utc_location_route_preference_is_geometry_supported_n(void);
+static void utc_location_route_preference_is_instruction_geometry_supported_p(void);
+static void utc_location_route_preference_is_instruction_geometry_supported_n(void);
+static void utc_location_route_preference_is_instruction_bounding_box_supported_p(void);
+static void utc_location_route_preference_is_instruction_bounding_box_supported_n(void);
+static void utc_location_route_preference_is_instruction_supported_p(void);
+static void utc_location_route_preference_is_instruction_supported_n(void);
+static void utc_location_route_preference_is_traffic_data_supported_p(void);
+static void utc_location_route_preference_is_traffic_data_supported_n(void);
+static void utc_location_route_preference_foreach_available_constraints_p(void);
+static void utc_location_route_preference_foreach_available_constraints_n(void);
+static void utc_location_route_preference_foreach_available_constraints_n_02(void);
+static void utc_location_route_preference_foreach_available_goals_p(void);
+static void utc_location_route_preference_foreach_available_goals_n(void);
+static void utc_location_route_preference_foreach_available_goals_n_02(void);
+static void utc_location_route_preference_foreach_available_transport_modes_p(void);
+static void utc_location_route_preference_foreach_available_transport_modes_n(void);
+static void utc_location_route_preference_foreach_available_transport_modes_n_02(void);
+static void utc_location_route_preference_foreach_available_property_keys_p(void);
+static void utc_location_route_preference_foreach_available_property_keys_n(void);
+static void utc_location_route_preference_foreach_available_property_keys_n_02(void);
+static void utc_location_route_preference_foreach_available_property_values_p(void);
+static void utc_location_route_preference_foreach_available_property_values_n(void);
+static void utc_location_route_preference_foreach_available_property_values_n_02(void);
+static void utc_location_route_preference_foreach_available_property_values_n_03(void);
+static void utc_location_route_preference_destroy_p(void);
+static void utc_location_route_preference_destroy_n(void);
+
+struct tet_testlist tet_testlist[] = {
+ {utc_location_route_preference_create_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_create_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_addresses_to_avoid_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_foreach_addresses_to_avoid_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_addresses_to_avoid_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_areas_to_avoid_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_foreach_areas_to_avoid_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_areas_to_avoid_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_constraints_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_foreach_constraints_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_constraints_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_properties_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_foreach_properties_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_properties_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_geometry_bounding_box_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_get_geometry_bounding_box_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_geometry_bounding_box_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_geometry_bounding_box_n_03, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_max_results_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_get_max_results_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_max_results_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_goal_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_get_goal_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_goal_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_transport_mode_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_get_transport_mode_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_transport_mode_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_geometry_used_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_geometry_used_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_bounding_box_used_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_bounding_box_used_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_geometry_used_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_geometry_used_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_used_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_used_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_traffic_data_used_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_traffic_data_used_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_get_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_get_n_03, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_n_03, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_add_address_to_avoid_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_add_address_to_avoid_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_add_address_to_avoid_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_clear_addresses_to_avoid_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_clear_addresses_to_avoid_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_add_area_to_avoid_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_add_area_to_avoid_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_add_area_to_avoid_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_clear_areas_to_avoid_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_clear_areas_to_avoid_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_add_constraint_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_add_constraint_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_add_constraint_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_clear_constraints_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_clear_constraints_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_geometry_bounding_box_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_geometry_bounding_box_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_max_results_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_max_results_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_goal_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_goal_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_goal_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_transport_mode_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_transport_mode_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_transport_mode_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_geometry_used_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_geometry_used_p_02, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_geometry_used_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_instruction_bounding_box_used_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_instruction_bounding_box_used_p_02, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_instruction_bounding_box_used_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_instruction_geometry_used_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_instruction_geometry_used_p_02, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_instruction_geometry_used_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_instruction_used_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_instruction_used_p_02, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_instruction_used_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_set_traffic_data_used_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_traffic_data_used_p_02, POSITIVE_TC_IDX},
+ {utc_location_route_preference_set_traffic_data_used_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_area_to_avoid_supported_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_area_to_avoid_supported_p_02, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_area_to_avoid_supported_p_03, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_area_to_avoid_supported_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_address_to_avoid_supported_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_address_to_avoid_supported_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_geometry_bounding_box_supported_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_geometry_bounding_box_supported_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_geometry_supported_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_geometry_supported_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_geometry_supported_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_geometry_supported_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_bounding_box_supported_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_bounding_box_supported_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_supported_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_instruction_supported_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_is_traffic_data_supported_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_is_traffic_data_supported_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_constraints_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_constraints_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_constraints_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_goals_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_goals_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_goals_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_transport_modes_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_transport_modes_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_transport_modes_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_property_keys_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_property_keys_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_property_keys_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_property_values_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_property_values_n, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_property_values_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_foreach_available_property_values_n_03, NEGATIVE_TC_IDX},
+ {utc_location_route_preference_destroy_p, POSITIVE_TC_IDX},
+ {utc_location_route_preference_destroy_n, NEGATIVE_TC_IDX},
+
+ {NULL, 0},
+};
+
+static bool service_enabled = FALSE;
+
+static GMainLoop *g_mainloop = NULL;
+static GThread *event_thread;
+
+gpointer GmainThread(gpointer data)
+{
+ g_mainloop = g_main_loop_new(NULL, 0);
+ g_main_loop_run(g_mainloop);
+
+ return NULL;
+}
+
+static void validate_and_next(char *api_name, int act_ret, int ext_ret, char *fail_msg)
+{
+ dts_message(api_name, "Actual Result : %d, Expected Result : %d", act_ret, ext_ret);
+ if (act_ret != ext_ret) {
+ dts_message(api_name, "Fail Message: %s", fail_msg);
+ dts_fail(api_name);
+ }
+}
+
+static void validate_eq(char *api_name, int act_ret, int ext_ret)
+{
+ dts_message(api_name, "Actual Result : %d, Expected Result : %d", act_ret, ext_ret);
+ if (act_ret == ext_ret) {
+ dts_pass(api_name);
+ } else {
+ dts_fail(api_name);
+ }
+}
+
+static void validate_eq_bool(char *api_name, bool act_ret, bool ext_ret)
+{
+ dts_message(api_name, "Actual Result : %d, Expected Result : %d", act_ret, ext_ret);
+ if (act_ret == ext_ret) {
+ dts_pass(api_name);
+ } else {
+ dts_fail(api_name);
+ }
+}
+
+static void wait_for_service(char *api_name)
+{
+ int timeout = 0;
+ for (timeout; timeout < 180; timeout++) {
+ if (service_enabled) {
+ dts_message(api_name, "Find Routes!!!!");
+ break;
+ } else {
+ dts_message(api_name, "Did not find Routes!!!!");
+ sleep(1);
+ }
+ }
+}
+
+static route_service_h g_service;
+static route_preference_h g_pref;
+
+static bool route_service_found_callback(route_error_e error, int index, int total, route_h route, void *user_data)
+{
+ if (error != ROUTE_ERROR_NONE) {
+ return FALSE;
+ }
+
+ service_enabled = TRUE;
+ return TRUE;
+}
+
+void request_route_service_start()
+{
+ int ret, request_id;
+ location_coords_s origin, destination;
+
+ ret = route_service_create(&g_service);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_service_create() is failed");
+
+ ret = route_preference_create(&g_pref);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_preference_create() is failed");
+
+ ret = route_service_set_preference(g_service, g_pref);
+
+ origin.latitude = 37.564263;
+ origin.longitude = 126.974676;
+ destination.latitude = 37.55712;
+ destination.longitude = 126.99241;
+
+ ret = route_service_find(g_service, origin, destination, NULL, 0, route_service_found_callback, NULL, &request_id);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_service_find() is failed");
+}
+
+void request_route_service_stop()
+{
+ if (g_service) {
+ route_service_destroy(g_service);
+ }
+
+ if (g_pref) {
+ route_preference_destroy(g_pref);
+ }
+}
+
+static void startup(void)
+{
+ g_setenv("PKG_NAME", "com.samsung.capi-location-route-preference-test", 1);
+ g_setenv("LOCATION_TEST_ENABLE", "1", 1);
+
+#if !GLIB_CHECK_VERSION (2, 31, 0)
+ if (!g_thread_supported()) {
+ g_thread_init(NULL);
+ }
+#endif
+ event_thread = g_thread_create(GmainThread, NULL, 1, NULL);
+
+ request_route_service_start();
+ wait_for_service(__func__);
+}
+
+static void cleanup(void)
+{
+ request_route_service_stop();
+ g_main_loop_quit(g_mainloop);
+ g_thread_join(event_thread);
+}
+
+static void utc_location_route_preference_create_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ route_preference_h preference;
+
+ ret = route_preference_create(&preference);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_create_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_create(NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static bool capi_route_preference_address_to_avoid_cb(const char *address, void *user_data)
+{
+ return true;
+}
+
+static void utc_location_route_preference_foreach_addresses_to_avoid_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_addresses_to_avoid(g_pref, capi_route_preference_address_to_avoid_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_foreach_addresses_to_avoid_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_addresses_to_avoid(g_pref, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_foreach_addresses_to_avoid_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_addresses_to_avoid(NULL, capi_route_preference_address_to_avoid_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static bool capi_route_preference_area_to_avoid_cb(location_bounds_h area, void *user_data)
+{
+ return true;
+}
+
+static void utc_location_route_preference_foreach_areas_to_avoid_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_areas_to_avoid(g_pref, capi_route_preference_area_to_avoid_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_foreach_areas_to_avoid_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_areas_to_avoid(g_pref, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_foreach_areas_to_avoid_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_areas_to_avoid(NULL, capi_route_preference_area_to_avoid_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static bool capi_route_preference_constraint_cb(const char *constraint, void *user_data)
+{
+ return true;
+}
+
+static void utc_location_route_preference_foreach_constraints_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_constraints(g_pref, capi_route_preference_constraint_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_foreach_constraints_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_constraints(g_pref, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+
+}
+
+static void utc_location_route_preference_foreach_constraints_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_constraints(NULL, capi_route_preference_constraint_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+
+}
+
+static bool capi_route_preference_property_cb(const char *key, const char *value, void *user_data)
+{
+ return true;
+}
+
+static void utc_location_route_preference_foreach_properties_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_properties(g_pref, capi_route_preference_property_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_foreach_properties_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_properties(g_pref, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+
+}
+
+static void utc_location_route_preference_foreach_properties_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_properties(NULL, capi_route_preference_property_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+
+}
+
+static void utc_location_route_preference_get_geometry_bounding_box_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+ location_coords_s bottom_right;
+
+ ret = route_preference_get_geometry_bounding_box(g_pref, &top_left, &bottom_right);
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_preference_get_geometry_bounding_box_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+ location_coords_s bottom_right;
+
+ ret = route_preference_get_geometry_bounding_box(NULL, &top_left, &bottom_right);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_get_geometry_bounding_box_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s bottom_right;
+
+ ret = route_preference_get_geometry_bounding_box(g_pref, NULL, &bottom_right);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_get_geometry_bounding_box_n_03(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left;
+
+ ret = route_preference_get_geometry_bounding_box(g_pref, &top_left, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_get_max_results_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ int max_results;
+
+ ret = route_preference_get_max_results(g_pref, &max_results);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_get_max_results_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ int max_results;
+ ret = route_preference_get_max_results(NULL, &max_results);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_get_max_results_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_get_max_results(g_pref, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_get_goal_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *goal = NULL;
+
+ ret = route_preference_get_goal(g_pref, &goal);
+ if (goal != NULL) {
+ free(goal);
+ }
+
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_preference_get_goal_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *goal = NULL;
+
+ ret = route_preference_get_goal(NULL, &goal);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_get_goal_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_get_goal(g_pref, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_get_transport_mode_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *mode = NULL;
+
+ ret = route_preference_get_transport_mode(g_pref, &mode);
+ if (mode != NULL) {
+ free(mode);
+ }
+
+ if (ret == ROUTE_ERROR_RESULT_NOT_FOUND) {
+ validate_eq(__func__, ret, ROUTE_ERROR_RESULT_NOT_FOUND);
+ } else {
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ }
+}
+
+static void utc_location_route_preference_get_transport_mode_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *mode = NULL;
+
+ ret = route_preference_get_transport_mode(NULL, &mode);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_get_transport_mode_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_get_transport_mode(g_pref, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_is_geometry_used_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_geometry_used(g_pref);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_geometry_used_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_geometry_used(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_instruction_bounding_box_used_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_bounding_box_used(g_pref);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_instruction_bounding_box_used_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_bounding_box_used(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_instruction_geometry_used_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_geometry_used(g_pref);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_instruction_geometry_used_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_geometry_used(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_instruction_used_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_used(g_pref);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_instruction_used_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_used(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_traffic_data_used_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_traffic_data_used(g_pref);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_traffic_data_used_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_traffic_data_used(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_get_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *value = NULL;
+
+ route_preference_set(g_pref, "LandmarkType", "hotel");
+
+ ret = route_preference_get(g_pref, "LandmarkType", &value);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_get_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *value = NULL;
+
+ ret = route_preference_get(NULL, "LandmarkType", &value);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_get_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ char *value = NULL;
+
+ ret = route_preference_get(g_pref, NULL, &value);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_get_n_03(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_get(g_pref, "LandmarkType", NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set(g_pref, "LandmarkType", "hotel");
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_set_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set(NULL, "LandmarkType", "hotel");
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set(g_pref, NULL, "hotel");
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_n_03(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set(g_pref, "LandmarkType", NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_add_address_to_avoid_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_add_address_to_avoid(g_pref, "Grand Central Pky");
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_add_address_to_avoid_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_add_address_to_avoid(NULL, "Grand Central Pky");
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_add_address_to_avoid_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_add_address_to_avoid(g_pref, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_clear_addresses_to_avoid_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_clear_addresses_to_avoid(g_pref);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_clear_addresses_to_avoid_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_clear_addresses_to_avoid(NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_add_area_to_avoid_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ location_bounds_h area;
+ location_coords_s top_left = { 30, 30 };
+ location_coords_s bottom_right = { 10, 50 };
+ location_bounds_create_rect(top_left, bottom_right, &area);
+
+ ret = route_preference_add_area_to_avoid(g_pref, area);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_add_area_to_avoid_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ location_bounds_h area;
+ location_coords_s top_left = { 30, 30 };
+ location_coords_s bottom_right = { 10, 50 };
+ location_bounds_create_rect(top_left, bottom_right, &area);
+
+ ret = route_preference_add_area_to_avoid(NULL, area);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_add_area_to_avoid_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_add_area_to_avoid(g_pref, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_clear_areas_to_avoid_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_clear_areas_to_avoid(g_pref);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_clear_areas_to_avoid_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_clear_areas_to_avoid(NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_add_constraint_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_add_constraint(g_pref, "BRIDGES");
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_add_constraint_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_add_constraint(NULL, "BRIDGES");
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_add_constraint_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_add_constraint(g_pref, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_clear_constraints_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_clear_constraints(g_pref);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_clear_constraints_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_clear_constraints(NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_geometry_bounding_box_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left = { 30, 30 };
+ location_coords_s bottom_right = { 10, 50 };
+
+ ret = route_preference_set_geometry_bounding_box(g_pref, top_left, bottom_right);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_set_geometry_bounding_box_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s top_left = { 30, 30 };
+ location_coords_s bottom_right = { 10, 50 };
+
+ ret = route_preference_set_geometry_bounding_box(NULL, top_left, bottom_right);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_max_results_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_max_results(g_pref, 5);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_set_max_results_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_max_results(NULL, 5);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_goal_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_goal(g_pref, "FASTEST");
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_set_goal_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_goal(NULL, "FASTEST");
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_goal_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_goal(g_pref, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_transport_mode_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_transport_mode(g_pref, "Vehicle");
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_set_transport_mode_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_transport_mode(NULL, "CAR");
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+
+}
+
+static void utc_location_route_preference_set_transport_mode_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_transport_mode(g_pref, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+
+}
+
+static void utc_location_route_preference_set_geometry_used_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_geometry_used(g_pref, false);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_set_geometry_used_p_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_geometry_used(g_pref, true);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_set_geometry_used_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_geometry_used(NULL, true);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+
+}
+
+static void utc_location_route_preference_set_instruction_bounding_box_used_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_instruction_bounding_box_used(g_pref, false);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_set_instruction_bounding_box_used_p_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_instruction_bounding_box_used(g_pref, true);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_set_instruction_bounding_box_used_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_instruction_bounding_box_used(NULL, true);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_instruction_geometry_used_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_instruction_geometry_used(g_pref, false);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_set_instruction_geometry_used_p_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_instruction_geometry_used(g_pref, true);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_set_instruction_geometry_used_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_instruction_geometry_used(NULL, true);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_instruction_used_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_instruction_used(g_pref, false);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_set_instruction_used_p_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_instruction_used(g_pref, true);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_set_instruction_used_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_instruction_used(NULL, true);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_set_traffic_data_used_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_traffic_data_used(g_pref, false);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_set_traffic_data_used_p_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_traffic_data_used(g_pref, true);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_set_traffic_data_used_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_set_traffic_data_used(NULL, true);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_is_area_to_avoid_supported_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_area_to_avoid_supported(g_service, LOCATION_BOUNDS_RECT);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_area_to_avoid_supported_p_02(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_area_to_avoid_supported(g_service, LOCATION_BOUNDS_CIRCLE);
+ validate_eq_bool(__func__, ret, true);
+}
+
+static void utc_location_route_preference_is_area_to_avoid_supported_p_03(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_area_to_avoid_supported(g_service, LOCATION_BOUNDS_POLYGON);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_area_to_avoid_supported_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_area_to_avoid_supported(NULL, LOCATION_BOUNDS_CIRCLE);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_address_to_avoid_supported_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_address_to_avoid_supported(g_service);
+ validate_eq_bool(__func__, ret, true);
+}
+
+static void utc_location_route_preference_is_address_to_avoid_supported_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_address_to_avoid_supported(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_geometry_bounding_box_supported_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_geometry_bounding_box_supported(g_service);
+ validate_eq_bool(__func__, ret, true);
+}
+
+static void utc_location_route_preference_is_geometry_bounding_box_supported_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_geometry_bounding_box_supported(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_geometry_supported_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_geometry_supported(g_service);
+ validate_eq_bool(__func__, ret, true);
+}
+
+static void utc_location_route_preference_is_geometry_supported_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_geometry_supported(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_instruction_geometry_supported_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_geometry_supported(g_service);
+ validate_eq_bool(__func__, ret, true);
+}
+
+static void utc_location_route_preference_is_instruction_geometry_supported_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_geometry_supported(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_instruction_bounding_box_supported_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_bounding_box_supported(g_service);
+ validate_eq_bool(__func__, ret, true);
+}
+
+static void utc_location_route_preference_is_instruction_bounding_box_supported_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_bounding_box_supported(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_instruction_supported_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_supported(g_service);
+ validate_eq_bool(__func__, ret, true);
+}
+
+static void utc_location_route_preference_is_instruction_supported_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_instruction_supported(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static void utc_location_route_preference_is_traffic_data_supported_p(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_traffic_data_supported(g_service);
+ validate_eq_bool(__func__, ret, true);
+}
+
+static void utc_location_route_preference_is_traffic_data_supported_n(void)
+{
+ bool ret = true;
+
+ ret = route_preference_is_traffic_data_supported(NULL);
+ validate_eq_bool(__func__, ret, false);
+}
+
+static bool capi_route_preference_available_constraint_cb(const char *constraint, void *user_data)
+{
+ return true;
+}
+
+static void utc_location_route_preference_foreach_available_constraints_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_constraints(g_service, capi_route_preference_available_constraint_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_foreach_available_constraints_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_constraints(NULL, capi_route_preference_available_constraint_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_foreach_available_constraints_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_constraints(g_service, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static bool capi_route_preference_available_goal_cb(const char *goal, void *user_data)
+{
+ return true;
+}
+
+static void utc_location_route_preference_foreach_available_goals_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_goals(g_service, capi_route_preference_available_goal_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_foreach_available_goals_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_goals(NULL, capi_route_preference_available_goal_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_foreach_available_goals_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_goals(g_service, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static bool capi_route_preference_available_transport_mode_cb(const char *mode, void *user_data)
+{
+ return true;
+}
+
+static void utc_location_route_preference_foreach_available_transport_modes_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret =
+ route_preference_foreach_available_transport_modes(g_service, capi_route_preference_available_transport_mode_cb,
+ NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_foreach_available_transport_modes_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_transport_modes(NULL, capi_route_preference_available_transport_mode_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_foreach_available_transport_modes_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_transport_modes(g_service, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static bool capi_route_preference_available_property_key_cb(const char *key, void *user_data)
+{
+ return true;
+}
+
+static void utc_location_route_preference_foreach_available_property_keys_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret =
+ route_preference_foreach_available_property_keys(g_service, capi_route_preference_available_property_key_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_foreach_available_property_keys_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_property_keys(NULL, capi_route_preference_available_property_key_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_foreach_available_property_keys_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_property_keys(g_service, NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static bool capi_route_preference_available_property_value_cb(const char *value, void *user_data)
+{
+ return true;
+}
+
+static void utc_location_route_preference_foreach_available_property_values_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret =
+ route_preference_foreach_available_property_values(g_service, "LandmarkType",
+ capi_route_preference_available_property_value_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+
+}
+
+static void utc_location_route_preference_foreach_available_property_values_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret =
+ route_preference_foreach_available_property_values(NULL, "LandmarkType",
+ capi_route_preference_available_property_value_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_foreach_available_property_values_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret =
+ route_preference_foreach_available_property_values(g_service, NULL,
+ capi_route_preference_available_property_value_cb, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_foreach_available_property_values_n_03(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_foreach_available_property_values(g_service, "LandmarkType", NULL, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_preference_destroy_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_destroy(g_pref);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_preference_destroy_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_preference_destroy(NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
--- /dev/null
+/*
+* Copyright (c) 2011 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.
+*/
+
+#include <tet_api.h>
+
+#include <route_service.h>
+#include <route_preference.h>
+#include <glib.h>
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup) (void) = startup;
+void (*tet_cleanup) (void) = cleanup;
+
+static void utc_location_route_service_create_p(void);
+static void utc_location_route_service_create_n(void);
+static void utc_location_route_service_get_preference_p(void);
+static void utc_location_route_service_get_preference_n(void);
+static void utc_location_route_service_get_preference_n_02(void);
+static void utc_location_route_service_set_preference_p(void);
+static void utc_location_route_service_set_preference_n(void);
+static void utc_location_route_service_set_preference_n_02(void);
+static void utc_location_route_service_find_p(void);
+static void utc_location_route_service_find_n(void);
+static void utc_location_route_service_find_n_02(void);
+static void utc_location_route_service_cancel_p(void);
+static void utc_location_route_service_cancel_n(void);
+static void utc_location_route_service_destroy_p(void);
+static void utc_location_route_service_destroy_n(void);
+
+struct tet_testlist tet_testlist[] = {
+ {utc_location_route_service_create_p, POSITIVE_TC_IDX},
+ {utc_location_route_service_create_n, NEGATIVE_TC_IDX},
+ {utc_location_route_service_get_preference_p, POSITIVE_TC_IDX},
+ {utc_location_route_service_get_preference_n, NEGATIVE_TC_IDX},
+ {utc_location_route_service_get_preference_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_service_set_preference_p, POSITIVE_TC_IDX},
+ {utc_location_route_service_set_preference_n, NEGATIVE_TC_IDX},
+ {utc_location_route_service_set_preference_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_service_find_p, POSITIVE_TC_IDX},
+ {utc_location_route_service_find_n, NEGATIVE_TC_IDX},
+ {utc_location_route_service_find_n_02, NEGATIVE_TC_IDX},
+ {utc_location_route_service_cancel_p, POSITIVE_TC_IDX},
+ {utc_location_route_service_cancel_n, NEGATIVE_TC_IDX},
+ {utc_location_route_service_destroy_p, POSITIVE_TC_IDX},
+ {utc_location_route_service_destroy_n, NEGATIVE_TC_IDX},
+
+ {NULL, 0},
+};
+
+static GMainLoop *g_mainloop = NULL;
+static GThread *event_thread;
+
+gpointer GmainThread(gpointer data)
+{
+ g_mainloop = g_main_loop_new(NULL, 0);
+ g_main_loop_run(g_mainloop);
+
+ return NULL;
+}
+
+static void validate_and_next(char *api_name, int act_ret, int ext_ret, char *fail_msg)
+{
+ dts_message(api_name, "Actual Result : %d, Expected Result : %d", act_ret, ext_ret);
+ if (act_ret != ext_ret) {
+ dts_message(api_name, "Fail Message: %s", fail_msg);
+ dts_fail(api_name);
+ }
+}
+
+static void validate_eq(char *api_name, int act_ret, int ext_ret)
+{
+ dts_message(api_name, "Actual Result : %d, Expected Result : %d", act_ret, ext_ret);
+ if (act_ret == ext_ret) {
+ dts_pass(api_name);
+ } else {
+ dts_fail(api_name);
+ }
+}
+
+static void startup(void)
+{
+ g_setenv("PKG_NAME", "com.samsung.capi-location-route-service-test", 1);
+ g_setenv("LOCATION_TEST_ENABLE", "1", 1);
+
+#if !GLIB_CHECK_VERSION (2, 31, 0)
+ if (!g_thread_supported()) {
+ g_thread_init(NULL);
+ }
+#endif
+ event_thread = g_thread_create(GmainThread, NULL, 1, NULL);
+}
+
+static void cleanup(void)
+{
+ g_main_loop_quit(g_mainloop);
+ g_thread_join(event_thread);
+}
+
+static route_service_h g_service;
+int g_request_id;
+static bool service_enabled = FALSE;
+
+static void wait_for_service(char *api_name)
+{
+ int timeout = 0;
+ for (timeout; timeout < 180; timeout++) {
+ if (service_enabled) {
+ dts_message(api_name, "Find Routes!!!!");
+ break;
+ } else {
+ dts_message(api_name, "Did not find Routes!!!!");
+ sleep(1);
+ }
+ }
+}
+
+static void utc_location_route_service_create_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_service_create(&g_service);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_service_create_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_service_create(NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_service_get_preference_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ route_preference_h pref = NULL;
+ ret = route_preference_create(&pref);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_preference_create() is failed");
+
+ ret = route_service_get_preference(g_service, &pref);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_service_get_preference_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_service_get_preference(g_service, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_service_get_preference_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ route_preference_h pref;
+ ret = route_preference_create(&pref);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_preference_create() is failed");
+
+ ret = route_service_get_preference(NULL, pref);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_service_set_preference_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ route_preference_h pref = NULL;
+ ret = route_preference_create(&pref);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_preference_create() is failed");
+
+ ret = route_service_set_preference(g_service, pref);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_service_set_preference_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ route_preference_h pref;
+ ret = route_preference_create(&pref);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_preference_create() is failed");
+
+ ret = route_service_set_preference(g_service, NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_service_set_preference_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ route_preference_h pref;
+ ret = route_preference_create(&pref);
+ validate_and_next(__func__, ret, ROUTE_ERROR_NONE, "route_preference_create() is failed");
+
+ ret = route_service_set_preference(NULL, pref);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static bool capi_route_service_found_cb(route_error_e error, int index, int total, route_h route, void *user_data)
+{
+ if (error != ROUTE_ERROR_NONE) {
+ return FALSE;
+ }
+
+ service_enabled = TRUE;
+ return TRUE;
+}
+
+static void utc_location_route_service_find_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ location_coords_s origin = { 37.564263, 126.974676 };
+ location_coords_s destination = { 37.557120, 126.992410 };
+
+ ret = route_service_find(g_service, origin, destination, NULL, 0, capi_route_service_found_cb, NULL, &g_request_id);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+ wait_for_service("route_service_find");
+}
+
+static void utc_location_route_service_find_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ int request_id;
+ location_coords_s origin = { 37.564263, 126.974676 };
+ location_coords_s destination = { 37.557120, 126.992410 };
+
+ ret = route_service_find(NULL, origin, destination, NULL, 0, capi_route_service_found_cb, NULL, &request_id);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_service_find_n_02(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+ int request_id;
+ location_coords_s origin = { 37.564263, 126.974676 };
+ location_coords_s destination = { 37.557120, 126.992410 };
+
+ ret = route_service_find(g_service, origin, destination, NULL, 0, NULL, NULL, &request_id);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
+
+static void utc_location_route_service_cancel_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_service_cancel(g_service, g_request_id);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_service_cancel_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_service_cancel(NULL, g_request_id);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+
+}
+
+static void utc_location_route_service_destroy_p(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_service_destroy(g_service);
+ validate_eq(__func__, ret, ROUTE_ERROR_NONE);
+}
+
+static void utc_location_route_service_destroy_n(void)
+{
+ int ret = ROUTE_ERROR_NONE;
+
+ ret = route_service_destroy(NULL);
+ validate_eq(__func__, ret, ROUTE_ERROR_INVALID_PARAMETER);
+}
--- /dev/null
+all
+ ^TEST
+##### Scenarios for TEST #####
+
+# Test scenario
+TEST
+ :include:/testcase/tslist
--- /dev/null
+TET_OUTPUT_CAPTURE=True # capture option for build operation checking
+TET_BUILD_TOOL=make # build with using make command
+TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build
+TET_API_COMPLIANT=True # use TET API in Test Case ?
+TET_PASS_TC_NAME=True # report passed TC name in Journal file?
--- /dev/null
+TET_OUTPUT_CAPTURE=True # capture option
+TET_CLEAN_TOOL= make clean # clean tool
+TET_CLEAN_FILE= Makefile # file for clean
+TET_API_COMPLIANT=True # TET API useage
+TET_PASS_TC_NAME=True # showing name , passed TC
--- /dev/null
+TET_OUTPUT_CAPTURE=True # capturing execution or not
+TET_EXEC_TOOL= # ex) exec : execution tool set up/ Optional
+TET_EXEC_FILE= # ex) exectool : execution file/ Optional
+TET_API_COMPLIANT=True # Test case or Tool usesTET API?
+TET_PASS_TC_NAME=True # showing Passed TC name ?
+capi-location-route (0.1.0-6) unstable; urgency=low
+
+ * Fix bugs when checking returned value
+ * Tag: capi-location-route_0.1.0-6
+
+ -- Minjune Kim <sena06.kim@samsung.com> Mon, 13 Aug 2012 15:40:15 +0900
+
+capi-location-route (0.1.0-5) unstable; urgency=low
+
+ * Seperate map service from location service
+ * Tag: capi-location-route_0.1.0-5
+
+ -- Minjune Kim <sena06.kim@samsung.com> Fri, 27 Jul 2012 20:07:36 +0900
+
+capi-location-route (0.1.0-4) unstable; urgency=low
+
+ * Support developer mode
+ * Tag: capi-location-route_0.1.0-4
+
+ -- Minjune Kim <sena06.kim@samsung.com> Thu, 19 Jul 2012 19:53:27 +0900
+
capi-location-route (0.1.0-3) unstable; urgency=low
* add get transport mode in route step
- * Git: slp-source.sec.samsung.net:slp/api/route
* Tag: capi-location-route_0.1.0-3
-- Genie Kim <daejins.kim@samsung.com> Tue, 27 Mar 2012 21:30:53 +0900
capi-location-route (0.1.0-2) unstable; urgency=low
* add TC for route_service / route_preference / route
- * Git: slp-source.sec.samsung.net:slp/api/route
* Tag: capi-location-route_0.1.0-2
-- Genie Kim <daejins.kim@samsung.com> Wed, 21 Mar 2012 20:36:24 +0900
capi-location-route (0.1.0-1) unstable; urgency=low
* Initial release
- * Git: slp-source.sec.samsung.net:slp/api/route
* Tag: capi-location-route_0.1.0-1
-- Genie Kim <daejins.kim@samsung.com> Mon, 19 Mar 2012 00:00:00 +0900
#define __TIZEN_LOCATION_ROUTE_PRIVATE_H__
#include <location.h>
+#include <location-map-service.h>
#include "route_preference.h"
typedef struct _route_service_s{
- LocationObject* object;
+ LocationMapObject* object;
route_preference_h route_preference;
} route_service_s;
Name: capi-location-route
Summary: A Location Route library in Tizen Native API
Version: 0.1.0
-Release: 2
+Release: 1
Group: TO_BE/FILLED_IN
License: TO BE FILLED IN
Source0: %{name}-%{version}.tar.gz
switch (type) {
case LOCATION_BOUNDS_RECT:
ret =
- (bool) location_is_supported_map_provider_capability(handle->object,
+ (bool) location_map_is_supported_provider_capability(handle->object,
MAP_SERVICE_ROUTE_REQUEST_RECT_AREA_TO_AVOID);
break;
case LOCATION_BOUNDS_CIRCLE:
ret =
- (bool) location_is_supported_map_provider_capability(handle->object,
+ (bool) location_map_is_supported_provider_capability(handle->object,
MAP_SERVICE_ROUTE_REQUEST_CIRCLE_AREA_TO_AVOID);
break;
case LOCATION_BOUNDS_POLYGON:
ret =
- (bool) location_is_supported_map_provider_capability(handle->object,
+ (bool) location_map_is_supported_provider_capability(handle->object,
MAP_SERVICE_ROUTE_REQUEST_POLYGON_AREA_TO_AVOID);
break;
default:
ROUTE_PREFERENCE_NULL_ARG_CHECK_RETURN_FALSE(service);
route_service_s *handle = (route_service_s *) service;
- bool ret = (bool) location_is_supported_map_provider_capability(handle->object,
+ bool ret = (bool) location_map_is_supported_provider_capability(handle->object,
MAP_SERVICE_ROUTE_REQUEST_FREEFORM_ADDR_TO_AVOID);
return ret;
route_service_s *handle = (route_service_s *) service;
bool ret =
- (bool) location_is_supported_map_provider_capability(handle->object, MAP_SERVICE_ROUTE_PREF_GEOMETRY_BOUNDING_BOX);
+ (bool) location_map_is_supported_provider_capability(handle->object, MAP_SERVICE_ROUTE_PREF_GEOMETRY_BOUNDING_BOX);
return ret;
}
route_service_s *handle = (route_service_s *) service;
bool ret =
- (bool) location_is_supported_map_provider_capability(handle->object, MAP_SERVICE_ROUTE_PREF_GEOMETRY_RETRIEVAL);
+ (bool) location_map_is_supported_provider_capability(handle->object, MAP_SERVICE_ROUTE_PREF_GEOMETRY_RETRIEVAL);
return ret;
}
route_service_s *handle = (route_service_s *) service;
bool ret =
- (bool) location_is_supported_map_provider_capability(handle->object, MAP_SERVICE_ROUTE_PREF_INSTRUCTION_GEOMETRY);
+ (bool) location_map_is_supported_provider_capability(handle->object, MAP_SERVICE_ROUTE_PREF_INSTRUCTION_GEOMETRY);
return ret;
}
ROUTE_PREFERENCE_NULL_ARG_CHECK_RETURN_FALSE(service);
route_service_s *handle = (route_service_s *) service;
- bool ret = (bool) location_is_supported_map_provider_capability(handle->object,
+ bool ret = (bool) location_map_is_supported_provider_capability(handle->object,
MAP_SERVICE_ROUTE_PREF_INSTRUCTION_BOUNDING_BOX);
return ret;
route_service_s *handle = (route_service_s *) service;
bool ret =
- (bool) location_is_supported_map_provider_capability(handle->object, MAP_SERVICE_ROUTE_PREF_INSTRUCTION_RETRIEVAL);
+ (bool) location_map_is_supported_provider_capability(handle->object, MAP_SERVICE_ROUTE_PREF_INSTRUCTION_RETRIEVAL);
return ret;
}
route_service_s *handle = (route_service_s *) service;
bool ret =
- (bool) location_is_supported_map_provider_capability(handle->object, MAP_SERVICE_ROUTE_PREF_REALTIME_TRAFFIC);
+ (bool) location_map_is_supported_provider_capability(handle->object, MAP_SERVICE_ROUTE_PREF_REALTIME_TRAFFIC);
return ret;
}
route_service_s *handle = (route_service_s *) service;
LocationMapServiceType type = MAP_SERVICE_ROUTE_REQUEST_FEATURE_TO_AVOID;
GList *constraint_list = NULL;
- int ret = location_get_map_provider_capability_key(handle->object, type, &constraint_list);
- if (!ret) {
+ int ret = location_map_get_provider_capability_key(handle->object, type, &constraint_list);
+ if (ret) {
return _convert_error_code(ret, __FUNCTION__);
}
route_service_s *handle = (route_service_s *) service;
LocationMapServiceType type = MAP_SERVICE_ROUTE_PREF_TYPE;
GList *goal_list = NULL;
- int ret = location_get_map_provider_capability_key(handle->object, type, &goal_list);
- if (!ret) {
+ int ret = location_map_get_provider_capability_key(handle->object, type, &goal_list);
+ if (ret) {
return _convert_error_code(ret, __FUNCTION__);
}
route_service_s *handle = (route_service_s *) service;
LocationMapServiceType type = MAP_SERVICE_ROUTE_PREF_TRANSPORT_MODE;
GList *mode_list = NULL;
- int ret = location_get_map_provider_capability_key(handle->object, type, &mode_list);
- if (!ret) {
+ int ret = location_map_get_provider_capability_key(handle->object, type, &mode_list);
+ if (ret) {
return _convert_error_code(ret, __FUNCTION__);
}
route_service_s *handle = (route_service_s *) service;
LocationMapServiceType type = MAP_SERVICE_ROUTE_PREF_PROPERTY;
GList *key_list = NULL;
- int ret = location_get_map_provider_capability_key(handle->object, type, &key_list);
- if (!ret) {
+ int ret = location_map_get_provider_capability_key(handle->object, type, &key_list);
+ if (ret) {
return _convert_error_code(ret, __FUNCTION__);
}
route_service_s *handle = (route_service_s *) service;
LocationMapServiceType type = MAP_SERVICE_ROUTE_PREF_PROPERTY;
GList *key_list = NULL;
- int ret = location_get_map_provider_capability_key(handle->object, type, &key_list);
- if (!ret) {
+ int ret = location_map_get_provider_capability_key(handle->object, type, &key_list);
+ if (ret) {
return _convert_error_code(ret, __FUNCTION__);
}
ROUTE_SERVICE_PRINT_ERROR_CODE_RETURN(ROUTE_ERROR_OUT_OF_MEMORY);
}
- handle->object = location_new(LOCATION_METHOD_HYBRID);
+ handle->object = location_map_new(NULL);
if (handle->object == NULL) {
free(handle);
- LOGE("Fail to location_new");
+ LOGE("Fail to location_map_new");
ROUTE_SERVICE_PRINT_ERROR_CODE_RETURN(ROUTE_ERROR_SERVICE_NOT_AVAILABLE);
}
route_preference_destroy(handle->route_preference);
}
- int ret = location_free(handle->object);
+ int ret = location_map_free(handle->object);
if (ret != LOCATION_ERROR_NONE) {
return _convert_error_code(ret, __FUNCTION__);
}
calldata->callback = callback;
calldata->data = user_data;
- ret =
- location_request_route(handle->object, &start, &end, waypoint, pref->preference, __LocationRouteCB, calldata,
+ ret = location_map_request_route(handle->object, &start, &end, waypoint, pref->preference, __LocationRouteCB, calldata,
&reqid);
if (ret != LOCATION_ERROR_NONE) {
free(calldata);
route_service_s *handle = (route_service_s *) service;
- ret = location_cancel_route_request(handle->object, request_id);
+ ret = location_map_cancel_route_request(handle->object, request_id);
if (ret != LOCATION_ERROR_NONE) {
return _convert_error_code(ret, __func__);