2014-01-03 20:14:03 +08:00
|
|
|
#ifndef __UNIT_TEST__
|
|
|
|
#define __UNIT_TEST__
|
|
|
|
|
|
|
|
#include "../BaseTest.h"
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(UnitTests);
|
2014-01-03 20:14:03 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class UnitTestDemo : public TestCase
|
2014-01-03 20:14:03 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
//-------------------------------------
|
|
|
|
|
|
|
|
class TemplateVectorTest : public UnitTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TemplateVectorTest);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
2015-04-09 08:37:30 +08:00
|
|
|
void constFunc(const cocos2d::Vector<Node*>& vec) const;
|
2014-01-03 20:14:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TemplateMapTest : public UnitTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TemplateMapTest);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
2015-04-09 08:37:30 +08:00
|
|
|
void constFunc(const cocos2d::Map<std::string, cocos2d::Node*>& map) const;
|
2014-01-03 20:14:03 +08:00
|
|
|
};
|
|
|
|
|
2014-01-03 21:06:33 +08:00
|
|
|
class ValueTest : public UnitTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(ValueTest);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
2015-04-09 08:37:30 +08:00
|
|
|
void constFunc(const cocos2d::Value& value) const;
|
2014-01-03 21:06:33 +08:00
|
|
|
};
|
|
|
|
|
2014-05-10 21:52:19 +08:00
|
|
|
class UTFConversionTest : public UnitTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(UTFConversionTest);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2014-11-22 15:52:02 +08:00
|
|
|
class MathUtilTest : public UnitTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(MathUtilTest);
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2014-01-03 20:14:03 +08:00
|
|
|
#endif /* __UNIT_TEST__ */
|