From 766817f1dd9fbf76732c5ac67881de05f7905685 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 6 Jul 2016 17:21:58 -0700 Subject: [PATCH] test: add test case for Github issue #11942 test case for Github issue #11942 --- .../DrawPrimitivesTest/DrawPrimitivesTest.cpp | 26 +++++++++++++++++++ .../DrawPrimitivesTest/DrawPrimitivesTest.h | 12 +++++++++ 2 files changed, 38 insertions(+) diff --git a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp index f3048c5408..2cc48dcd6c 100644 --- a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -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" diff --git a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h index b56456df05..8c78d30898 100644 --- a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h +++ b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h @@ -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