MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TEST_F

Function TEST_F

snap_drawing/test/src/LottieLayer_tests.cpp:74–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72};
73
74TEST_F(AnimatedImageLayerTests, setsAnimationWhenSceneIsSetWithAdvanceRate) {
75 update(0.5);
76
77 ASSERT_FALSE(_animatedImageLayer->needsProcessAnimations());
78
79 _animatedImageLayer->setImage(_animatedImage);
80
81 ASSERT_EQ(static_cast<size_t>(0), _animatedImageLayer->getAnimationKeys().size());
82 ASSERT_FALSE(_animatedImageLayer->needsProcessAnimations());
83
84 _animatedImageLayer->setAdvanceRate(1.0);
85
86 ASSERT_EQ(static_cast<size_t>(1), _animatedImageLayer->getAnimationKeys().size());
87 ASSERT_TRUE(_animatedImageLayer->needsProcessAnimations());
88
89 ASSERT_TRUE(update(0.5));
90
91 ASSERT_EQ(static_cast<size_t>(1), _animatedImageLayer->getAnimationKeys().size());
92 ASSERT_TRUE(_animatedImageLayer->needsProcessAnimations());
93
94 _animatedImageLayer->setImage(nullptr);
95
96 ASSERT_EQ(static_cast<size_t>(0), _animatedImageLayer->getAnimationKeys().size());
97 ASSERT_TRUE(_animatedImageLayer->needsProcessAnimations());
98
99 ASSERT_TRUE(update(0.5));
100
101 ASSERT_EQ(static_cast<size_t>(0), _animatedImageLayer->getAnimationKeys().size());
102 ASSERT_FALSE(_animatedImageLayer->needsProcessAnimations());
103
104 _animatedImageLayer->setImage(_animatedImage);
105
106 ASSERT_EQ(static_cast<size_t>(1), _animatedImageLayer->getAnimationKeys().size());
107 ASSERT_TRUE(_animatedImageLayer->needsProcessAnimations());
108}
109
110TEST_F(AnimatedImageLayerTests, canSeek) {
111 _animatedImageLayer->setImage(_animatedImage);

Callers

nothing calls this directly

Calls 10

updateFunction · 0.85
getAnimationKeysMethod · 0.80
getCurrentTimeMethod · 0.65
setCurrentTimeMethod · 0.65
setImageMethod · 0.45
sizeMethod · 0.45
setAdvanceRateMethod · 0.45
millisecondsMethod · 0.45
setShouldLoopMethod · 0.45

Tested by

no test coverage detected