4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Youngae Kang <youngae.kang@samsung.com>, Yunhan Kim <yhan.kim@samsung.com>,
7 * Genie Kim <daejins.kim@samsung.com>, Minjune Kim <sena06.kim@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
24 #include <gconf/gconf-client.h>
27 static void startup(), cleanup();
28 void (*tet_startup) () = startup;
29 void (*tet_cleanup) () = cleanup;
31 static void utc_location_get_position_from_freeformed_address_01();
32 static void utc_location_get_position_from_freeformed_address_02();
33 static void utc_location_get_position_from_freeformed_address_03();
34 static void utc_location_get_position_from_freeformed_address_04();
36 struct tet_testlist tet_testlist[] = {
37 {utc_location_get_position_from_freeformed_address_01,1},
38 {utc_location_get_position_from_freeformed_address_02,2},
39 {utc_location_get_position_from_freeformed_address_03,3},
40 {utc_location_get_position_from_freeformed_address_04,4},
44 static GMainLoop *loop = NULL;
49 #define GCONF_PROXY_MODE "/system/proxy/mode"
50 #define GCONF_HTTP_PROXY_HOST "/system/http_proxy/host"
51 #define GCONF_HTTP_PROXY_PORT "/system/http_proxy/port"
52 #define ENV_HTTP_PROXY "http_proxy"
55 exit_loop (gpointer data)
57 g_main_loop_quit (loop);
64 loc = location_new(LOCATION_METHOD_GPS);
66 loop = g_main_loop_new(NULL,FALSE);
67 g_main_loop_run (loop);
69 tet_printf("\n TC startup");
75 tet_printf("\n TC End");
79 utc_location_get_position_from_freeformed_address_01()
81 LocationPosition *pos = NULL;
82 LocationAccuracy *acc = NULL;
83 char* addr_str = g_strdup("4 N 2nd Street 95113");
84 ret = location_get_position_from_freeformed_address(loc, addr_str, &pos, &acc);
86 tet_printf("Returned value: %d", ret);
87 if( (ret == LOCATION_ERROR_NONE &&
88 37.325276 <= pos->latitude && pos->latitude <= 37.345276 &&
89 -121.900059 <= pos->longitude && pos->longitude<= -121.880059) ||
90 ret == LOCATION_ERROR_CONFIGURATION ) {
91 location_position_free (pos);
92 location_accuracy_free (acc);
101 utc_location_get_position_from_freeformed_address_02()
103 LocationPosition *pos = NULL;
104 LocationAccuracy *acc = NULL;
105 char* addr_str = g_strdup("4 N 2nd Street 95113");
106 ret = location_get_position_from_freeformed_address(NULL, addr_str, &pos, &acc);
108 tet_printf("Returned value: %d", ret);
109 if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
110 else tet_result(TET_FAIL);
114 utc_location_get_position_from_freeformed_address_03()
116 LocationPosition *pos = NULL;
117 LocationAccuracy *acc = NULL;
118 ret = location_get_position_from_freeformed_address(loc, NULL, &pos, &acc);
119 tet_printf("Returned value: %d", ret);
120 if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
121 else tet_result(TET_FAIL);
125 utc_location_get_position_from_freeformed_address_04()
127 LocationAccuracy *acc = NULL;
128 char* addr_str = g_strdup("4 N 2nd Street 95113");
129 ret = location_get_position_from_freeformed_address(loc, addr_str, NULL, &acc);
131 tet_printf("Returned value: %d", ret);
132 if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
133 else tet_result(TET_FAIL);