From beda294be1071aec62a15bae3aff8602b8d94bd3 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 7 Apr 2014 22:02:43 +0800 Subject: [PATCH] issue #4629: add test case for group command --- .../NewRendererTest/NewRendererTest.cpp | 23 +++++++++++++++++++ .../Classes/NewRendererTest/NewRendererTest.h | 13 +++++++++++ 2 files changed, 36 insertions(+) diff --git a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp index f1a50c2120..38fbb7cecb 100644 --- a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp +++ b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp @@ -35,6 +35,7 @@ static std::function createFunctions[] = { CL(NewSpriteTest), CL(NewSpriteBatchTest), + CL(GroupCommandTest), CL(NewClippingNodeTest), CL(NewDrawNodeTest), CL(NewCullingTest), @@ -222,6 +223,28 @@ std::string NewSpriteTest::subtitle() const return "SpriteTest"; } +GroupCommandTest::GroupCommandTest() +{ + auto sprite = Sprite::create("Images/grossini.png"); + Size winSize = Director::getInstance()->getWinSize(); + sprite->setPosition(winSize.width/2,winSize.height/2); + addChild(sprite); +} + +GroupCommandTest::~GroupCommandTest() +{ +} + +std::string GroupCommandTest::title() const +{ + return "Renderer"; +} + +std::string GroupCommandTest::subtitle() const +{ + return "GroupCommandTest: You should see a sprite"; +} + //-------- New Sprite Batch Test NewSpriteBatchTest::NewSpriteBatchTest() diff --git a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h index 9fe691e2ee..7d41f92c7c 100644 --- a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h +++ b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h @@ -56,6 +56,19 @@ protected: virtual ~NewSpriteTest(); }; +class GroupCommandTest : public MultiSceneTest +{ +public: + CREATE_FUNC(GroupCommandTest); + + virtual std::string title() const override; + virtual std::string subtitle() const override; + +protected: + GroupCommandTest(); + virtual ~GroupCommandTest(); +}; + class NewSpriteBatchTest : public MultiSceneTest { public: