diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-11 11:54:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-11 11:55:05 +0000 |
commit | c5e0be4f86bffeafd6642e6eb2c6758f4b27beaa (patch) | |
tree | 69e7a1868cc4361bf57367911d024b1ec472fdd5 /sd/qa | |
parent | 5aea780bfd46a369ed6c8ef3505dcaeb6f44323d (diff) |
add an initial ppt cve test
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/ppt/fail/.gitignore | 0 | ||||
-rw-r--r-- | sd/qa/unit/data/ppt/indeterminate/.gitignore | 0 | ||||
-rw-r--r-- | sd/qa/unit/data/ppt/pass/.gitignore | 0 | ||||
-rw-r--r-- | sd/qa/unit/data/ppt/pass/CVE-2006-3656.ppt | bin | 0 -> 35840 bytes | |||
-rw-r--r-- | sd/qa/unit/filters-test.cxx | 30 |
5 files changed, 28 insertions, 2 deletions
diff --git a/sd/qa/unit/data/ppt/fail/.gitignore b/sd/qa/unit/data/ppt/fail/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sd/qa/unit/data/ppt/fail/.gitignore diff --git a/sd/qa/unit/data/ppt/indeterminate/.gitignore b/sd/qa/unit/data/ppt/indeterminate/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sd/qa/unit/data/ppt/indeterminate/.gitignore diff --git a/sd/qa/unit/data/ppt/pass/.gitignore b/sd/qa/unit/data/ppt/pass/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sd/qa/unit/data/ppt/pass/.gitignore diff --git a/sd/qa/unit/data/ppt/pass/CVE-2006-3656.ppt b/sd/qa/unit/data/ppt/pass/CVE-2006-3656.ppt Binary files differnew file mode 100644 index 000000000000..a1fd65a19f85 --- /dev/null +++ b/sd/qa/unit/data/ppt/pass/CVE-2006-3656.ppt diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx index 1ae13d6c3c23..c01414384a6b 100644 --- a/sd/qa/unit/filters-test.cxx +++ b/sd/qa/unit/filters-test.cxx @@ -62,15 +62,18 @@ public: SdFiltersTest(); ::sd::DrawDocShellRef loadURL( const rtl::OUString &rURL ); - virtual bool load(const rtl::OUString &, const rtl::OUString &, const rtl::OUString &) { return false; } + virtual bool load( const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData); + virtual void setUp(); virtual void tearDown(); - // FIXME: we should add some CVE tests ... void test(); + // Ensure CVEs remain unbroken + void testCVEs(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(test); + CPPUNIT_TEST(testCVEs); CPPUNIT_TEST_SUITE_END(); private: @@ -155,6 +158,29 @@ void SdFiltersTest::test() xDocShRef->DoClose(); } +bool SdFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL, + const rtl::OUString &rUserData) +{ + SfxFilter aFilter( + rFilter, + rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(), + rUserData, rtl::OUString() ); + + ::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell(); + SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ, true); + pSrcMed->SetFilter(&aFilter); + bool bLoaded = xDocShRef->DoLoad(pSrcMed); + xDocShRef->DoClose(); + return bLoaded; +} + +void SdFiltersTest::testCVEs() +{ + testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS PowerPoint 97")), + getURLFromSrc("/sd/qa/unit/data/ppt/"), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdfilt"))); +} + SdFiltersTest::SdFiltersTest() { } |