166TEST(action_assets, BKE_action_has_single_frame)
170 const bAction empty = {{
nullptr}};
171 EXPECT_FALSE(empty.wrap().has_single_frame())
172 <<
"Action without FCurves cannot have a single frame.";
178 std::unique_ptr<BezTriple[]> bezt = allocate_keyframes(&fcu, 1);
179 add_keyframe(&fcu, 1.0f, 2.0f);
184 EXPECT_TRUE(action.wrap().has_single_frame())
185 <<
"Action with one FCurve and one key should have single frame.";
192 std::unique_ptr<BezTriple[]> bezt1 = allocate_keyframes(&fcu1, 1);
193 std::unique_ptr<BezTriple[]> bezt2 = allocate_keyframes(&fcu2, 1);
194 add_keyframe(&fcu1, 1.0f, 327.0f);
195 add_keyframe(&fcu2, 1.0f, 47.0f);
201 EXPECT_TRUE(action.wrap().has_single_frame())
202 <<
"Two FCurves with keys on the same frame should have single frame.";
206 EXPECT_FALSE(action.wrap().has_single_frame())
207 <<
"Two FCurves with keys on different frames should have animation.";
213 std::unique_ptr<BezTriple[]> bezt = allocate_keyframes(&fcu, 2);
214 add_keyframe(&fcu, 1.0f, 2.0f);
215 add_keyframe(&fcu, 2.0f, 2.5f);
220 EXPECT_FALSE(action.wrap().has_single_frame())
221 <<
"Action with one FCurve and two keys must have animation.";