summaryrefslogtreecommitdiff
path: root/src/tests/evas/efl_canvas_animation.c
blob: e7d0b16ff9a50c4baeb8afb72e694d4d1d70d6c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdio.h>

#include <Evas.h>

#include "evas_suite.h"
#include "evas_tests_helpers.h"

EFL_START_TEST(efl_canvas_animation_negative_double_checking)
{
   Efl_Canvas_Animation *animation = efl_new(EFL_CANVAS_ANIMATION_CLASS);

   efl_animation_duration_set(animation, 1.0);
   ck_assert_int_eq(efl_animation_duration_get(animation), 1.0);
   efl_animation_duration_set(animation, 3.0);
   ck_assert_int_eq(efl_animation_duration_get(animation), 3.0);
   EXPECT_ERROR_START;
   efl_animation_duration_set(animation, -1.0);
   ck_assert_int_eq(efl_animation_duration_get(animation), 3.0);
   EXPECT_ERROR_END;

   efl_animation_start_delay_set(animation, 1.0);
   ck_assert(EINA_DBL_EQ(efl_animation_start_delay_get(animation), 1.0));
   efl_animation_start_delay_set(animation, 0.0);
   ck_assert(EINA_DBL_EQ(efl_animation_start_delay_get(animation), 0.0));
   EXPECT_ERROR_START;
   efl_animation_start_delay_set(animation, -1.0);
   ck_assert_int_eq(efl_animation_start_delay_get(animation), 0.0);
   EXPECT_ERROR_END;

}
EFL_END_TEST

EFL_START_TEST(efl_canvas_animation_default_value)
{
   Efl_Canvas_Animation *animation = efl_new(EFL_CANVAS_ANIMATION_CLASS);

   fail_if(efl_animation_duration_get(animation) == 0.0);
}
EFL_END_TEST

void efl_test_canvas_animation(TCase *tc)
{
   tcase_add_test(tc, efl_canvas_animation_negative_double_checking);
   tcase_add_test(tc, efl_canvas_animation_default_value);
}