mirror of https://github.com/axmolengine/axmol.git
Merge pull request #16058 from ricardoquesada/issue_11942
test: add test case for Github issue #11942
This commit is contained in:
commit
7727c2eb6f
|
@ -18,6 +18,7 @@ DrawPrimitivesTests::DrawPrimitivesTests()
|
|||
ADD_TEST_CASE(DrawPrimitivesTest);
|
||||
ADD_TEST_CASE(DrawNodeTest);
|
||||
ADD_TEST_CASE(PrimitivesCommandTest);
|
||||
ADD_TEST_CASE(Issue11942Test);
|
||||
}
|
||||
|
||||
string DrawPrimitivesBaseTest::title() const
|
||||
|
@ -383,6 +384,31 @@ string PrimitivesCommandTest::subtitle() const
|
|||
return "Drawing Primitives using PrimitiveCommand";
|
||||
}
|
||||
|
||||
//
|
||||
// Issue11942Test
|
||||
//
|
||||
Issue11942Test::Issue11942Test()
|
||||
{
|
||||
auto draw = DrawNode::create();
|
||||
addChild(draw, 10);
|
||||
|
||||
// draw a circle
|
||||
draw->setLineWidth(1);
|
||||
draw->drawCircle(VisibleRect::center() - Vec2(140,0), 50, CC_DEGREES_TO_RADIANS(90), 30, false, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1));
|
||||
draw->setLineWidth(10);
|
||||
draw->drawCircle(VisibleRect::center() + Vec2(140,0), 50, CC_DEGREES_TO_RADIANS(90), 30, false, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1));
|
||||
}
|
||||
|
||||
string Issue11942Test::title() const
|
||||
{
|
||||
return "Gihub Issue #11942";
|
||||
}
|
||||
|
||||
string Issue11942Test::subtitle() const
|
||||
{
|
||||
return "drawCircle() with width";
|
||||
}
|
||||
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
||||
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
|
||||
|
|
|
@ -60,4 +60,16 @@ protected:
|
|||
cocos2d::PrimitiveCommand _primitiveCommand;
|
||||
};
|
||||
|
||||
class Issue11942Test : public DrawPrimitivesBaseTest
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(Issue11942Test);
|
||||
|
||||
Issue11942Test();
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue