summaryrefslogtreecommitdiff
path: root/sw/qa/core
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-03 13:58:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-03 14:48:49 +0000
commit6c52a8b916e52c9ab33461e931a4e75b3dae04f7 (patch)
treef1bf31bfeca2012db13cdf2ba62ad8bf09f2afdf /sw/qa/core
parentfa430e6b4e6f5d096bdf59db26e5d7393ca2297b (diff)
drop SW_DLLPUBLICs for unit-test only exposure
seeing as have a uwriter target for the non-exposed symbols case. As a motivating side-effect stops crashing on exit on an optimized build with my x86_64 fedora 20 gcc 4.8.3 build Change-Id: If0240ee02d4899e488b12d2d8d5f9b6bf7cca37d
Diffstat (limited to 'sw/qa/core')
-rw-r--r--sw/qa/core/test_ToxLinkProcessor.cxx140
-rw-r--r--sw/qa/core/test_ToxTextGenerator.cxx195
-rw-r--r--sw/qa/core/test_ToxWhitespaceStripper.cxx147
3 files changed, 482 insertions, 0 deletions
diff --git a/sw/qa/core/test_ToxLinkProcessor.cxx b/sw/qa/core/test_ToxLinkProcessor.cxx
new file mode 100644
index 000000000000..e0ae1a1bd41e
--- /dev/null
+++ b/sw/qa/core/test_ToxLinkProcessor.cxx
@@ -0,0 +1,140 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <stdexcept>
+
+#include <sal/types.h>
+
+#include <rtl/ustring.hxx>
+
+#include <ToxLinkProcessor.hxx>
+
+#include <cppunit/TestAssert.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/plugin/TestPlugIn.h>
+#include <test/bootstrapfixture.hxx>
+
+#include <swdll.hxx>
+
+using namespace sw;
+
+class ToxLinkProcessorTest : public test::BootstrapFixture
+{
+ void ExceptionIsThrownIfTooManyLinksAreClosed();
+ void AddingAndClosingTwoLinksResultsInTwoClosedLinks();
+ void LinkIsCreatedCorrectly();
+ void LinkSequenceIsPreserved();
+
+ CPPUNIT_TEST_SUITE(ToxLinkProcessorTest);
+ CPPUNIT_TEST(ExceptionIsThrownIfTooManyLinksAreClosed);
+ CPPUNIT_TEST(AddingAndClosingTwoLinksResultsInTwoClosedLinks);
+ CPPUNIT_TEST(LinkIsCreatedCorrectly);
+ CPPUNIT_TEST(LinkSequenceIsPreserved);
+ CPPUNIT_TEST_SUITE_END();
+public:
+ void setUp() SAL_OVERRIDE {
+ BootstrapFixture::setUp();
+ SwGlobals::ensure();
+ }
+
+ static const OUString STYLE_NAME_1;
+ static const OUString STYLE_NAME_2;
+ static const sal_uInt16 POOL_ID_1;
+ static const sal_uInt16 POOL_ID_2;
+ static const OUString URL_1;
+ static const OUString URL_2;
+};
+
+const OUString ToxLinkProcessorTest::STYLE_NAME_1 = "anyStyle1";
+const OUString ToxLinkProcessorTest::STYLE_NAME_2 = "anyStyle2";
+const OUString ToxLinkProcessorTest::URL_1 = "anyUrl1";
+const OUString ToxLinkProcessorTest::URL_2 = "anyUrl2";
+const sal_uInt16 ToxLinkProcessorTest::POOL_ID_1 = 42;
+const sal_uInt16 ToxLinkProcessorTest::POOL_ID_2 = 43;
+
+void
+ToxLinkProcessorTest::ExceptionIsThrownIfTooManyLinksAreClosed()
+{
+ ToxLinkProcessor sut;
+ sut.StartNewLink(0, STYLE_NAME_1);
+ sut.CloseLink(1, URL_1);
+ CPPUNIT_ASSERT_THROW(sut.CloseLink(1, URL_1), std::runtime_error);
+}
+
+void
+ToxLinkProcessorTest::AddingAndClosingTwoLinksResultsInTwoClosedLinks()
+{
+ ToxLinkProcessor sut;
+ sut.StartNewLink(0, STYLE_NAME_1);
+ sut.StartNewLink(0, STYLE_NAME_2);
+ sut.CloseLink(1, URL_1);
+ sut.CloseLink(1, URL_2);
+ CPPUNIT_ASSERT_EQUAL(2u, static_cast<unsigned>(sut.mClosedLinks.size()));
+ CPPUNIT_ASSERT_MESSAGE("no links are open", sut.mStartedLinks.empty());
+}
+
+class ToxLinkProcessorWithOverriddenObtainPoolId : public ToxLinkProcessor {
+public:
+ virtual sal_uInt16
+ ObtainPoolId(const OUString& characterStyle) const SAL_OVERRIDE {
+ if (characterStyle == ToxLinkProcessorTest::STYLE_NAME_1) {
+ return ToxLinkProcessorTest::POOL_ID_1;
+ }
+ if (characterStyle == ToxLinkProcessorTest::STYLE_NAME_2) {
+ return ToxLinkProcessorTest::POOL_ID_2;
+ }
+ return 0;
+ }
+};
+
+void
+ToxLinkProcessorTest::LinkIsCreatedCorrectly()
+{
+ // obtainpoolid needs to be overridden to check what we are
+ ToxLinkProcessorWithOverriddenObtainPoolId sut;
+
+ sut.StartNewLink(0, STYLE_NAME_1);
+ sut.CloseLink(1, URL_1);
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Style is stored correctly in link", STYLE_NAME_1, sut.mClosedLinks.at(0).mINetFmt.GetVisitedFmt());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Url is stored correctly in link", URL_1, sut.mClosedLinks.at(0).mINetFmt.GetValue());
+}
+
+void
+ToxLinkProcessorTest::LinkSequenceIsPreserved()
+{
+
+ // obtainpoolid needs to be overridden to check what we are
+ ToxLinkProcessorWithOverriddenObtainPoolId sut;
+
+ sut.StartNewLink(0, STYLE_NAME_1);
+ sut.StartNewLink(0, STYLE_NAME_2);
+ sut.CloseLink(1, URL_2);
+ sut.CloseLink(1, URL_1);
+
+ // check first closed element
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Style is stored correctly in link",
+ STYLE_NAME_2, sut.mClosedLinks.at(0).mINetFmt.GetVisitedFmt());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Pool id is stored correctly in link",
+ POOL_ID_2, sut.mClosedLinks.at(0).mINetFmt.GetINetFmtId());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Url is stored correctly in link",
+ URL_2, sut.mClosedLinks.at(0).mINetFmt.GetValue());
+ // check second closed element
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Style is stored correctly in link",
+ STYLE_NAME_1, sut.mClosedLinks.at(1).mINetFmt.GetVisitedFmt());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Pool id is stored correctly in link",
+ POOL_ID_1, sut.mClosedLinks.at(1).mINetFmt.GetINetFmtId());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Url is stored correctly in link",
+ URL_1, sut.mClosedLinks.at(1).mINetFmt.GetValue());
+}
+
+// Put the test suite in the registry
+CPPUNIT_TEST_SUITE_REGISTRATION(ToxLinkProcessorTest);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/test_ToxTextGenerator.cxx b/sw/qa/core/test_ToxTextGenerator.cxx
new file mode 100644
index 000000000000..7f622d084203
--- /dev/null
+++ b/sw/qa/core/test_ToxTextGenerator.cxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "rtl/ustring.hxx"
+#include "chpfld.hxx"
+#include "ndtxt.hxx"
+#include "tox.hxx"
+#include "txmsrt.hxx"
+#include "ToxTextGenerator.hxx"
+#include "ToxTabStopTokenHandler.hxx"
+
+#include <boost/make_shared.hpp>
+
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/plugin/TestPlugIn.h>
+
+using namespace sw;
+
+class ToxTextGeneratorTest : public CppUnit::TestFixture {
+public:
+ void EmptyStringIsReturnedForPageNumberPlaceholderOfZeroItems();
+ void OneAtSignIsReturnedForPageNumberPlaceholderOfOneItem();
+ void TwoAtSignsAreReturnedForPageNumberPlaceholderOfOneItem();
+ void EmptyStringIsReturnedAsNumStringIfNoTextMarkIsSet();
+ void EmptyStringIsReturnedAsNumStringIfToxSourcesIsEmpty();
+ void ChapterNumberWithoutTextIsGeneratedForNoprepstTitle();
+ void ChapterNumberWithTitleIsGeneratedForNumberNoPrepst();
+
+ CPPUNIT_TEST_SUITE(ToxTextGeneratorTest);
+ CPPUNIT_TEST(EmptyStringIsReturnedForPageNumberPlaceholderOfZeroItems);
+ CPPUNIT_TEST(OneAtSignIsReturnedForPageNumberPlaceholderOfOneItem);
+ CPPUNIT_TEST(TwoAtSignsAreReturnedForPageNumberPlaceholderOfOneItem);
+ CPPUNIT_TEST(EmptyStringIsReturnedAsNumStringIfNoTextMarkIsSet);
+ CPPUNIT_TEST(EmptyStringIsReturnedAsNumStringIfToxSourcesIsEmpty);
+ CPPUNIT_TEST(ChapterNumberWithoutTextIsGeneratedForNoprepstTitle);
+ CPPUNIT_TEST(ChapterNumberWithTitleIsGeneratedForNumberNoPrepst);
+ CPPUNIT_TEST_SUITE_END();
+
+};
+
+struct MockedSortTab : public SwTOXSortTabBase {
+ MockedSortTab()
+ : SwTOXSortTabBase(TOX_SORT_INDEX,0,0,0) {;}
+
+ virtual TextAndReading GetText_Impl() const SAL_OVERRIDE {
+ return TextAndReading();
+ }
+ virtual sal_uInt16 GetLevel() const SAL_OVERRIDE {
+ return 0;
+ }
+};
+
+void
+ToxTextGeneratorTest::EmptyStringIsReturnedForPageNumberPlaceholderOfZeroItems()
+{
+ OUString expected("");
+ OUString actual = ToxTextGenerator::ConstructPageNumberPlaceholder(0);
+ CPPUNIT_ASSERT_EQUAL(expected, actual);
+}
+
+void
+ToxTextGeneratorTest::OneAtSignIsReturnedForPageNumberPlaceholderOfOneItem()
+{
+ OUString expected("@~");
+ OUString actual = ToxTextGenerator::ConstructPageNumberPlaceholder(1);
+ CPPUNIT_ASSERT_EQUAL(expected, actual);
+}
+
+void
+ToxTextGeneratorTest::TwoAtSignsAreReturnedForPageNumberPlaceholderOfOneItem()
+{
+ OUString expected("@, @~");
+ OUString actual = ToxTextGenerator::ConstructPageNumberPlaceholder(2);
+ CPPUNIT_ASSERT_EQUAL(expected, actual);
+}
+
+void
+ToxTextGeneratorTest::EmptyStringIsReturnedAsNumStringIfNoTextMarkIsSet()
+{
+ MockedSortTab sortTab;
+ sortTab.pTxtMark = NULL;
+
+ OUString expected("");
+ OUString actual = ToxTextGenerator::GetNumStringOfFirstNode(sortTab, false, 0);
+ CPPUNIT_ASSERT_EQUAL(expected, actual);
+}
+
+void
+ToxTextGeneratorTest::EmptyStringIsReturnedAsNumStringIfToxSourcesIsEmpty()
+{
+ MockedSortTab sortTab;
+ sortTab.pTxtMark = reinterpret_cast<SwTxtTOXMark*>(1);
+
+ OUString expected("");
+ OUString actual = ToxTextGenerator::GetNumStringOfFirstNode(sortTab, false, 0);
+ CPPUNIT_ASSERT_EQUAL(expected, actual);
+}
+
+class MockedToxTabStopTokenHandler : public ToxTabStopTokenHandler {
+public:
+ virtual HandledTabStopToken
+ HandleTabStopToken(const SwFormToken& aToken, const SwTxtNode& targetNode,
+ const SwRootFrm *currentLayout) const SAL_OVERRIDE {
+ (void)(aToken); (void)(targetNode); (void)(currentLayout); // avoid unused warnings.
+ return HandledTabStopToken();
+ }
+};
+
+class ToxTextGeneratorWithMockedChapterField : public ToxTextGenerator {
+public:
+ ToxTextGeneratorWithMockedChapterField(SwForm &form)
+ : ToxTextGenerator(form, boost::make_shared<MockedToxTabStopTokenHandler>()),
+ mChapterFieldType(), mChapterField(&mChapterFieldType) {;}
+
+ SwChapterField&
+ GetChapterField() {
+ return mChapterField;
+ }
+
+private:
+ SwChapterField
+ ObtainChapterField(SwChapterFieldType* chapterFieldType, const SwFormToken* chapterToken,
+ const SwCntntFrm* contentFrame, const SwCntntNode *contentNode) const SAL_OVERRIDE {
+ // get rid of 'unused-parameters' warnings
+ (void)(chapterFieldType);(void)(chapterToken);(void)(contentFrame);(void)(contentNode);
+ return mChapterField;
+ }
+
+ SwChapterFieldType mChapterFieldType;
+ SwChapterField mChapterField;
+};
+
+void
+ToxTextGeneratorTest::ChapterNumberWithoutTextIsGeneratedForNoprepstTitle()
+{
+ SwForm form;
+ ToxTextGeneratorWithMockedChapterField ttg(form);
+ // set all values to make sure they are not used
+ ttg.GetChapterField().sNumber = "1";
+ ttg.GetChapterField().sPre = "PRE";
+ ttg.GetChapterField().sPost = "POST";
+ ttg.GetChapterField().sTitle = "TITLE";
+
+ SwFormToken token(TOKEN_CHAPTER_INFO);
+ token.nChapterFormat = CF_NUM_NOPREPST_TITLE;
+
+ OUString expected("1");
+ OUString actual = ttg.GenerateTextForChapterToken(token, NULL, NULL);
+ CPPUNIT_ASSERT_EQUAL(expected, actual);
+
+ // we cannot mock the pre- and suffix generation in the chapterfield. We just test that sNumber and
+ // sTitle are used and hope that the pre- and suffix addition works.
+ token.nChapterFormat = CF_NUMBER;
+ expected = ttg.GenerateTextForChapterToken(token, NULL, NULL);
+ CPPUNIT_ASSERT_EQUAL(expected, actual);
+}
+
+
+void
+ToxTextGeneratorTest::ChapterNumberWithTitleIsGeneratedForNumberNoPrepst()
+{
+ SwForm form;
+ ToxTextGeneratorWithMockedChapterField ttg(form);
+ // set all values to make sure they are not used
+ ttg.GetChapterField().sNumber = "5";
+ ttg.GetChapterField().sPre = "PRE";
+ ttg.GetChapterField().sPost = "POST";
+ ttg.GetChapterField().sTitle = "myTitle";
+
+ SwFormToken token(TOKEN_CHAPTER_INFO);
+ token.nChapterFormat = CF_NUMBER_NOPREPST;
+
+ OUString expected("5 myTitle");
+ OUString actual = ttg.GenerateTextForChapterToken(token, NULL, NULL);
+ CPPUNIT_ASSERT_EQUAL(expected, actual);
+
+ // we cannot mock the pre- and suffix generation in the chapterfield. We just test that sNumber and
+ // sTitle are used and hope that the pre- and suffix addition works.
+ token.nChapterFormat = CF_NUM_TITLE;
+ expected = ttg.GenerateTextForChapterToken(token, NULL, NULL);
+ CPPUNIT_ASSERT_EQUAL(expected, actual);
+}
+
+// Put the test suite in the registry
+CPPUNIT_TEST_SUITE_REGISTRATION(ToxTextGeneratorTest);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/test_ToxWhitespaceStripper.cxx b/sw/qa/core/test_ToxWhitespaceStripper.cxx
new file mode 100644
index 000000000000..30da0bdb1a6b
--- /dev/null
+++ b/sw/qa/core/test_ToxWhitespaceStripper.cxx
@@ -0,0 +1,147 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <stdexcept>
+
+#include <sal/types.h>
+
+#include <rtl/ustring.hxx>
+
+#include <ToxWhitespaceStripper.hxx>
+
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace sw;
+
+class ToxWhitespaceStripperTest : public CppUnit::TestFixture
+{
+ void
+ MappingCharactersToVariousStrippedStringsWorks();
+
+ void
+ StrippingWhitespacesFromVariousStringsWorks();
+
+ void
+ PositionAfterStringCanBeRequested();
+
+ CPPUNIT_TEST_SUITE(ToxWhitespaceStripperTest);
+ CPPUNIT_TEST(MappingCharactersToVariousStrippedStringsWorks);
+ CPPUNIT_TEST(StrippingWhitespacesFromVariousStringsWorks);
+ CPPUNIT_TEST(PositionAfterStringCanBeRequested);
+
+ CPPUNIT_TEST_SUITE_END();
+
+};
+
+void
+ToxWhitespaceStripperTest::MappingCharactersToVariousStrippedStringsWorks()
+{
+ {
+ OUString test("abc\n");
+ ToxWhitespaceStripper sut(test);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), sut.GetPositionInStrippedString(0));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), sut.GetPositionInStrippedString(1));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), sut.GetPositionInStrippedString(2));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), sut.GetPositionInStrippedString(3));
+ }
+ {
+ OUString test("abc\n\n");
+ ToxWhitespaceStripper sut(test);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), sut.GetPositionInStrippedString(0));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), sut.GetPositionInStrippedString(1));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), sut.GetPositionInStrippedString(2));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), sut.GetPositionInStrippedString(3));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), sut.GetPositionInStrippedString(4));
+ }
+ {
+ OUString test("abc\ndef");
+ ToxWhitespaceStripper sut(test);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), sut.GetPositionInStrippedString(0));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), sut.GetPositionInStrippedString(1));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), sut.GetPositionInStrippedString(2));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), sut.GetPositionInStrippedString(3));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), sut.GetPositionInStrippedString(4));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5), sut.GetPositionInStrippedString(5));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6), sut.GetPositionInStrippedString(6));
+ }
+ {
+ // 012345 6789
+ OUString test(" abc \ndef");
+ // 01234567
+ // " abc def"
+ ToxWhitespaceStripper sut(test);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), sut.GetPositionInStrippedString(0));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), sut.GetPositionInStrippedString(1));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), sut.GetPositionInStrippedString(2));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), sut.GetPositionInStrippedString(3));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), sut.GetPositionInStrippedString(4));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), sut.GetPositionInStrippedString(5));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), sut.GetPositionInStrippedString(6));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5), sut.GetPositionInStrippedString(7));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6), sut.GetPositionInStrippedString(8));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7), sut.GetPositionInStrippedString(9));
+ }
+}
+
+void
+ToxWhitespaceStripperTest::StrippingWhitespacesFromVariousStringsWorks()
+{
+ {
+ OUString test("abc\n");
+ OUString expected("abc");
+ ToxWhitespaceStripper sut(test);
+ CPPUNIT_ASSERT_EQUAL(expected, sut.GetStrippedString());
+ }
+ {
+ OUString test("abc\n\n");
+ OUString expected("abc");
+ ToxWhitespaceStripper sut(test);
+ CPPUNIT_ASSERT_EQUAL(expected, sut.GetStrippedString());
+ }
+ {
+ OUString test("abc\ndef");
+ OUString expected("abc def");
+ ToxWhitespaceStripper sut(test);
+ CPPUNIT_ASSERT_EQUAL(expected, sut.GetStrippedString());
+ }
+ {
+ OUString test(" abc \ndef");
+ OUString expected(" abc def");
+ ToxWhitespaceStripper sut(test);
+ CPPUNIT_ASSERT_EQUAL(expected, sut.GetStrippedString());
+ }
+ {
+ OUString test(" ");
+ OUString expected("");
+ ToxWhitespaceStripper sut(test);
+ CPPUNIT_ASSERT_EQUAL(expected, sut.GetStrippedString());
+ }
+ {
+ OUString test("d ");
+ OUString expected("d");
+ ToxWhitespaceStripper sut(test);
+ CPPUNIT_ASSERT_EQUAL(expected, sut.GetStrippedString());
+ }
+}
+
+void
+ToxWhitespaceStripperTest::PositionAfterStringCanBeRequested()
+{
+ OUString test("abc");
+ ToxWhitespaceStripper sut(test);
+ sal_Int32 expected = test.getLength();
+ CPPUNIT_ASSERT_EQUAL(expected, sut.GetPositionInStrippedString(test.getLength()));
+}
+
+// Put the test suite in the registry
+CPPUNIT_TEST_SUITE_REGISTRATION(ToxWhitespaceStripperTest);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */