lottie: Process Dash info inside lottie library.
[platform/core/uifw/lottie-player.git] / test / test_lottieanimation_capi.cpp
1 #include <gtest/gtest.h>
2 #include "lottieanimation_capi.h"
3
4 class AnimationCApiTest : public ::testing::Test {
5 public:
6     void SetUp()
7     {
8         animationInvalid = lottie_animation_from_file("wrong_file.json");
9         std::string filePath = DEMO_DIR;
10         filePath +="mask.json";
11         animation = lottie_animation_from_file(filePath.c_str());
12
13     }
14     void TearDown()
15     {
16         if (animation) lottie_animation_destroy(animation);
17     }
18 public:
19     Lottie_Animation *animationInvalid;
20     Lottie_Animation *animation;
21 };
22
23 TEST_F(AnimationCApiTest, loadFromFile_N) {
24     ASSERT_FALSE(animationInvalid);
25 }
26
27 TEST_F(AnimationCApiTest, loadFromFile) {
28     ASSERT_TRUE(animation);
29     ASSERT_EQ(lottie_animation_get_totalframe(animation), 29);
30     size_t width, height;
31     lottie_animation_get_size(animation, &width, &height);
32     ASSERT_EQ(width, 500);
33     ASSERT_EQ(height, 500);
34 }