#include <FileUtilsTest.h>
◆ CREATE_FUNC()
◆ onEnter()
| void TestIsDirectoryExist::onEnter |
( |
| ) |
|
|
overridevirtual |
重载 TestCase .
在文件 FileUtilsTest.cpp 第 293 行定义.
296 auto s = Director::getInstance()->getWinSize();
297 auto util = FileUtils::getInstance();
298 int x = s.width/2, y = s.height/3;
300 Label* label =
nullptr;
302 auto getMsg = [&dir](
bool b)-> std::string
305 snprintf((
char *)msg, 512,
"%s for dir: \"%s\"", b ?
"success" :
"failed", dir.c_str());
306 return std::string(msg);
310 label = Label::createWithSystemFont(getMsg(util->isDirectoryExist(dir)),
"", 20);
311 label->setPosition(x, y * 2);
312 this->addChild(label);
314 dir = util->getWritablePath();
315 label = Label::createWithSystemFont(getMsg(util->isDirectoryExist(dir)),
"", 20);
316 label->setPosition(x, y * 1);
317 this->addChild(label);
319 dir = util->getWritablePath();
320 label = Label::createWithSystemFont(getMsg(util->isDirectoryExist(dir)),
"", 20);
321 label->setPosition(x, y * 1);
322 this->addChild(label);
virtual void onEnter() override
引用了 TestCase::onEnter().
◆ onExit()
| void TestIsDirectoryExist::onExit |
( |
| ) |
|
|
overridevirtual |
在文件 FileUtilsTest.cpp 第 325 行定义.
328 FileUtils *sharedFileUtils = FileUtils::getInstance();
331 sharedFileUtils->purgeCachedEntries();
333 FileUtilsDemo::onExit();
◆ subtitle()
| std::string TestIsDirectoryExist::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string TestIsDirectoryExist::title |
( |
| ) |
const |
|
overridevirtual |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp