2013-01-28 15:17:20 +08:00
|
|
|
#ifndef __FILEUTILSTEST_H__
|
|
|
|
#define __FILEUTILSTEST_H__
|
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
|
|
|
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(FileUtilsTests);
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class FileUtilsDemo : public TestCase
|
2013-01-28 15:17:20 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
};
|
|
|
|
|
|
|
|
class TestResolutionDirectories : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(TestResolutionDirectories);
|
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-01-28 15:17:20 +08:00
|
|
|
private:
|
2013-12-19 03:45:30 +08:00
|
|
|
std::vector<std::string> _defaultSearchPathArray;
|
|
|
|
std::vector<std::string> _defaultResolutionsOrderArray;
|
2013-01-28 15:17:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TestSearchPath : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(TestSearchPath);
|
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-01-28 15:17:20 +08:00
|
|
|
private:
|
2013-12-19 03:45:30 +08:00
|
|
|
std::vector<std::string> _defaultSearchPathArray;
|
|
|
|
std::vector<std::string> _defaultResolutionsOrderArray;
|
2013-01-28 15:17:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TestFilenameLookup : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(TestFilenameLookup);
|
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2013-01-28 15:17:20 +08:00
|
|
|
};
|
|
|
|
|
2013-02-01 22:18:43 +08:00
|
|
|
class TestIsFileExist : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(TestIsFileExist);
|
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-02-01 22:18:43 +08:00
|
|
|
};
|
2013-01-28 15:17:20 +08:00
|
|
|
|
2015-07-13 22:44:40 +08:00
|
|
|
class TestIsDirectoryExist : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TestIsDirectoryExist);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2014-06-24 14:51:35 +08:00
|
|
|
class TestFileFuncs : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TestFileFuncs);
|
2015-07-07 14:06:59 +08:00
|
|
|
|
2014-06-24 14:51:35 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TestDirectoryFuncs : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TestDirectoryFuncs);
|
2015-07-07 14:06:59 +08:00
|
|
|
|
2014-06-24 14:51:35 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2013-04-28 00:36:37 +08:00
|
|
|
class TextWritePlist : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(TextWritePlist);
|
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-04-28 00:36:37 +08:00
|
|
|
};
|
|
|
|
|
2015-07-07 14:06:59 +08:00
|
|
|
class TestWriteString : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TestWriteString);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TestWriteData : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TestWriteData);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TestWriteValueMap : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TestWriteValueMap);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TestWriteValueVector : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TestWriteValueVector);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
2015-07-13 22:44:40 +08:00
|
|
|
|
|
|
|
class TestUnicodePath : public FileUtilsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TestUnicodePath);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2013-01-28 15:17:20 +08:00
|
|
|
#endif /* __FILEUTILSTEST_H__ */
|