diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-13 10:36:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-08-13 10:53:42 +0100 |
commit | 24e0e7ca6207a45fc45b67a1355a9d855955a2a8 (patch) | |
tree | 9e1908fcdffc38699b86a164bec7e73e8ff88cb7 /sw/qa | |
parent | d5c9e77296056aa5e29a26bd3d8fb01e28dabde2 (diff) |
add cppunit tests to guard against .txt import regressions
i.e. aac04652fda01b0299e17087b151f07d6115e894 cockup
Change-Id: I858a6895678266cdc714962c04bb24bf5769d656
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/core/data/txt/fail/.gitignore | 0 | ||||
-rw-r--r-- | sw/qa/core/data/txt/indeterminate/.gitignore | 0 | ||||
-rw-r--r-- | sw/qa/core/data/txt/pass/.gitignore | 0 | ||||
-rw-r--r-- | sw/qa/core/data/txt/pass/CVE-2009-2473-1.txt | 1 | ||||
-rw-r--r-- | sw/qa/core/data/txt/pass/CVE-2009-2473-2.txt | 1 | ||||
-rw-r--r-- | sw/qa/core/data/txt/pass/UTF-8-test.txt | bin | 0 -> 20334 bytes | |||
-rw-r--r-- | sw/qa/core/filters-test.cxx | 23 |
7 files changed, 21 insertions, 4 deletions
diff --git a/sw/qa/core/data/txt/fail/.gitignore b/sw/qa/core/data/txt/fail/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sw/qa/core/data/txt/fail/.gitignore diff --git a/sw/qa/core/data/txt/indeterminate/.gitignore b/sw/qa/core/data/txt/indeterminate/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sw/qa/core/data/txt/indeterminate/.gitignore diff --git a/sw/qa/core/data/txt/pass/.gitignore b/sw/qa/core/data/txt/pass/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sw/qa/core/data/txt/pass/.gitignore diff --git a/sw/qa/core/data/txt/pass/CVE-2009-2473-1.txt b/sw/qa/core/data/txt/pass/CVE-2009-2473-1.txt new file mode 100644 index 000000000000..3bb3ebd2fbff --- /dev/null +++ b/sw/qa/core/data/txt/pass/CVE-2009-2473-1.txt @@ -0,0 +1 @@ +IX
\ No newline at end of file diff --git a/sw/qa/core/data/txt/pass/CVE-2009-2473-2.txt b/sw/qa/core/data/txt/pass/CVE-2009-2473-2.txt new file mode 100644 index 000000000000..85fc47855b15 --- /dev/null +++ b/sw/qa/core/data/txt/pass/CVE-2009-2473-2.txt @@ -0,0 +1 @@ +ujBgoX>Af
\ No newline at end of file diff --git a/sw/qa/core/data/txt/pass/UTF-8-test.txt b/sw/qa/core/data/txt/pass/UTF-8-test.txt Binary files differnew file mode 100644 index 000000000000..abd16f7253bf --- /dev/null +++ b/sw/qa/core/data/txt/pass/UTF-8-test.txt diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx index 2257d2f63549..4df9b0760c65 100644 --- a/sw/qa/core/filters-test.cxx +++ b/sw/qa/core/filters-test.cxx @@ -38,8 +38,12 @@ #include <sfx2/docfilt.hxx> #include <sfx2/docfile.hxx> #include <sfx2/sfxmodelfactory.hxx> +#include <sfx2/sfxsids.hrc> + +#include <svl/stritem.hxx> #include "init.hxx" +#include "iodetect.hxx" #include "swtypes.hxx" #include "doc.hxx" #include "docsh.hxx" @@ -83,6 +87,13 @@ bool SwFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL SwDocShellRef xDocShRef = new SwDocShell; SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ); pSrcMed->SetFilter(pFilter); + + if (rUserData == FILTER_TEXT_DLG) + { + pSrcMed->GetItemSet()->Put( + SfxStringItem(SID_FILE_FILTEROPTIONS, rtl::OUString("UTF8,LF,Liberation Mono,en-US"))); + } + bool bLoaded = xDocShRef->DoLoad(pSrcMed); if (xDocShRef.Is()) xDocShRef->DoClose(); @@ -91,13 +102,17 @@ bool SwFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL void SwFiltersTest::testCVEs() { - testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Staroffice XML (Writer)")), + testDir(rtl::OUString("Staroffice XML (Writer)"), getURLFromSrc("/sw/qa/core/data/xml/"), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML"))); + rtl::OUString(FILTER_XML)); - testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")), + testDir(rtl::OUString("MS Word 97"), getURLFromSrc("/sw/qa/core/data/ww8/"), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8"))); + rtl::OUString(FILTER_WW8)); + + testDir(rtl::OUString("Text (encoded)"), + getURLFromSrc("/sw/qa/core/data/txt/"), + rtl::OUString(FILTER_TEXT_DLG)); } void SwFiltersTest::setUp() |