PuzzleSDK
ParseIntegerListTest类 参考

#include <UnitTest.h>

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

Public 成员函数

 CREATE_FUNC (ParseIntegerListTest)
 
virtual void onEnter () override
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 UnitTestDemo
virtual std::string title () 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
 

详细描述

在文件 UnitTest.h83 行定义.

成员函数说明

◆ CREATE_FUNC()

ParseIntegerListTest::CREATE_FUNC ( ParseIntegerListTest  )

◆ onEnter()

void ParseIntegerListTest::onEnter ( )
overridevirtual

重载 TestCase .

在文件 UnitTest.cpp926 行定义.

926 {
928
929 {
930 using cocos2d::utils::parseIntegerList;
931
932 std::vector<int> res1{};
933 EXPECT_EQ(res1, parseIntegerList(""));
934
935 std::vector<int> res2{1};
936 EXPECT_EQ(res2, parseIntegerList("1"));
937
938 std::vector<int> res3{1, 2};
939 EXPECT_EQ(res3, parseIntegerList("1 2"));
940
941 std::vector<int> res4{2, 4, 3, 1, 4, 2, 0, 4, 1, 0, 4, 5};
942 EXPECT_EQ(res4, parseIntegerList("2 4 3 1 4 2 0 4 1 0 4 5"));
943
944 std::vector<int> res5{73, 48, 57, 117, 27, 117, 29, 77, 14, 62, 26, 7, 55, 2};
945 EXPECT_EQ(res5, parseIntegerList("73 48 57 117 27 117 29 77 14 62 26 7 55 2"));
946 }
947}
#define EXPECT_EQ(a, b)
Definition: UnitTest.cpp:63
virtual void onEnter() override
Definition: BaseTest.cpp:430

引用了 EXPECT_EQ , 以及 TestCase::onEnter().

+ 函数调用图:

◆ subtitle()

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

重载 TestCase .

在文件 UnitTest.cpp949 行定义.

950{
951 return "utils::parseIntegerList Test";
952}

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