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
780cedb2
Kaydet (Commit)
780cedb2
authored
May 15, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
test: parseXmlStream & parseHtmlStream added to test tools
Change-Id: Iff8af5e9ffefb4c3cecf387b16473d45e8b4a65a
üst
7da0a6e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
6 deletions
+32
-6
htmltesttools.hxx
include/test/htmltesttools.hxx
+1
-1
xmltesttools.hxx
include/test/xmltesttools.hxx
+6
-0
htmltesttools.cxx
test/source/htmltesttools.cxx
+8
-5
xmltesttools.cxx
test/source/xmltesttools.cxx
+17
-0
No files found.
include/test/htmltesttools.hxx
Dosyayı görüntüle @
780cedb2
...
@@ -17,12 +17,12 @@
...
@@ -17,12 +17,12 @@
#include <libxml/HTMLtree.h>
#include <libxml/HTMLtree.h>
#include <unotools/tempfile.hxx>
#include <unotools/tempfile.hxx>
#include <boost/scoped_array.hpp>
class
OOO_DLLPUBLIC_TEST
HtmlTestTools
class
OOO_DLLPUBLIC_TEST
HtmlTestTools
{
{
protected
:
protected
:
htmlDocPtr
parseHtml
(
utl
::
TempFile
&
aTempFile
);
htmlDocPtr
parseHtml
(
utl
::
TempFile
&
aTempFile
);
htmlDocPtr
parseHtmlStream
(
SvStream
*
pStream
);
};
};
#endif
#endif
...
...
include/test/xmltesttools.hxx
Dosyayı görüntüle @
780cedb2
...
@@ -14,12 +14,15 @@
...
@@ -14,12 +14,15 @@
#include <test/testdllapi.hxx>
#include <test/testdllapi.hxx>
#include <libxml/xmlwriter.h>
#include <libxml/xmlwriter.h>
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <libxml/xpathInternals.h>
#include <libxml/parserInternals.h>
#include <libxml/parserInternals.h>
#include <rtl/string.hxx>
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
#include <unotools/tempfile.hxx>
#include <cppunit/TestAssert.h>
#include <cppunit/TestAssert.h>
class
OOO_DLLPUBLIC_TEST
XmlTestTools
class
OOO_DLLPUBLIC_TEST
XmlTestTools
...
@@ -28,6 +31,9 @@ protected:
...
@@ -28,6 +31,9 @@ protected:
XmlTestTools
();
XmlTestTools
();
virtual
~
XmlTestTools
();
virtual
~
XmlTestTools
();
htmlDocPtr
parseXml
(
utl
::
TempFile
&
aTempFile
);
htmlDocPtr
parseXmlStream
(
SvStream
*
pStream
);
virtual
void
registerNamespaces
(
xmlXPathContextPtr
&
pXmlXpathCtx
);
virtual
void
registerNamespaces
(
xmlXPathContextPtr
&
pXmlXpathCtx
);
xmlNodeSetPtr
getXPathNode
(
xmlDocPtr
pXmlDoc
,
const
OString
&
rXPath
);
xmlNodeSetPtr
getXPathNode
(
xmlDocPtr
pXmlDoc
,
const
OString
&
rXPath
);
...
...
test/source/htmltesttools.cxx
Dosyayı görüntüle @
780cedb2
...
@@ -9,17 +9,20 @@
...
@@ -9,17 +9,20 @@
#include <test/htmltesttools.hxx>
#include <test/htmltesttools.hxx>
#include <boost/scoped_array.hpp>
htmlDocPtr
HtmlTestTools
::
parseHtml
(
utl
::
TempFile
&
aTempFile
)
htmlDocPtr
HtmlTestTools
::
parseHtml
(
utl
::
TempFile
&
aTempFile
)
{
{
SvFileStream
aFileStream
(
aTempFile
.
GetURL
(),
STREAM_READ
);
SvFileStream
aFileStream
(
aTempFile
.
GetURL
(),
STREAM_READ
);
sal_Size
nSize
=
aFileStream
.
remainingSize
();
return
parseHtmlStream
(
&
aFileStream
);
}
htmlDocPtr
HtmlTestTools
::
parseHtmlStream
(
SvStream
*
pStream
)
{
sal_Size
nSize
=
pStream
->
remainingSize
();
boost
::
scoped_array
<
sal_uInt8
>
pBuffer
(
new
sal_uInt8
[
nSize
+
1
]);
boost
::
scoped_array
<
sal_uInt8
>
pBuffer
(
new
sal_uInt8
[
nSize
+
1
]);
pStream
->
Read
(
pBuffer
.
get
(),
nSize
);
aFileStream
.
Read
(
pBuffer
.
get
(),
nSize
);
pBuffer
[
nSize
]
=
0
;
pBuffer
[
nSize
]
=
0
;
return
htmlParseDoc
(
reinterpret_cast
<
xmlChar
*>
(
pBuffer
.
get
()),
NULL
);
return
htmlParseDoc
(
reinterpret_cast
<
xmlChar
*>
(
pBuffer
.
get
()),
NULL
);
}
}
...
...
test/source/xmltesttools.cxx
Dosyayı görüntüle @
780cedb2
...
@@ -9,12 +9,29 @@
...
@@ -9,12 +9,29 @@
#include <test/xmltesttools.hxx>
#include <test/xmltesttools.hxx>
#include <boost/scoped_array.hpp>
XmlTestTools
::
XmlTestTools
()
XmlTestTools
::
XmlTestTools
()
{}
{}
XmlTestTools
::~
XmlTestTools
()
XmlTestTools
::~
XmlTestTools
()
{}
{}
htmlDocPtr
XmlTestTools
::
parseXml
(
utl
::
TempFile
&
aTempFile
)
{
SvFileStream
aFileStream
(
aTempFile
.
GetURL
(),
STREAM_READ
);
return
parseXmlStream
(
&
aFileStream
);
}
xmlDocPtr
XmlTestTools
::
parseXmlStream
(
SvStream
*
pStream
)
{
sal_Size
nSize
=
pStream
->
remainingSize
();
boost
::
scoped_array
<
sal_uInt8
>
pBuffer
(
new
sal_uInt8
[
nSize
+
1
]);
pStream
->
Read
(
pBuffer
.
get
(),
nSize
);
pBuffer
[
nSize
]
=
0
;
return
xmlParseDoc
(
reinterpret_cast
<
xmlChar
*>
(
pBuffer
.
get
()));
}
xmlNodeSetPtr
XmlTestTools
::
getXPathNode
(
xmlDocPtr
pXmlDoc
,
const
OString
&
rXPath
)
xmlNodeSetPtr
XmlTestTools
::
getXPathNode
(
xmlDocPtr
pXmlDoc
,
const
OString
&
rXPath
)
{
{
xmlXPathContextPtr
pXmlXpathCtx
=
xmlXPathNewContext
(
pXmlDoc
);
xmlXPathContextPtr
pXmlXpathCtx
=
xmlXPathNewContext
(
pXmlDoc
);
...
...
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