From d2bffadb60079fb032e631b5635d2800c193cf0f Mon Sep 17 00:00:00 2001 From: Artur Dorda Date: Fri, 10 Aug 2012 14:36:24 +0200 Subject: 'bool to string' test covered Change-Id: I8ee1142b2a68799a650f501e2fe491a5ed8d7a5e --- sax/qa/cppunit/test_converter.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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); } -- cgit