PuzzleSDK
StressTest2类 参考

#include <NodeTest.h>

+ 类 StressTest2 继承关系图:
+ StressTest2 的协作图:

Public 成员函数

 CREATE_FUNC (StressTest2)
 
void shouldNotLeak (float dt)
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 TestCocosNodeDemo
virtual std::string title () const override
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 
virtual void onEnter () override
 

Protected 成员函数

 StressTest2 ()
 
- Protected 成员函数 继承自 TestCocosNodeDemo
 TestCocosNodeDemo ()
 
virtual ~TestCocosNodeDemo ()
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 TestCocosNodeDemo
cocos2d::Director::Projection _preProjection
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 NodeTest.h104 行定义.

构造及析构函数说明

◆ StressTest2()

StressTest2::StressTest2 ( )
protected

在文件 NodeTest.cpp355 行定义.

356{
357 auto s = Director::getInstance()->getWinSize();
358
359 auto sublayer = Layer::create();
360
361 auto sp1 = Sprite::create(s_pathSister1);
362 sp1->setPosition( Vec2(80.0f, s.height/2) );
363
364 auto move = MoveBy::create(3, Vec2(350.0f,0.0f));
365 auto move_ease_inout3 = EaseInOut::create(move->clone(), 2.0f);
366 auto move_ease_inout_back3 = move_ease_inout3->reverse();
367 auto seq3 = Sequence::create( move_ease_inout3, move_ease_inout_back3, nullptr);
368 sp1->runAction( RepeatForever::create(seq3) );
369 sublayer->addChild(sp1, 1);
370
371 auto fire = ParticleFire::create();
372 fire->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png"));
373 fire->setPosition( Vec2(80.0f, s.height/2-50) );
374
375 auto copy_seq3 = seq3->clone();
376
377 fire->runAction( RepeatForever::create(copy_seq3) );
378 sublayer->addChild(fire, 2);
379
380 schedule(CC_CALLBACK_1(StressTest2::shouldNotLeak,this), 6.0f, "should_not_leak_key");
381
382 addChild(sublayer, 0, kTagSprite1);
383}
@ kTagSprite1
Definition: NodeTest.cpp:35
void shouldNotLeak(float dt)
Definition: NodeTest.cpp:385
static const char s_pathSister1[]
Definition: testResource.h:29

引用了 kTagSprite1, s_pathSister1 , 以及 shouldNotLeak().

+ 函数调用图:

成员函数说明

◆ CREATE_FUNC()

StressTest2::CREATE_FUNC ( StressTest2  )

◆ shouldNotLeak()

void StressTest2::shouldNotLeak ( float  dt)

在文件 NodeTest.cpp385 行定义.

386{
387 unschedule("should_not_leak_key");
388 auto sublayer = static_cast<Layer*>( getChildByTag(kTagSprite1) );
389 sublayer->removeAllChildrenWithCleanup(true);
390}

引用了 kTagSprite1.

被这些函数引用 StressTest2().

+ 这是这个函数的调用关系图:

◆ subtitle()

std::string StressTest2::subtitle ( ) const
overridevirtual

重载 TestCase .

在文件 NodeTest.cpp392 行定义.

393{
394 return "stress test #2: no leaks";
395}

该类的文档由以下文件生成: