summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorArtur Dorda <artur.dorda+libo@gmail.com>2012-08-10 15:06:14 +0200
committerArtur Dorda <artur.dorda+libo@gmail.com>2012-08-15 13:42:17 +0200
commitecb81153407d42da26c52529fd8bcb00abd03975 (patch)
tree85a772d995a254a8ecd5556f3b7c7dcd0a791801 /sax
parent1edec50b9daa18c1a4088ce94051c4b415cf8a1a (diff)
'string to color' test covered
Change-Id: I024296d1f71bd06837547cd8af3adc2cf2830b95
Diffstat (limited to 'sax')
-rw-r--r--sax/qa/cppunit/test_converter.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx
index 1bf1dd004709..c3cab68a32c8 100644
--- a/sax/qa/cppunit/test_converter.cxx
+++ b/sax/qa/cppunit/test_converter.cxx
@@ -438,6 +438,16 @@ void ConverterTest::testPercent()
doTestPercentToString("1%", 00001);
}
+void doTestStringToColor(sal_Int32 nValue, char const*const pis)
+{
+ ::rtl::OUString const is(::rtl::OUString::createFromAscii(pis));
+ sal_Int32 nTemp;
+ bool bSuccess(Converter::convertColor(nTemp, is));
+ OSL_TRACE("%i", nTemp);
+ CPPUNIT_ASSERT(bSuccess);
+ CPPUNIT_ASSERT_EQUAL(nValue, nTemp);
+}
+
void doTestColorToString(char const*const pis, sal_Int32 nValue)
{
::rtl::OUString const is(::rtl::OUString::createFromAscii(pis));
@@ -449,6 +459,10 @@ void doTestColorToString(char const*const pis, sal_Int32 nValue)
void ConverterTest::testColor()
{
+ doTestStringToColor(11259375, "#abcdef");
+ doTestStringToColor(160, "#0000a0");
+ doTestStringToColor(40960, "#00a000");
+ doTestStringToColor(0, "#000000");
doTestColorToString("#000615", 1557);
doTestColorToString("#5bcd15", 123456789);
doTestColorToString("#fffac7", -1337);