diff options
author | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-08-10 14:30:07 +0200 |
---|---|---|
committer | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-08-15 13:42:15 +0200 |
commit | 764a1245ecf07b75a2b71d302a91d7c7a37df363 (patch) | |
tree | aebdd55f023d61a18edee550b3a08922828974c3 /sax | |
parent | 63cd59d69136d73d6f73bdb2a5d54166a5302a38 (diff) |
'string to bool' test covered
Change-Id: I6613167703974d802d17d7fd8cdf0f552721c33c
Diffstat (limited to 'sax')
-rw-r--r-- | sax/qa/cppunit/test_converter.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx index ad146e2f5bdc..d58858a4fcac 100644 --- a/sax/qa/cppunit/test_converter.cxx +++ b/sax/qa/cppunit/test_converter.cxx @@ -51,12 +51,14 @@ public: void testDateTime(); void testDouble(); void testMeasure(); + void testBool(); CPPUNIT_TEST_SUITE(ConverterTest); CPPUNIT_TEST(testDuration); CPPUNIT_TEST(testDateTime); CPPUNIT_TEST(testDouble); CPPUNIT_TEST(testMeasure); + CPPUNIT_TEST(testBool); CPPUNIT_TEST_SUITE_END(); private: @@ -371,6 +373,22 @@ void ConverterTest::testMeasure() doTestMeasureToString("111.1pt", 2222, MeasureUnit::TWIP, MeasureUnit::POINT); doTestMeasureToString("385.7986in", 555550, MeasureUnit::TWIP, MeasureUnit::INCH); } + +void doTestStringToBool(bool bBool, char const*const pis) +{ + ::rtl::OUString const is(::rtl::OUString::createFromAscii(pis)); + bool bTemp; + bool bSuccess(Converter::convertBool(bTemp, is)); + OSL_TRACE("%s", bTemp); + CPPUNIT_ASSERT(bSuccess); + CPPUNIT_ASSERT_EQUAL(bBool, bTemp); + +} +void ConverterTest::testBool() +{ + doTestStringToBool(true, "true"); + doTestStringToBool(false, "false"); +} CPPUNIT_TEST_SUITE_REGISTRATION(ConverterTest); } |