mirror of https://github.com/axmolengine/axmol.git
Merge pull request #15986 from ricardoquesada/issue14050test
fix: add testcase for issue #14050 fix
This commit is contained in:
commit
65e32522e1
|
@ -20,6 +20,7 @@ ActionManagerTests::ActionManagerTests()
|
||||||
ADD_TEST_CASE(StopAllActionsTest);
|
ADD_TEST_CASE(StopAllActionsTest);
|
||||||
ADD_TEST_CASE(StopActionsByFlagsTest);
|
ADD_TEST_CASE(StopActionsByFlagsTest);
|
||||||
ADD_TEST_CASE(ResumeTest);
|
ADD_TEST_CASE(ResumeTest);
|
||||||
|
ADD_TEST_CASE(Issue14050Test);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
@ -342,3 +343,38 @@ std::string StopActionsByFlagsTest::subtitle() const
|
||||||
{
|
{
|
||||||
return "Stop All Actions By Flags Test";
|
return "Stop All Actions By Flags Test";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Issue14050Test
|
||||||
|
//
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
class SpriteIssue14050: public Sprite
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SpriteIssue14050()
|
||||||
|
{
|
||||||
|
log("SpriteIssue14050::constructor");
|
||||||
|
}
|
||||||
|
virtual ~SpriteIssue14050()
|
||||||
|
{
|
||||||
|
log("SpriteIssue14050::destructor");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void Issue14050Test::onEnter()
|
||||||
|
{
|
||||||
|
ActionManagerTest::onEnter();
|
||||||
|
|
||||||
|
auto sprite = new (std::nothrow) SpriteIssue14050;
|
||||||
|
sprite->initWithFile("Images/grossini.png");
|
||||||
|
sprite->autorelease();
|
||||||
|
|
||||||
|
auto move = MoveBy::create(2, Vec2(100, 100));
|
||||||
|
sprite->runAction(move);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Issue14050Test::subtitle() const
|
||||||
|
{
|
||||||
|
return "Issue14050. Sprite should not leak.";
|
||||||
|
}
|
||||||
|
|
|
@ -95,4 +95,14 @@ protected:
|
||||||
const unsigned int kRepeatForeverFlag = 0x08; // You don't need this for the test, but it's for demonstration how to activate several flags on an action.
|
const unsigned int kRepeatForeverFlag = 0x08; // You don't need this for the test, but it's for demonstration how to activate several flags on an action.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Issue14050Test : public ActionManagerTest
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CREATE_FUNC(Issue14050Test);
|
||||||
|
|
||||||
|
virtual std::string subtitle() const override;
|
||||||
|
virtual void onEnter() override;
|
||||||
|
protected:
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue