diff --git a/tests/animation/Animation.cpp b/tests/animation/Animation.cpp index 1d2521b..fb07bd8 100644 --- a/tests/animation/Animation.cpp +++ b/tests/animation/Animation.cpp @@ -21,7 +21,7 @@ template using CAnimatedVariable = CGenericAnimatedVariable; template -using PANIMVAR = SP>; +using PANIMVAR = UP>; template using PANIMVARREF = WP>; @@ -48,7 +48,7 @@ class CMyAnimationManager : public CAnimationManager { public: void tick() { for (size_t i = 0; i < m_vActiveAnimatedVariables.size(); i++) { - const auto PAV = m_vActiveAnimatedVariables[i].lock(); + const auto PAV = m_vActiveAnimatedVariables[i]; if (!PAV || !PAV->ok() || !PAV->isBeingAnimated()) continue; @@ -93,11 +93,10 @@ class CMyAnimationManager : public CAnimationManager { template void createAnimation(const VarType& v, PANIMVAR& av, const std::string& animationConfigName) { constexpr const eAVTypes EAVTYPE = std::is_same_v ? eAVTypes::INT : eAVTypes::TEST; - const auto PAV = makeShared>(); + av = makeUnique>(); - PAV->create(EAVTYPE, sc(this), PAV, v); - PAV->setConfig(animationTree.getConfig(animationConfigName)); - av = std::move(PAV); + av->create(EAVTYPE, sc(this), av, v); + av->setConfig(animationTree.getConfig(animationConfigName)); } virtual void scheduleTick() { @@ -298,7 +297,7 @@ TEST(Animation, animation) { // test adding / removing vars during a tick s.m_iA->resetAllCallbacks(); s.m_iA->setUpdateCallback([&vars](WP v) { - if (v.lock() != vars.back()) + if (v.get() != vars.back().get()) vars.back()->warp(); }); s.m_iA->setCallbackOnEnd([&s, &vars](auto) { @@ -350,7 +349,7 @@ TEST(Animation, animation) { *s.m_iA = 5; s.m_iA->setCallbackOnEnd([&endCallbackRan](WP v) { endCallbackRan++; - const auto PAV = dc*>(v.lock().get()); + const auto PAV = dc*>(v.get()); *PAV = 10; PAV->setCallbackOnEnd([&endCallbackRan](WP v) { endCallbackRan++; }); @@ -394,4 +393,4 @@ TEST(Animation, animation) { } // a gets destroyed EXPECT_EQ(pAnimationManager.get(), nullptr); -} \ No newline at end of file +}