diff options
author | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-08-10 14:36:24 +0200 |
---|---|---|
committer | Artur Dorda <artur.dorda+libo@gmail.com> | 2012-08-15 13:42:16 +0200 |
commit | d2bffadb60079fb032e631b5635d2800c193cf0f (patch) | |
tree | 4f1aca60dd3b2ec2e9c8d52da28ccaa67dc77d56 /sax | |
parent | 764a1245ecf07b75a2b71d302a91d7c7a37df363 (diff) |
'bool to string' test covered
Change-Id: I8ee1142b2a68799a650f501e2fe491a5ed8d7a5e
Diffstat (limited to 'sax')
-rw-r--r-- | sax/qa/cppunit/test_converter.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx index d58858a4fcac..b95a65c9553d 100644 --- a/sax/qa/cppunit/test_converter.cxx +++ b/sax/qa/cppunit/test_converter.cxx @@ -384,11 +384,24 @@ void doTestStringToBool(bool bBool, char const*const pis) CPPUNIT_ASSERT_EQUAL(bBool, bTemp); } + +void doTestBoolToString(char const*const pis, bool bValue ) +{ + ::rtl::OUString const is(::rtl::OUString::createFromAscii(pis)); + ::rtl::OUStringBuffer buf; + Converter::convertBool(buf, bValue); + OSL_TRACE("%s", ::rtl::OUStringToOString(buf.getStr(), RTL_TEXTENCODING_UTF8).getStr()); + CPPUNIT_ASSERT_EQUAL(is, buf.makeStringAndClear()); +} + void ConverterTest::testBool() { doTestStringToBool(true, "true"); doTestStringToBool(false, "false"); + doTestBoolToString("true", true); + doTestBoolToString("false", false); } + CPPUNIT_TEST_SUITE_REGISTRATION(ConverterTest); } |