diff options
-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); } |