elm_map: Update elm_map_overlay_show test
authorse.osadchy <se.osadchy@samsung.com>
Tue, 18 Apr 2017 12:43:52 +0000 (15:43 +0300)
committerse.osadchy <se.osadchy@samsung.com>
Tue, 18 Apr 2017 12:44:28 +0000 (15:44 +0300)
Change-Id: I2a408e8af35ff2ce088e98eeb48a6e71509a8ed9
Signed-off-by: Sergey Osadchy <se.osadchy@samsung.com>
TC/elementary/map/utc_elm_map_overlay_show.c

index 1253d35c75744409c3d225466adc6666a7d3914d..be03ef62d8e884a6bca6a779810fd9070ce3ee91 100644 (file)
@@ -1,6 +1,7 @@
 #include <check.h>
 #include <Elementary.h>
 #include "../../utc_negative_unitest.h"
+
 Evas_Object *main_win = NULL;
 Evas_Object *map = NULL;
 Elm_Map_Overlay *ovl = NULL;
@@ -42,11 +43,20 @@ setup(void)
 static void
 teardown(void)
 {
+   if (ovl != NULL)
+     {
+        elm_map_overlay_del(ovl);
+     }
+   if (map != NULL)
+     {
+        evas_object_del(map);
+     }
    if ( NULL != main_win)
      {
         evas_object_del(main_win);
         main_win = NULL;
      }
+
    elm_shutdown();
    printf(" ============ Cleanup ============ \n");
 }
@@ -59,19 +69,39 @@ teardown(void)
  * @n Input Data: the overlay object
  *
  * @procedure
- * @step 1 Show the given overlay
+ * @step 1 Check status and type of default overlay
+ * @step 2 Show the given overlay
+ * @step 3 Create bubble overlay
+ * @step 4 Check status and type
+ * @step 5 Show the given overlay
+ * @step 6 Delete bubble overlay
  *
  * @passcondition There is no segmentation fault
  * @}
  */
 START_TEST(utc_elm_map_overlay_show_p)
 {
-   if (ovl == NULL)
+   Elm_Map_Overlay_Type type = ELM_MAP_OVERLAY_TYPE_NONE;
+   Elm_Map_Overlay *bubble_img = NULL;
+
+   type = elm_map_overlay_type_get(ovl);
+   if ((ovl == NULL) || (type != ELM_MAP_OVERLAY_TYPE_DEFAULT))
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
      }
    elm_map_overlay_show(ovl);
    /*TODO Write a method that will help to check elm_map_overlay_show()*/
+
+   bubble_img = elm_map_overlay_bubble_add(map);
+   type = elm_map_overlay_type_get(bubble_img);
+   if ((bubble_img == NULL) || (type != ELM_MAP_OVERLAY_TYPE_BUBBLE))
+     {
+        elm_map_overlay_del(bubble_img);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+   elm_map_overlay_show(bubble_img);
+   elm_map_overlay_del(bubble_img);
+
    printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
 }
 END_TEST