PuzzleSDK
Bug422Layer类 参考

#include <Bug-422.h>

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

Public 成员函数

 CREATE_FUNC (Bug422Layer)
 
virtual bool init () override
 
virtual std::string title () const override
 
void reset ()
 
void check (Node *target)
 
void menuCallback (cocos2d::Ref *sender)
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual std::string subtitle () const
 
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
 

额外继承的成员函数

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

详细描述

在文件 Bug-422.h30 行定义.

成员函数说明

◆ check()

void Bug422Layer::check ( Node *  target)

在文件 Bug-422.cpp74 行定义.

75{
76 auto& children = t->getChildren();
77 for(const auto &child : children) {
78 log("%p, rc: %d", child, child->getReferenceCount());
79 check(child);
80 }
81}
void check(Node *target)
Definition: Bug-422.cpp:74

引用了 check().

被这些函数引用 check().

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

◆ CREATE_FUNC()

Bug422Layer::CREATE_FUNC ( Bug422Layer  )

◆ init()

bool Bug422Layer::init ( )
overridevirtual

在文件 Bug-422.cpp34 行定义.

35{
36 if (BugsTestBase::init())
37 {
38 reset();
39 return true;
40 }
41
42 return false;
43}
void reset()
Definition: Bug-422.cpp:45

引用了 reset().

+ 函数调用图:

◆ menuCallback()

void Bug422Layer::menuCallback ( cocos2d::Ref *  sender)

在文件 Bug-422.cpp83 行定义.

84{
85 reset();
86}

引用了 reset().

被这些函数引用 reset().

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

◆ reset()

void Bug422Layer::reset ( )

在文件 Bug-422.cpp45 行定义.

46{
47 static int localtag = 0;
48 localtag++;
49
50 // TO TRIGGER THE BUG:
51 // remove the itself from parent from an action
52 // The menu will be removed, but the instance will be alive
53 // and then a new node will be allocated occupying the memory.
54 // => CRASH BOOM BANG
55 auto node = getChildByTag(localtag-1);
56 log("Menu: %p", node);
57 removeChild(node, true);
58// [self removeChildByTag:localtag-1 cleanup:NO];
59
60 auto item1 = MenuItemFont::create("One", CC_CALLBACK_1(Bug422Layer::menuCallback, this) );
61 log("MenuItemFont: %p", item1);
62 MenuItem *item2 = MenuItemFont::create("Two", CC_CALLBACK_1(Bug422Layer::menuCallback, this) );
63 auto menu = Menu::create(item1, item2, nullptr);
64 menu->alignItemsVertically();
65
66 float x = CCRANDOM_0_1() * 50;
67 float y = CCRANDOM_0_1() * 50;
68 menu->setPosition(menu->getPosition() + Vec2(x,y));
69 addChild(menu, 0, localtag);
70
71 //[self check:self];
72}
void menuCallback(cocos2d::Ref *sender)
Definition: Bug-422.cpp:83

引用了 menuCallback().

被这些函数引用 init() , 以及 menuCallback().

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

◆ title()

virtual std::string Bug422Layer::title ( ) const
inlineoverridevirtual

重载 BugsTestBase .

在文件 Bug-422.h36 行定义.

36{ return "Bug422";}

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