PuzzleSDK
CrashTest类 参考

#include <ActionManagerTest.h>

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

Public 成员函数

 CREATE_FUNC (CrashTest)
 
virtual std::string subtitle () const override
 
virtual void onEnter () override
 
void removeThis ()
 
- Public 成员函数 继承自 ActionManagerTest
 ActionManagerTest ()
 
 ~ActionManagerTest ()
 
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
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 ActionManagerTest
cocos2d::TextureAtlas * _atlas
 
std::string _title
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 ActionManagerTest.h47 行定义.

成员函数说明

◆ CREATE_FUNC()

CrashTest::CREATE_FUNC ( CrashTest  )

◆ onEnter()

void CrashTest::onEnter ( )
overridevirtual

重载 TestCase .

在文件 ActionManagerTest.cpp79 行定义.

80{
82
83 auto child = Sprite::create(s_pathGrossini);
84 child->setPosition( VisibleRect::center() );
85 addChild(child, 1, kTagGrossini);
86
87 //Sum of all action's duration is 1.5 second.
88 child->runAction(RotateBy::create(1.5f, 90));
89 child->runAction(Sequence::create(
90 DelayTime::create(1.4f),
91 FadeOut::create(1.1f),
92 nullptr)
93 );
94
95 //After 1.5 second, self will be removed.
96 child->runAction(Sequence::create(
97 DelayTime::create(1.4f),
98 CallFunc::create( CC_CALLBACK_0(CrashTest::removeThis,this)),
99 nullptr)
100 );
101}
@ kTagGrossini
virtual void onEnter() override
Definition: BaseTest.cpp:430
static cocos2d::Vec2 center()
Definition: VisibleRect.cpp:69
static const char s_pathGrossini[]
Definition: testResource.h:28

引用了 VisibleRect::center(), kTagGrossini, TestCase::onEnter(), removeThis() , 以及 s_pathGrossini.

+ 函数调用图:

◆ removeThis()

void CrashTest::removeThis ( )

在文件 ActionManagerTest.cpp103 行定义.

104{
105 auto child = getChildByTag(kTagGrossini);
106 child->removeChild(child, true);
107
109}
TestSuite * getTestSuite() const
Definition: BaseTest.h:83
virtual void enterNextTest()
Definition: BaseTest.cpp:309

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

被这些函数引用 onEnter().

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

◆ subtitle()

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

重载 ActionManagerTest .

在文件 ActionManagerTest.cpp111 行定义.

112{
113 return "Test 1. Should not crash";
114}

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