PuzzleSDK
TestIsDirectoryExistAsync类 参考

#include <FileUtilsTest.h>

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

Public 成员函数

 CREATE_FUNC (TestIsDirectoryExistAsync)
 
virtual void onEnter () override
 
virtual void onExit () override
 
virtual std::string title () const override
 
virtual std::string subtitle () 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 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 FileUtilsTest.h197 行定义.

成员函数说明

◆ CREATE_FUNC()

TestIsDirectoryExistAsync::CREATE_FUNC ( TestIsDirectoryExistAsync  )

◆ onEnter()

void TestIsDirectoryExistAsync::onEnter ( )
overridevirtual

重载 TestCase .

在文件 FileUtilsTest.cpp1092 行定义.

1093{
1095 auto s = Director::getInstance()->getWinSize();
1096 auto util = FileUtils::getInstance();
1097 int x = s.width/2, y = s.height/3;
1098
1099 std::string dir;
1100 auto getMsg = [](bool b, const std::string& dir)-> std::string
1101 {
1102 char msg[512];
1103 snprintf((char *)msg, 512, "%s for dir: \"%s\"", b ? "success" : "failed", dir.c_str());
1104 return std::string(msg);
1105 };
1106
1107 dir = util->getWritablePath();
1108 util->isDirectoryExist(dir, [=](bool exists) {
1109 CCAssert(exists, "Writable path should exist");
1110 auto label = Label::createWithSystemFont(getMsg(exists, dir), "", 20);
1111 label->setPosition(x, y * 2);
1112 this->addChild(label);
1113 });
1114}
virtual void onEnter() override
Definition: BaseTest.cpp:430

引用了 TestCase::onEnter().

+ 函数调用图:

◆ onExit()

void TestIsDirectoryExistAsync::onExit ( )
overridevirtual

在文件 FileUtilsTest.cpp1116 行定义.

1117{
1118
1119 FileUtils *sharedFileUtils = FileUtils::getInstance();
1120
1121 // reset filename lookup
1122 sharedFileUtils->purgeCachedEntries();
1123
1124 FileUtilsDemo::onExit();
1125}

◆ subtitle()

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

重载 TestCase .

在文件 FileUtilsTest.cpp1132 行定义.

1133{
1134 return "";
1135}

◆ title()

std::string TestIsDirectoryExistAsync::title ( ) const
overridevirtual

重载 TestCase .

在文件 FileUtilsTest.cpp1127 行定义.

1128{
1129 return "FileUtilsAsync: check whether the directory exists";
1130}

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