Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
46ed13bd
Kaydet (Commit)
46ed13bd
authored
Mar 02, 2011
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add regression test for CVE-2006-3117
üst
13875a7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
3 deletions
+42
-3
CVE-2006-3117-1.sxw
sw/qa/core/CVE/CVE-2006-3117-1.sxw
+0
-0
makefile.mk
sw/qa/core/makefile.mk
+1
-3
swdoc-test.cxx
sw/qa/core/swdoc-test.cxx
+41
-0
No files found.
sw/qa/core/CVE/CVE-2006-3117-1.sxw
0 → 100644
Dosyayı görüntüle @
46ed13bd
File added
sw/qa/core/makefile.mk
Dosyayı görüntüle @
46ed13bd
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
PRJ
=
..
$/
..
PRJ
=
..
$/
..
PRJNAME
=
sw
PRJNAME
=
sw
TARGET
=
test-bigptrarray
TARGET
=
qa_unit
ENABLE_EXCEPTIONS
=
TRUE
ENABLE_EXCEPTIONS
=
TRUE
...
@@ -46,8 +46,6 @@ SHL1STDLIBS=$(SALLIB) $(TOOLSLIB) $(CPPUNITLIB)
...
@@ -46,8 +46,6 @@ SHL1STDLIBS=$(SALLIB) $(TOOLSLIB) $(CPPUNITLIB)
SHL1IMPLIB
=
i
$(SHL1TARGET)
SHL1IMPLIB
=
i
$(SHL1TARGET)
# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME
=
$(SHL1TARGET)
DEF1NAME
=
$(SHL1TARGET)
SHL1VERSIONMAP
=
export.map
SHL1VERSIONMAP
=
export.map
...
...
sw/qa/core/swdoc-test.cxx
Dosyayı görüntüle @
46ed13bd
...
@@ -47,9 +47,12 @@
...
@@ -47,9 +47,12 @@
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/basemutex.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/processfactory.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/app.hxx>
#include <sfx2/app.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/sfxmodelfactory.hxx>
#include <sfx2/sfxmodelfactory.hxx>
#include <tools/urlobj.hxx>
#include <tools/urlobj.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/tempfile.hxx>
#include <ucbhelper/contentbroker.hxx>
#include <ucbhelper/contentbroker.hxx>
...
@@ -82,14 +85,22 @@ public:
...
@@ -82,14 +85,22 @@ public:
virtual
void
setUp
();
virtual
void
setUp
();
virtual
void
tearDown
();
virtual
void
tearDown
();
bool
testLoad
(
const
rtl
::
OUString
&
rFilter
,
const
rtl
::
OUString
&
rURL
);
void
randomTest
();
void
randomTest
();
void
testPageDescName
();
void
testPageDescName
();
void
testFileNameFields
();
void
testFileNameFields
();
/**
* Ensure CVEs remain unbroken
*/
void
testCVEs
();
CPPUNIT_TEST_SUITE
(
SwDocTest
);
CPPUNIT_TEST_SUITE
(
SwDocTest
);
CPPUNIT_TEST
(
randomTest
);
CPPUNIT_TEST
(
randomTest
);
CPPUNIT_TEST
(
testPageDescName
);
CPPUNIT_TEST
(
testPageDescName
);
CPPUNIT_TEST
(
testFileNameFields
);
CPPUNIT_TEST
(
testFileNameFields
);
CPPUNIT_TEST
(
testCVEs
);
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
private
:
private
:
...
@@ -97,6 +108,7 @@ private:
...
@@ -97,6 +108,7 @@ private:
uno
::
Reference
<
lang
::
XMultiComponentFactory
>
m_xFactory
;
uno
::
Reference
<
lang
::
XMultiComponentFactory
>
m_xFactory
;
SwDoc
*
m_pDoc
;
SwDoc
*
m_pDoc
;
SwDocShellRef
m_xDocShRef
;
SwDocShellRef
m_xDocShRef
;
::
rtl
::
OUString
m_aPWDURL
;
};
};
void
SwDocTest
::
testPageDescName
()
void
SwDocTest
::
testPageDescName
()
...
@@ -170,6 +182,32 @@ void SwDocTest::testFileNameFields()
...
@@ -170,6 +182,32 @@ void SwDocTest::testFileNameFields()
m_xDocShRef
->
DoInitNew
(
0
);
m_xDocShRef
->
DoInitNew
(
0
);
}
}
bool
SwDocTest
::
testLoad
(
const
rtl
::
OUString
&
rFilter
,
const
rtl
::
OUString
&
rURL
)
{
SfxFilter
aFilter
(
rFilter
,
rtl
::
OUString
(),
0
,
0
,
rtl
::
OUString
(),
0
,
rtl
::
OUString
(),
rtl
::
OUString
(),
rtl
::
OUString
()
);
SwDocShellRef
xDocShRef
=
new
SwDocShell
;
SfxMedium
aSrcMed
(
rURL
,
STREAM_STD_READ
,
true
);
aSrcMed
.
SetFilter
(
&
aFilter
);
return
xDocShRef
->
DoLoad
(
&
aSrcMed
);
}
void
SwDocTest
::
testCVEs
()
{
//To-Do: I know this works on Linux, please check if this test works under
//windows and enable it if so
#ifndef WNT
bool
bResult
;
bResult
=
testLoad
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"StarOffice XML (Writer)"
)),
m_aPWDURL
+
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"/CVE/CVE-2006-3117-1.sxw"
)));
CPPUNIT_ASSERT_MESSAGE
(
"CVE-2006-3117 regression"
,
bResult
==
false
);
#endif
}
void
SwDocTest
::
randomTest
()
void
SwDocTest
::
randomTest
()
{
{
CPPUNIT_ASSERT_MESSAGE
(
"SwDoc::IsRedlineOn()"
,
!
m_pDoc
->
IsRedlineOn
());
CPPUNIT_ASSERT_MESSAGE
(
"SwDoc::IsRedlineOn()"
,
!
m_pDoc
->
IsRedlineOn
());
...
@@ -191,6 +229,9 @@ SwDocTest::SwDocTest()
...
@@ -191,6 +229,9 @@ SwDocTest::SwDocTest()
SwDLL
::
Init
();
SwDLL
::
Init
();
oslProcessError
err
=
osl_getProcessWorkingDir
(
&
m_aPWDURL
.
pData
);
CPPUNIT_ASSERT_MESSAGE
(
"no PWD!"
,
err
==
osl_Process_E_None
);
ErrorHandler
::
RegisterDisplay
(
&
aWndFunc
);
ErrorHandler
::
RegisterDisplay
(
&
aWndFunc
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment