163TEST(action_assets, BKE_action_has_single_frame)
167 const bAction empty = {{
nullptr}};
168 EXPECT_FALSE(empty.wrap().has_single_frame())
169 <<
"Action without FCurves cannot have a single frame.";
175 std::unique_ptr<BezTriple[]> bezt = allocate_keyframes(&fcu, 1);
176 add_keyframe(&fcu, 1.0f, 2.0f);
181 EXPECT_TRUE(action.wrap().has_single_frame())
182 <<
"Action with one FCurve and one key should have single frame.";
189 std::unique_ptr<BezTriple[]> bezt1 = allocate_keyframes(&fcu1, 1);
190 std::unique_ptr<BezTriple[]> bezt2 = allocate_keyframes(&fcu2, 1);
191 add_keyframe(&fcu1, 1.0f, 327.0f);
192 add_keyframe(&fcu2, 1.0f, 47.0f);
198 EXPECT_TRUE(action.wrap().has_single_frame())
199 <<
"Two FCurves with keys on the same frame should have single frame.";
203 EXPECT_FALSE(action.wrap().has_single_frame())
204 <<
"Two FCurves with keys on different frames should have animation.";
210 std::unique_ptr<BezTriple[]> bezt = allocate_keyframes(&fcu, 2);
211 add_keyframe(&fcu, 1.0f, 2.0f);
212 add_keyframe(&fcu, 2.0f, 2.5f);
217 EXPECT_FALSE(action.wrap().has_single_frame())
218 <<
"Action with one FCurve and two keys must have animation.";