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_address_01();
32 static void utc_location_get_position_from_address_02();
33 static void utc_location_get_position_from_address_03();
34 static void utc_location_get_position_from_address_04();
36 struct tet_testlist tet_testlist[] = {
37 {utc_location_get_position_from_address_01,1},
38 {utc_location_get_position_from_address_02,2},
39 {utc_location_get_position_from_address_03,3},
40 {utc_location_get_position_from_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_address_01()
81 LocationPosition *pos = NULL;
82 LocationAccuracy *acc = NULL;
83 LocationAddress *addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
84 ret = location_get_position_from_address (loc, addr, &pos, &acc);
85 location_address_free(addr);
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);
94 } else tet_result(TET_FAIL);
98 utc_location_get_position_from_address_02()
100 LocationPosition *pos = NULL;
101 LocationAccuracy *acc = NULL;
102 LocationAddress *addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
103 ret = location_get_position_from_address (NULL, addr, &pos, &acc);
104 location_address_free(addr);
105 tet_printf("Returned value: %d", ret);
106 if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
107 else tet_result(TET_FAIL);
111 utc_location_get_position_from_address_03()
113 LocationPosition *pos = NULL;
114 LocationAccuracy *acc = NULL;
115 ret = location_get_position_from_address(loc, NULL, &pos, &acc);
116 tet_printf("Returned value: %d", ret);
117 if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
118 else tet_result(TET_FAIL);
122 utc_location_get_position_from_address_04()
124 LocationAddress *addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");;
125 LocationAccuracy *acc = NULL;
126 ret = location_get_position_from_address(loc, addr, NULL, &acc);
127 location_address_free (addr);
128 tet_printf("Returned value: %d", ret);
129 if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
130 else tet_result(TET_FAIL);