diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-11-01 13:44:20 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-11-26 13:24:55 +0100 |
commit | df172bfdb3ef4578345f4ba9ac0589a3765d031e (patch) | |
tree | c83d9e9ab079245b9d618d6726aa20bd8555db50 /vcl/qa/cppunit | |
parent | e1b05439b53a5f22fe9c3978e1c1c6b6a243f046 (diff) |
use different line and fill color in vcl backendtest
Having them the same can hide problems with them fixed up incorrectly.
And it also shows that drawPolygon() with line color unset does not
draw the right-most and bottom-most line, which is what all underlying
graphics systems do, so the test is kind of wrong and I've added
a compensation to make it visually correct (and match the checked
expected result).
Change-Id: I333f41210232c74ba55bd5c92ef5fda917ce3e59
Diffstat (limited to 'vcl/qa/cppunit')
-rw-r--r-- | vcl/qa/cppunit/BackendTest.cxx | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx index fd9bf10eaff5..01a81c0f17f3 100644 --- a/vcl/qa/cppunit/BackendTest.cxx +++ b/vcl/qa/cppunit/BackendTest.cxx @@ -237,9 +237,14 @@ public: void testDrawFilledRectWithRectangle() { vcl::test::OutputDeviceTestRect aOutDevTest; - Bitmap aBitmap = aOutDevTest.setupFilledRectangle(); - auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap); - exportImage("03-01_filled_rectangle_test-rectangle.png", aBitmap); + Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); + auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); + exportImage("03-01_filled_rectangle_test-rectangle_noline.png", aBitmap); + if (SHOULD_ASSERT) + CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); + aBitmap = aOutDevTest.setupFilledRectangle(true); + eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true); + exportImage("03-01_filled_rectangle_test-rectangle_line.png", aBitmap); if (SHOULD_ASSERT) CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); } @@ -247,9 +252,14 @@ public: void testDrawFilledRectWithPolygon() { vcl::test::OutputDeviceTestPolygon aOutDevTest; - Bitmap aBitmap = aOutDevTest.setupFilledRectangle(); - auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap); - exportImage("03-02_filled_rectangle_test-polygon.png", aBitmap); + Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); + auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); + exportImage("03-02_filled_rectangle_test-polygon_noline.png", aBitmap); + if (SHOULD_ASSERT) + CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); + aBitmap = aOutDevTest.setupFilledRectangle(true); + eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true); + exportImage("03-02_filled_rectangle_test-polygon_line.png", aBitmap); if (SHOULD_ASSERT) CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); } @@ -257,9 +267,14 @@ public: void testDrawFilledRectWithPolyPolygon() { vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; - Bitmap aBitmap = aOutDevTest.setupFilledRectangle(); - auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap); - exportImage("03-03_filled_rectangle_test-polypolygon.png", aBitmap); + Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); + auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); + exportImage("03-03_filled_rectangle_test-polypolygon_noline.png", aBitmap); + if (SHOULD_ASSERT) + CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); + aBitmap = aOutDevTest.setupFilledRectangle(true); + eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true); + exportImage("03-03_filled_rectangle_test-polypolygon_line.png", aBitmap); if (SHOULD_ASSERT) CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); } @@ -267,9 +282,14 @@ public: void testDrawFilledRectWithPolyPolygon2D() { vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; - Bitmap aBitmap = aOutDevTest.setupFilledRectangle(); - auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap); - exportImage("03-04_filled_rectangle_test-polypolygon_b2d.png", aBitmap); + Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); + auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); + exportImage("03-04_filled_rectangle_test-polypolygon_b2d_noline.png", aBitmap); + if (SHOULD_ASSERT) + CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); + aBitmap = aOutDevTest.setupFilledRectangle(true); + eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, true); + exportImage("03-04_filled_rectangle_test-polypolygon_b2d_line.png", aBitmap); if (SHOULD_ASSERT) CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); } @@ -434,9 +454,9 @@ public: CPPUNIT_TEST(testDrawRectAAWithPolyPolygonB2D); CPPUNIT_TEST(testDrawFilledRectWithRectangle); - // CPPUNIT_TEST(testDrawFilledRectWithPolygon); TODO SKIA - // CPPUNIT_TEST(testDrawFilledRectWithPolyPolygon); TODO SKIA - // CPPUNIT_TEST(testDrawFilledRectWithPolyPolygon2D); TODO SKIA + CPPUNIT_TEST(testDrawFilledRectWithPolygon); + CPPUNIT_TEST(testDrawFilledRectWithPolyPolygon); + CPPUNIT_TEST(testDrawFilledRectWithPolyPolygon2D); CPPUNIT_TEST(testDrawDiamondWithPolygon); CPPUNIT_TEST(testDrawDiamondWithLine); |