Debian Codegraph @

sw/qa/writerfilter/rtftok/rtftokenizer.cxx

raw
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #include <test/unoapi_test.hxx>
11
12 #include <com/sun/star/text/XTextDocument.hpp>
13
14 using namespace ::com::sun::star;
15
16 namespace
17 {
18 /// Tests for sw/source/writerfilter/rtftok/rtftokenizer.cxx.
19 class Test : public UnoApiTest
20 {
21 public:
22 Test()
23 : UnoApiTest(u"/sw/qa/writerfilter/rtftok/data/"_ustr)
24 {
25 }
26 };
27
28 CPPUNIT_TEST_FIXTURE(Test, testInvalidHex)
29 {
30 // Given a document with a markup like "\'3?":
31 loadFromFile(u"invalid-hex.rtf");
32
33 // Then make sure the result matches Word, rather than just refusing to import the document:
34 uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
35 CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8("xřx"), xTextDocument->getText()->getString());
36 }
37 }
38
39 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */