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.
26 static void startup(), cleanup();
27 void (*tet_startup) () = startup;
28 void (*tet_cleanup) () = cleanup;
30 static void utc_location_get_satellite_01();
31 static void utc_location_get_satellite_02();
32 static void utc_location_get_satellite_03();
34 struct tet_testlist tet_testlist[] = {
35 {utc_location_get_satellite_01,1},
36 {utc_location_get_satellite_02,2},
37 {utc_location_get_satellite_03,3},
41 static GMainLoop *loop = NULL;
46 exit_loop (gpointer data)
48 g_main_loop_quit (loop);
56 loc = location_new(LOCATION_METHOD_GPS);
58 loop = g_main_loop_new(NULL,FALSE);
59 tet_printf("\n TC startup");
66 tet_printf("\n TC End");
70 _get_satellite (GObject *self,
74 LocationSatellite *sat = NULL;
75 LocationObject *loc = (LocationObject*)userdata;
77 ret = location_get_satellite (loc, &sat);
78 tet_printf("Returned value: %d", ret);
79 if (ret == LOCATION_ERROR_NONE) {
80 location_satellite_free(sat);
82 } else tet_result(TET_FAIL);
83 g_main_loop_quit (loop);
87 utc_location_get_satellite_01()
89 g_signal_connect (loc, "service-enabled", G_CALLBACK(_get_satellite), loc);
90 g_timeout_add_seconds(60, exit_loop, loop);
91 g_main_loop_run (loop);
95 utc_location_get_satellite_02()
97 LocationSatellite *sat = NULL;
98 ret = location_get_satellite (NULL, &sat);
99 tet_printf("Returned value: %d", ret);
100 if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
101 else tet_result(TET_FAIL);
105 utc_location_get_satellite_03()
107 LocationSatellite *sat = NULL;
108 ret = location_get_satellite (loc, NULL);
109 tet_printf("Returned value: %d", ret);
110 if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
111 else tet_result(TET_FAIL);