elm_map: Update elm_map_overlay_region_set test
authorse.osadchy <se.osadchy@samsung.com>
Thu, 6 Apr 2017 08:11:07 +0000 (11:11 +0300)
committerse.osadchy <se.osadchy@samsung.com>
Thu, 6 Apr 2017 08:11:30 +0000 (11:11 +0300)
Change-Id: Ib99a0e84bb12e961c6542bc0bd563a029b453957
Signed-off-by: Sergey Osadchy <se.osadchy@samsung.com>
TC/elementary/map/utc_elm_map_overlay_region_set.c

index 6e90094eb222999fd94632435e934f7fddc8d4ec..ca4cef66d39711b015c2d6436765e39bacbc02c0 100644 (file)
@@ -15,7 +15,6 @@ Elm_Map_Overlay *ovl = NULL;
  * @step 1 Initialize Elementary
  * @step 2 Create and show main window
  * @step 3 Add a new map widget to the main window
- * @step 4 Add a new overlay to the map object
  */
 static void
 setup(void)
@@ -33,11 +32,6 @@ setup(void)
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a map widget..", __FILE__, __LINE__);
      }
-   ovl = elm_map_overlay_add(map, 2.352, 48.857);
-   if (ovl == NULL)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create an overlay..", __FILE__, __LINE__);
-     }
 }
 
 static void
@@ -59,14 +53,20 @@ teardown(void)
  * works properly and doesn't cause segmentation fault
  * @n Input Data:
  * @li the overlay object
- * @li 5.4
- * @li 16.5
+ * @li longitude value
+ * @li latitude value
  *
  * @procedure
- * @step 1 Set the geographic coordinates of the overlay (Longitude = 5.4, Latitude = 16.5)
- * @step 2 Get the geographic coordinates of the overlay
+ * @step 1 Create new default overlay
+ * @step 2 Set the geographic coordinates of the default overlay (Longitude = 5.4, Latitude = 16.5)
+ * @step 3 Get the geographic coordinates of the default overlay
+ * @step 4 Delete overlay
+ * @step 5 Create new bubble overlay
+ * @step 6 Set the geographic coordinates of the bubble overlay (Longitude = 6.4, Latitude = 15.5)
+ * @step 7 Get the geographic coordinates of the bubble overlay
+ * @step 8 Delete overlay
  *
- * @passcondition Returned values of longitude and latitude are the 5.4 and 16.5 in DBL_EPSILON range respectively
+ * @passcondition Returned values of longitudes and latitudes for different overlays in DBL_EPSILON range respectively
  * and there is no segmentation fault
  * @}
  */
@@ -74,7 +74,9 @@ START_TEST(utc_elm_map_overlay_region_set_p)
 {
    double x = 0.0;
    double y = 0.0;
+   Elm_Map_Overlay *bubble = NULL;
 
+   ovl = elm_map_overlay_add(map, 2.352, 48.857);
    if (ovl == NULL)
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
@@ -83,8 +85,25 @@ START_TEST(utc_elm_map_overlay_region_set_p)
    elm_map_overlay_region_get(ovl, &x, &y);
    if ((fabs(x - 5.4) > DBL_EPSILON) || (fabs(y - 16.5) > DBL_EPSILON))
      {
+        elm_map_overlay_del(ovl);
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
      }
+   elm_map_overlay_del(ovl);
+
+   bubble = elm_map_overlay_bubble_add(map);
+   if (bubble == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+   elm_map_overlay_region_set(bubble, 6.4, 15.5);
+   elm_map_overlay_region_get(bubble, &x, &y);
+   if ((fabs(x - 6.4) > DBL_EPSILON) || (fabs(y - 15.5) > DBL_EPSILON))
+     {
+        elm_map_overlay_del(bubble);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+   elm_map_overlay_del(bubble);
+
    printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
 }
 END_TEST