elm_animation_view: Change check value from progress to frame. 00/205300/1
authorJunsuChoi <jsuya.choi@samsung.com>
Thu, 2 May 2019 05:56:44 +0000 (14:56 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 2 May 2019 05:56:44 +0000 (14:56 +0900)
Current progress is always 0 to 1.
If the total frame is 9 and min_progress is 0.3(min_frame 2)
and max_progress is 0.7(max_frame 6),
current progress is 0.5, which means 4th frame.

Change-Id: Ia0dfb56b343020899e65a7e4d63eebf31f19b23b

TC/elementary/animation_view/utc_elm_animation_view_max_progress_get_set.c
TC/elementary/animation_view/utc_elm_animation_view_min_progress_get_set.c

index 0ab6b740ba7b355bb0a22f17a75341f6db1074ef..bbb4c8aa3aae52eb304c4891640d31255e24ff1f 100644 (file)
@@ -57,10 +57,10 @@ teardown(void)
 static void _play_update_cb(void *data, Evas_Object *obj, void *event_info)
 {
    Evas_Object *anim_view = data;
-   double current_progress;
+   int current_frame;
 
-   current_progress = elm_animation_view_progress_get(anim_view);
-   if (current_progress > 0.5)
+   current_frame = elm_animation_view_frame_get(anim_view);
+   if (current_frame > (int)((elm_animation_view_frame_count_get(anim_view) - 1) * 0.5))
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
         return;
@@ -86,12 +86,12 @@ static void _play_stop_cb(void *data, Evas_Object *obj, void *event_info)
  * @step 2  Check current last progress
  * @step 2  Call elm_animation_view_play
  * @step 3  Run the main loop
- * @step 4  Check current progress whenever "play,update" callback is called
+ * @step 4  Check current frame whenever "play,update" callback is called
  *
  * @passcondition
  * @li Test passes if default last progress is 1.0 and there is no segmentation fault
  * @li Test passes if last progress is changed to 0.5 after setting it to 0.5
- * @li Test passes if current progress is not bigger than 0.5 whenever "play,update" is called
+ * @li Test passes if current frame is not bigger than 0.5 * total frame whenever "play,update" is called
  * @}
  */
 START_TEST(utc_elm_animation_view_max_progress_get_set_p)
index efbb3082adab88e31b155d3cba557444206cd4e2..026cf08fa79cf0e25ac4743ba6d3133f57ddb2ef 100644 (file)
@@ -57,10 +57,10 @@ teardown(void)
 static void _play_update_cb(void *data, Evas_Object *obj, void *event_info)
 {
    Evas_Object *anim_view = data;
-   double current_progress;
+   int current_frame;
 
-   current_progress = elm_animation_view_progress_get(anim_view);
-   if (current_progress < 0.5)
+   current_frame = elm_animation_view_frame_get(anim_view);
+   if (current_frame < (int)((elm_animation_view_frame_count_get(anim_view) - 1) * 0.5))
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
         return;
@@ -86,12 +86,12 @@ static void _play_stop_cb(void *data, Evas_Object *obj, void *event_info)
  * @step 2  Check current start progress
  * @step 2  Call elm_animation_view_play
  * @step 3  Run the main loop
- * @step 4  Check current progress whenever "play,update" callback is called
+ * @step 4  Check current frame whenever "play,update" callback is called
  *
  * @passcondition
  * @li Test passes if default start progress is 0.0 and there is no segmentation fault
  * @li Test passes if start progress is changed to 0.5 after setting it to 0.5
- * @li Test passes if current progress is not less than 0.5 whenever "play,update" is called
+ * @li Test passes if current frame is not less than 0.5 * total frame whenever "play,update" is called
  * @}
  */
 START_TEST(utc_elm_animation_view_min_progress_get_set_p)