tdf#146264: Add unit test

Make sure the text is not duplicated in the output.

Change-Id: I1600d18f0921d2ab2cb67898bc02b68f0f9b36c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127935
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
This commit is contained in:
Tor Lillqvist
2022-01-04 17:08:42 +01:00
parent 18444c2822
commit 6bfeb2290c
2 changed files with 16 additions and 0 deletions
+16
View File
@@ -54,6 +54,22 @@ DECLARE_HTMLEXPORT_TEST(testTdf131812, "tdf131812.odt")
!= -1);
}
DECLARE_HTMLEXPORT_TEST(testTdf146264, "tdf146264.odt")
{
SvStream* pStream = maTempFile.GetStream(StreamMode::READ);
CPPUNIT_ASSERT(pStream);
sal_uInt64 nLength = pStream->TellEnd();
OString aStream(read_uInt8s_ToOString(*pStream, nLength));
sal_Int32 nFirstHello = aStream.indexOf("Hello");
CPPUNIT_ASSERT(nFirstHello > 0);
if (nFirstHello > 0)
{
sal_Int32 nSecondHello = aStream.indexOf("Hello", nFirstHello + 1);
constexpr sal_Int32 nMinusOne = -1;
CPPUNIT_ASSERT_EQUAL(nMinusOne, nSecondHello);
}
}
DECLARE_HTMLEXPORT_TEST(testTdf118637, "tdf118637.odt")
{
SvStream* pStream = maTempFile.GetStream(StreamMode::READ);
Binary file not shown.