elm_map: Update elm_map_overlay_icon_set/get test 60/130960/3
authorse.osadchy <se.osadchy@samsung.com>
Tue, 14 Mar 2017 13:02:30 +0000 (15:02 +0200)
committerSungtaek Hong <sth253.hong@samsung.com>
Thu, 15 Jun 2017 05:35:54 +0000 (14:35 +0900)
Change-Id: I1a3f9881e21bd7b4841e5cf8591a132efabc9830
Signed-off-by: Sergey Osadchy <se.osadchy@samsung.com>
TC/elementary/map/utc_elm_map_overlay_icon_get.c
TC/elementary/map/utc_elm_map_overlay_icon_set.c

index 3a0df2882350e716b04b93261766edb88a2fbf28..343b33eb893e4e3ebf695cab29b605b62d9136b2 100644 (file)
@@ -69,7 +69,7 @@ teardown(void)
  * @step 1 Set an overlay icon
  * @step 2 Get an overlay icon
  * @step 3 Set NULL instead of the icon
- * @step 4 Get an overlay icon
+ * @step 4 Get an overlay icon, it should be NULL
  *
  * @passcondition Returned value is equal to icon at step 2 and at step 4 and there is no segmentation fault
  * @}
@@ -90,7 +90,7 @@ START_TEST(utc_elm_map_overlay_icon_get_p)
      }
    elm_map_overlay_icon_set(ovl, NULL);
    ic = elm_map_overlay_icon_get(ovl);
-   if (ic != icon)
+   if (ic != NULL)
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed, returned value is not NULL..", __FILE__, __LINE__);
      }
index dda4808964c218a6a8165153161fc730baa267d4..a5e6aa3de2a27e656dec2b2ec18e6270a3005a54 100644 (file)
@@ -65,20 +65,29 @@ teardown(void)
  * works properly and doesn't cause segmentation fault
  * @n Input Data:
  * @li the ovl object
- * @li NULL, the icon object
+ * @li the icon object
  *
  * @procedure
- * @step 1 Set an overlay icon
+ * @step 1 Set icon to default overlay
  * @step 2 Get an overlay icon
  * @step 3 Set NULL instead of the icon
  * @step 4 Get an overlay icon
+ * @step 5 Delete default overlay
+ * @step 6 Set icon to class overlay
+ * @step 7 Get an overlay icon
+ * @step 8 Delete class overlay
+ * @step 9 Set icon to bubble overlay
+ * @step 10 Get an overlay icon
+ * @step 11 Delete bubble overlay
  *
- * @passcondition Returned value is equal to icon at step 2 and NULL at step 4 and there is no segmentation fault
+ * @passcondition Returned value is equal to icon at step 2 and 7; NULL at step 4 and 10 and there is no segmentation fault
  * @}
  */
 START_TEST(utc_elm_map_overlay_icon_set_p)
 {
    const Evas_Object *ic = NULL;
+   Elm_Map_Overlay *class = NULL;
+   Elm_Map_Overlay *bubble = NULL;
 
    if ((ovl == NULL) || (icon == NULL))
      {
@@ -88,14 +97,49 @@ START_TEST(utc_elm_map_overlay_icon_set_p)
    ic = elm_map_overlay_icon_get(ovl);
    if (ic != icon)
      {
+        elm_map_overlay_del(ovl);
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed, returned value is not icon..", __FILE__, __LINE__);
      }
+
    elm_map_overlay_icon_set(ovl, NULL);
    ic = elm_map_overlay_icon_get(ovl);
-   if (ic == NULL)
+   if (ic != NULL)
+     {
+        elm_map_overlay_del(ovl);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed, returned value is not NULL..", __FILE__, __LINE__);
+     }
+   elm_map_overlay_del(ovl);
+   ic = NULL;
+
+   class = elm_map_overlay_class_add(map);
+   if (class == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create an overlay..", __FILE__, __LINE__);
+     }
+   elm_map_overlay_icon_set(class, icon);
+   ic = elm_map_overlay_icon_get(class);
+   if (ic != icon)
+     {
+        elm_map_overlay_del(class);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed, returned value is not icon..", __FILE__, __LINE__);
+     }
+   elm_map_overlay_del(class);
+   ic = NULL;
+
+   bubble = elm_map_overlay_bubble_add(map);
+   if (bubble == NULL)
      {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create an overlay..", __FILE__, __LINE__);
+     }
+   elm_map_overlay_icon_set(bubble, icon);
+   ic = elm_map_overlay_icon_get(bubble);
+   if (ic != NULL)
+     {
+        elm_map_overlay_del(bubble);
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed, returned value is not NULL..", __FILE__, __LINE__);
      }
+   elm_map_overlay_del(bubble);
+
    printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
 }
 END_TEST