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
9f874d41
Kaydet (Commit)
9f874d41
authored
Eki 14, 2014
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sc: fix temp file leak in ScHTMLExportTest
Change-Id: Iab385ce8b24dd24985ec9b2d0c9d2a4e603d0fd0
üst
c0b1d1bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
htmlexporttest.cxx
sc/qa/extras/htmlexporttest.cxx
+12
-7
No files found.
sc/qa/extras/htmlexporttest.cxx
Dosyayı görüntüle @
9f874d41
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/mediadescriptor.hxx>
#include <unotools/mediadescriptor.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/localfilehelper.hxx>
#include <unotest/macros_test.hxx>
#include <unotest/macros_test.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/docfile.hxx>
...
@@ -33,7 +34,6 @@ using namespace utl;
...
@@ -33,7 +34,6 @@ using namespace utl;
class
ScHTMLExportTest
:
public
test
::
BootstrapFixture
,
public
unotest
::
MacrosTest
,
public
XmlTestTools
,
public
HtmlTestTools
class
ScHTMLExportTest
:
public
test
::
BootstrapFixture
,
public
unotest
::
MacrosTest
,
public
XmlTestTools
,
public
HtmlTestTools
{
{
Reference
<
XComponent
>
mxComponent
;
Reference
<
XComponent
>
mxComponent
;
TempFile
maTempFile
;
OUString
maFilterOptions
;
OUString
maFilterOptions
;
void
load
(
const
char
*
pDir
,
const
char
*
pName
)
void
load
(
const
char
*
pDir
,
const
char
*
pName
)
...
@@ -45,8 +45,6 @@ class ScHTMLExportTest : public test::BootstrapFixture, public unotest::MacrosTe
...
@@ -45,8 +45,6 @@ class ScHTMLExportTest : public test::BootstrapFixture, public unotest::MacrosTe
void
save
(
const
OUString
&
aFilterName
,
TempFile
&
rTempFile
)
void
save
(
const
OUString
&
aFilterName
,
TempFile
&
rTempFile
)
{
{
rTempFile
.
EnableKillingFile
();
Reference
<
XStorable
>
xStorable
(
mxComponent
,
UNO_QUERY
);
Reference
<
XStorable
>
xStorable
(
mxComponent
,
UNO_QUERY
);
MediaDescriptor
aMediaDescriptor
;
MediaDescriptor
aMediaDescriptor
;
aMediaDescriptor
[
"FilterName"
]
<<=
aFilterName
;
aMediaDescriptor
[
"FilterName"
]
<<=
aFilterName
;
...
@@ -75,11 +73,16 @@ public:
...
@@ -75,11 +73,16 @@ public:
void
testHtmlSkipImage
()
void
testHtmlSkipImage
()
{
{
// need a temp dir, because there's an image exported too
TempFile
aTempDir
(
0
,
true
);
OUString
const
url
(
aTempDir
.
GetURL
());
TempFile
aTempFile
(
&
url
,
false
);
htmlDocPtr
pDoc
;
htmlDocPtr
pDoc
;
load
(
"/sc/qa/extras/testdocuments/"
,
"BaseForHTMLExport.ods"
);
load
(
"/sc/qa/extras/testdocuments/"
,
"BaseForHTMLExport.ods"
);
save
(
"HTML (StarCalc)"
,
m
aTempFile
);
save
(
"HTML (StarCalc)"
,
aTempFile
);
pDoc
=
parseHtml
(
m
aTempFile
);
pDoc
=
parseHtml
(
aTempFile
);
CPPUNIT_ASSERT
(
pDoc
);
CPPUNIT_ASSERT
(
pDoc
);
assertXPath
(
pDoc
,
"/html/body"
,
1
);
assertXPath
(
pDoc
,
"/html/body"
,
1
);
...
@@ -87,12 +90,14 @@ public:
...
@@ -87,12 +90,14 @@ public:
load
(
"/sc/qa/extras/testdocuments/"
,
"BaseForHTMLExport.ods"
);
load
(
"/sc/qa/extras/testdocuments/"
,
"BaseForHTMLExport.ods"
);
maFilterOptions
=
OUString
(
"SkipImages"
);
maFilterOptions
=
OUString
(
"SkipImages"
);
save
(
"HTML (StarCalc)"
,
m
aTempFile
);
save
(
"HTML (StarCalc)"
,
aTempFile
);
pDoc
=
parseHtml
(
m
aTempFile
);
pDoc
=
parseHtml
(
aTempFile
);
CPPUNIT_ASSERT
(
pDoc
);
CPPUNIT_ASSERT
(
pDoc
);
assertXPath
(
pDoc
,
"/html/body"
,
1
);
assertXPath
(
pDoc
,
"/html/body"
,
1
);
assertXPath
(
pDoc
,
"/html/body/table/tr/td/img"
,
0
);
assertXPath
(
pDoc
,
"/html/body/table/tr/td/img"
,
0
);
utl
::
removeTree
(
aTempDir
.
GetURL
());
}
}
CPPUNIT_TEST_SUITE
(
ScHTMLExportTest
);
CPPUNIT_TEST_SUITE
(
ScHTMLExportTest
);
...
...
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