Evas_Object *main_win = NULL;
Evas_Object *map = NULL;
Elm_Map_Route *route = NULL;
-const char *nodes = NULL;
+
+static void _route_loaded_fail(void* data, Evas_Object* obj, void* event_info)
+{
+ elm_exit();
+}
static void _route_loaded(void* data, Evas_Object* obj, void* event_info)
{
- nodes = elm_map_route_node_get(route);
+ Eina_Bool *load_success = data;
+
+ *load_success = EINA_TRUE;
elm_exit();
}
* @step 2 Create and show main window
* @step 3 Add a new map widget to the main window
* @step 4 Add a new route
+ * @step 5 Load a route information
*/
static void
setup(void)
{
+ Eina_Bool load_success = EINA_FALSE;
+
printf(" ============ Startup ============ \n");
elm_init(0, NULL);
main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a route..", __FILE__, __LINE__);
}
+
+ evas_object_smart_callback_add(map, "route,loaded", _route_loaded, &load_success);
+ evas_object_smart_callback_add(map, "route,loaded,fail", _route_loaded_fail, NULL);
+
+ ecore_timer_add(10, _elm_exit, NULL);
+ elm_run();
+ if (load_success == EINA_FALSE)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to load route..", __FILE__, __LINE__);
+ }
}
static void
* @n Input Data: the route object
*
* @procedure
- * @step 1 Register _elm_exit callback to be run 4 second after main loop start
- * @step 2 Run the elementary main loop
- * @step 3 Get the information of route nodes on _route_loaded call
+ * @step 1 Get the information of route nodes from loaded route
*
* @passcondition Returned string is not NULL and there is no segmentation fault
* @}
*/
START_TEST(utc_elm_map_route_node_get_p)
{
+ const char *nodes = NULL;
+
if (route == NULL)
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
}
- ecore_timer_add(10.0, _elm_exit, NULL);
- evas_object_smart_callback_add(map, "route,loaded", _route_loaded, NULL);
- elm_run();
+
+ nodes = elm_map_route_node_get(route);
+
if (nodes == NULL)
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
Evas_Object *main_win = NULL;
Evas_Object *map = NULL;
Elm_Map_Route *route = NULL;
-const char *waypoint = NULL;
-Eina_Bool load_success = EINA_FALSE;
static void _route_loaded_fail(void* data, Evas_Object* obj, void* event_info)
{
static void _route_loaded(void* data, Evas_Object* obj, void* event_info)
{
- load_success = EINA_TRUE;
- waypoint = elm_map_route_waypoint_get(route);
+ Eina_Bool *load_success = data;
+
+ *load_success = EINA_TRUE;
elm_exit();
}
* @step 2 Create and show main window
* @step 3 Add a new map widget to the main window
* @step 4 Add a new route
+ * @step 5 Load a route information
*/
static void
setup(void)
{
+ Eina_Bool load_success = EINA_FALSE;
+
printf(" ============ Startup ============ \n");
elm_init(0, NULL);
main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a route..", __FILE__, __LINE__);
}
- load_success = EINA_FALSE;
+
+ evas_object_smart_callback_add(map, "route,loaded", _route_loaded, &load_success);
+ evas_object_smart_callback_add(map, "route,loaded,fail", _route_loaded_fail, NULL);
+
+ ecore_timer_add(10, _elm_exit, NULL);
+ elm_run();
+ if (load_success == EINA_FALSE)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to load route..", __FILE__, __LINE__);
+ }
}
static void
* @n Input Data: the route object
*
* @procedure
- * @step 1 Register _elm_exit callback to be run 4 second after main loop start
- * @step 2 Run the elementary main loop
- * @step 3 Get the information of route waypoint on _route_loaded call
+ * @step 1 Get the information of route waypoint from loaded route
*
* @passcondition Returned string is not NULL and there is no segmentation fault
* @}
*/
START_TEST(utc_elm_map_route_waypoint_get_p)
{
+ const char *waypoint = NULL;
+
if (route == NULL)
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
}
- evas_object_smart_callback_add(map, "route,loaded", _route_loaded, NULL);
- evas_object_smart_callback_add(map, "route,loaded,fail", _route_loaded_fail, NULL);
- ecore_timer_add(10, _elm_exit, NULL);
- elm_run();
- if (load_success == EINA_FALSE)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to load route..", __FILE__, __LINE__);
- }
+
+ waypoint = elm_map_route_waypoint_get(route);
+
if (waypoint == NULL)
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
}
+
printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
}
END_TEST