Files
tdesktop/Telegram/ThirdParty/rlottie/test/test_lottieanimation.cpp
allhaileris afb81b8278
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
init
2026-02-16 15:50:16 +03:00

35 lines
822 B
C++

#include <gtest/gtest.h>
#include "rlottie.h"
class AnimationTest : public ::testing::Test {
public:
void SetUp()
{
animationInvalid = rlottie::Animation::loadFromFile("wrong_file.json");
std::string filePath = DEMO_DIR;
filePath +="mask.json";
animation = rlottie::Animation::loadFromFile(filePath);
}
void TearDown()
{
}
public:
std::unique_ptr<rlottie::Animation> animationInvalid;
std::unique_ptr<rlottie::Animation> animation;
};
TEST_F(AnimationTest, loadFromFile_N) {
ASSERT_FALSE(animationInvalid);
}
TEST_F(AnimationTest, loadFromFile) {
ASSERT_TRUE(animation != nullptr);
ASSERT_EQ(animation->totalFrame(), 30);
size_t width, height;
animation->size(width, height);
ASSERT_EQ(width, 500);
ASSERT_EQ(height, 500);
}