PuzzleSDK
StressTest1类 参考

#include <NodeTest.h>

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

Public 成员函数

 CREATE_FUNC (StressTest1)
 
void shouldNotCrash (float dt)
 
void removeMe (Node *node)
 
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 成员函数

 StressTest1 ()
 
- 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.h92 行定义.

构造及析构函数说明

◆ StressTest1()

StressTest1::StressTest1 ( )
protected

在文件 NodeTest.cpp303 行定义.

304{
305 auto s = Director::getInstance()->getWinSize();
306
307 auto sp1 = Sprite::create(s_pathSister1);
308 addChild(sp1, 0, kTagSprite1);
309
310 sp1->setPosition( Vec2(s.width/2, s.height/2) );
311
312 schedule(CC_CALLBACK_1(StressTest1::shouldNotCrash, this), 1.0f, "should_not_crash_key");
313}
@ kTagSprite1
Definition: NodeTest.cpp:35
void shouldNotCrash(float dt)
Definition: NodeTest.cpp:315
static const char s_pathSister1[]
Definition: testResource.h:29

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

+ 函数调用图:

成员函数说明

◆ CREATE_FUNC()

StressTest1::CREATE_FUNC ( StressTest1  )

◆ removeMe()

void StressTest1::removeMe ( Node *  node)

在文件 NodeTest.cpp339 行定义.

340{
342}
TestSuite * getTestSuite() const
Definition: BaseTest.h:83
virtual void enterNextTest()
Definition: BaseTest.cpp:309

引用了 TestSuite::enterNextTest() , 以及 TestCase::getTestSuite().

被这些函数引用 shouldNotCrash().

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

◆ shouldNotCrash()

void StressTest1::shouldNotCrash ( float  dt)

在文件 NodeTest.cpp315 行定义.

316{
317 unschedule("should_not_crash_key");
318
319 auto s = Director::getInstance()->getWinSize();
320
321 // if the node has timers, it crashes
322 auto explosion = ParticleSun::create();
323 explosion->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png"));
324
325 // if it doesn't, it works Ok.
326// auto explosion = [Sprite create:@"grossinis_sister2.png");
327
328 explosion->setPosition( Vec2(s.width/2, s.height/2) );
329
330 runAction( Sequence::create(
331 RotateBy::create(2, 360),
332 CallFuncN::create(CC_CALLBACK_1(StressTest1::removeMe, this)),
333 nullptr) );
334
335 addChild(explosion);
336}
void removeMe(Node *node)
Definition: NodeTest.cpp:339

引用了 removeMe().

被这些函数引用 StressTest1().

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

◆ subtitle()

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

重载 TestCase .

在文件 NodeTest.cpp345 行定义.

346{
347 return "stress test #1: no crashes";
348}

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