Merge pull request #15986 from ricardoquesada/issue14050test

fix: add testcase for issue #14050 fix
This commit is contained in:
Ricardo Quesada 2016-06-28 17:38:18 -07:00 committed by GitHub
commit 65e32522e1
2 changed files with 46 additions and 0 deletions

View File

@ -20,6 +20,7 @@ ActionManagerTests::ActionManagerTests()
ADD_TEST_CASE(StopAllActionsTest);
ADD_TEST_CASE(StopActionsByFlagsTest);
ADD_TEST_CASE(ResumeTest);
ADD_TEST_CASE(Issue14050Test);
}
//------------------------------------------------------------------
@ -342,3 +343,38 @@ std::string StopActionsByFlagsTest::subtitle() const
{
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.";
}

View File

@ -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.
};
class Issue14050Test : public ActionManagerTest
{
public:
CREATE_FUNC(Issue14050Test);
virtual std::string subtitle() const override;
virtual void onEnter() override;
protected:
};
#endif