[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/qa

René Engelhard rene at kemper.freedesktop.org
Tue Feb 21 10:58:53 PST 2012


 sc/qa/unit/data/ods/passwordOld.ods    |binary
 sc/qa/unit/subsequent_filters-test.cxx |   27 ++++++++++++++++++++++-----
 2 files changed, 22 insertions(+), 5 deletions(-)

New commits:
commit adb293f84d2f7e50ecc8b37ce439fd75c42ad84c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Feb 21 09:30:26 2012 +0100

    add test case for old password algorithm, related fdo#45171
    
    (cherry picked from 	8f82bccf26d14d3ad4a64739edd9ba23c124b8ad)
    
    Signed-off-by: Rene Engelhard <rene at debian.org>

diff --git a/sc/qa/unit/data/ods/passwordOld.ods b/sc/qa/unit/data/ods/passwordOld.ods
new file mode 100644
index 0000000..eee9ede
Binary files /dev/null and b/sc/qa/unit/data/ods/passwordOld.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 9916584..3b46a91 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -171,7 +171,9 @@ public:
     void testBugFixesXLSX();
 
     //misc tests unrelated to the import filters
-    void testPassword();
+    void testPasswordNew();
+    void testPasswordOld();
+
 
     CPPUNIT_TEST_SUITE(ScFiltersTest);
     CPPUNIT_TEST(testRangeName);
@@ -185,7 +187,8 @@ public:
     //disable testPassword on MacOSX due to problems with libsqlite3
     //also crashes on DragonFly due to problems with nss/nspr headers
 #if !defined(MACOSX) && !defined(DRAGONFLY)
-    CPPUNIT_TEST(testPassword);
+    CPPUNIT_TEST(testPasswordOld);
+    CPPUNIT_TEST(testPasswordNew);
 #endif
 
 #if TEST_BUG_FILES
@@ -196,6 +199,7 @@ public:
     CPPUNIT_TEST_SUITE_END();
 
 private:
+    void testPassword_Impl(const rtl::OUString& rFileNameBase);
     uno::Reference<uno::XInterface> m_xCalcComponent;
     ::rtl::OUString m_aBaseString;
 };
@@ -544,15 +548,13 @@ void ScFiltersTest::testBugFixesXLSX()
     xDocSh->DoClose();
 }
 
-void ScFiltersTest::testPassword()
+void ScFiltersTest::testPassword_Impl(const rtl::OUString& aFileNameBase)
 {
-    const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("password."));
     rtl::OUString aFileExtension(aFileFormats[0].pName, strlen(aFileFormats[0].pName), RTL_TEXTENCODING_UTF8 );
     rtl::OUString aFilterName(aFileFormats[0].pFilterName, strlen(aFileFormats[0].pFilterName), RTL_TEXTENCODING_UTF8) ;
     rtl::OUString aFileName;
     createFileURL(aFileNameBase, aFileExtension, aFileName);
     rtl::OUString aFilterType(aFileFormats[0].pTypeName, strlen(aFileFormats[0].pTypeName), RTL_TEXTENCODING_UTF8);
-    std::cout << aFileFormats[0].pName << " Test" << std::endl;
 
     sal_uInt32 nFormat = SFX_FILTER_IMPORT | SFX_FILTER_USESOPTIONS;
     SfxFilter* aFilter = new SfxFilter(
@@ -577,6 +579,21 @@ void ScFiltersTest::testPassword()
     ScDocument* pDoc = xDocSh->GetDocument();
     CPPUNIT_ASSERT_MESSAGE("No Document", pDoc); //remove with first test
     xDocSh->DoClose();
+
+}
+
+void ScFiltersTest::testPasswordNew()
+{
+    //tests opening a file with new password algorithm
+    const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("password."));
+    testPassword_Impl(aFileNameBase);
+}
+
+void ScFiltersTest::testPasswordOld()
+{
+    //tests opening a file with old password algorithm
+    const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("passwordOld."));
+    testPassword_Impl(aFileNameBase);
 }
 
 ScFiltersTest::ScFiltersTest()


More information about the Libreoffice-commits mailing list