Add test case

This commit is contained in:
WenhaiLin 2015-01-09 18:51:30 +08:00
parent d92a525bfa
commit e2c7743db1
2 changed files with 30 additions and 1 deletions

View File

@ -83,7 +83,8 @@ static std::function<Layer*()> createFunctions[] =
CL(LabelAdditionalKerningTest),
CL(LabelIssue8492Test),
CL(LabelMultilineWithOutline),
CL(LabelIssue9255Test)
CL(LabelIssue9255Test),
CL(LabelSmallDimensionsTest)
};
#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0]))
@ -1877,3 +1878,20 @@ std::string LabelIssue9255Test::subtitle() const
{
return "switch to desktop and switch back. Crashed!!!";
}
LabelSmallDimensionsTest::LabelSmallDimensionsTest()
{
auto label = Label::createWithSystemFont("Hello World!", "fonts/arial.ttf", 24, Size(30,100));
label->setPosition(VisibleRect::center());
addChild(label);
}
std::string LabelSmallDimensionsTest::title() const
{
return "Test create Label[system font] with small dimensions";
}
std::string LabelSmallDimensionsTest::subtitle() const
{
return "Program should not dead loop";
}

View File

@ -544,5 +544,16 @@ public:
virtual std::string subtitle() const override;
};
class LabelSmallDimensionsTest : public AtlasDemoNew
{
public:
CREATE_FUNC(LabelSmallDimensionsTest);
LabelSmallDimensionsTest();
virtual std::string title() const override;
virtual std::string subtitle() const override;
};
#endif