1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #include <swmodeltestbase.hxx>
11 #include <o3tl/string_view.hxx>
13 class Test
: public SwModelTestBase
17 : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text")
22 DECLARE_SW_ROUNDTRIP_TEST(testPasswordMSO2007
, "Encrypted_MSO2007_abc.docx", "abc", Test
)
24 // Standard encryption format, AES 128, SHA1
25 uno::Reference
<text::XTextRange
> xParagraph(getParagraph(1));
26 CPPUNIT_ASSERT_EQUAL(OUString("abc"), xParagraph
->getString());
29 DECLARE_SW_ROUNDTRIP_TEST(testPasswordMSO2010
, "Encrypted_MSO2010_abc.docx", "abc", Test
)
31 // Agile encryption format, AES 128, CBC, SHA1
32 uno::Reference
<text::XTextRange
> xParagraph(getParagraph(1));
33 CPPUNIT_ASSERT_EQUAL(OUString("abc"), xParagraph
->getString());
36 DECLARE_SW_ROUNDTRIP_TEST(testPasswordMSO2013
, "Encrypted_MSO2013_abc.docx", "abc", Test
)
38 // Agile encryption format, AES 256, CBC, SHA512
39 uno::Reference
<text::XTextRange
> xParagraph(getParagraph(1));
40 CPPUNIT_ASSERT_EQUAL(OUString("ABC"), xParagraph
->getString());
43 DECLARE_SW_ROUNDTRIP_TEST(testPasswordLOStandard
, "Encrypted_LO_Standard_abc.docx", "abc", Test
)
45 // Standard encryption format, AES 128, SHA1
46 uno::Reference
<text::XTextRange
> xParagraph(getParagraph(1));
47 CPPUNIT_ASSERT_EQUAL(OUString("ABC"), xParagraph
->getString());
50 CPPUNIT_PLUGIN_IMPLEMENT();
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */