summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-08-01 22:06:31 +0200
committerTomaž Vajngerl <quikee@gmail.com>2023-08-21 08:57:15 +0200
commit73ec9c71689525ff14db219238083ff75028f8c8 (patch)
tree0afd210299bc810296ed9cb3d9a0297a54123b83 /chart2
parente60ef8651cfb30335471d1622e58c13eebc7d58b (diff)
Tests with color stops to assert Color and not BColor values
For testing color stops of a gradient we don't need to assert super precise values (doubls to the n-th decimal point) as long the end results in the same (8-bit) Color value. So change the tests to convert the BColor that is in gradient color stops to Color and assert the Color value. Change-Id: Ibd7661e2f72955a0778e822df1fae568973be357 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155360 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2import.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 890841a79849..0b8acca9a3ab 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -632,11 +632,11 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testBnc889755)
CPPUNIT_ASSERT_EQUAL(size_t(3), aColorStops.size());
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
- CPPUNIT_ASSERT_EQUAL(aColorStops[0].getStopColor(), basegfx::BColor(0.25, 0.25, 0.25));
+ CPPUNIT_ASSERT_EQUAL(Color(0x404040), Color(aColorStops[0].getStopColor()));
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 0.070000000000000007));
- CPPUNIT_ASSERT_EQUAL(aColorStops[1].getStopColor(), basegfx::BColor(0.25, 0.25, 0.25));
+ CPPUNIT_ASSERT_EQUAL(Color(0x404040), Color(aColorStops[1].getStopColor()));
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[2].getStopOffset(), 0.080000000000000002));
- CPPUNIT_ASSERT_EQUAL(aColorStops[2].getStopColor(), basegfx::BColor(1.0, 1.0, 1.0));
+ CPPUNIT_ASSERT_EQUAL(Color(0xffffff), Color(aColorStops[2].getStopColor()));
}
CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testBnc882383)
@@ -676,9 +676,9 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTransparencyGradientValue)
// MCGR: Use the whole completely imported transparency gradient to check for correctness
CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size());
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
- CPPUNIT_ASSERT_EQUAL(aColorStops[0].getStopColor(), basegfx::BColor(0.3, 0.3, 0.3));
+ CPPUNIT_ASSERT_EQUAL(Color(0x4d4d4d), Color(aColorStops[0].getStopColor()));
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0));
- CPPUNIT_ASSERT_EQUAL(aColorStops[1].getStopColor(), basegfx::BColor(0.2, 0.2, 0.2));
+ CPPUNIT_ASSERT_EQUAL(Color(0x333333), Color(aColorStops[1].getStopColor()));
}
CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSimpleStrictXLSX)