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
871b196f
Kaydet (Commit)
871b196f
authored
Agu 16, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SVG test: check content of Primitive2DSequence with the XML dumper
Change-Id: I12954cd52cece2d2fe99b7b4ca1e60cee3b430f0
üst
4bc6484c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
13 deletions
+41
-13
CppunitTest_svgio.mk
svgio/CppunitTest_svgio.mk
+4
-1
SvgImportTest.cxx
svgio/qa/cppunit/SvgImportTest.cxx
+37
-12
No files found.
svgio/CppunitTest_svgio.mk
Dosyayı görüntüle @
871b196f
...
...
@@ -14,7 +14,10 @@ $(eval $(call gb_CppunitTest_set_include,svgio_import_test,\
-I$(SRCDIR)/svgio/inc \
))
$(eval $(call gb_CppunitTest_use_external,svgio_import_test,boost_headers))
$(eval $(call gb_CppunitTest_use_externals,svgio_import_test,\
boost_headers \
libxml2 \
))
$(eval $(call gb_CppunitTest_use_api,svgio_import_test,\
offapi \
...
...
svgio/qa/cppunit/SvgImportTest.cxx
Dosyayı görüntüle @
871b196f
...
...
@@ -8,7 +8,11 @@
*/
#include <sal/config.h>
#include <test/bootstrapfixture.hxx>
#include <test/primitive2dxmldump.hxx>
#include <test/xmltesttools.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/seqstream.hxx>
...
...
@@ -28,8 +32,10 @@ using namespace css::io;
using
namespace
css
::
graphic
;
using
drawinglayer
::
primitive2d
::
arePrimitive2DSequencesEqual
;
class
Test
:
public
test
::
BootstrapFixture
class
Test
:
public
test
::
BootstrapFixture
,
public
XmlTestTools
{
void
checkRectPrimitive
(
Primitive2DSequence
&
rPrimitive
);
void
testStyles
();
Primitive2DSequence
parseSvg
(
const
char
*
aSource
);
...
...
@@ -72,28 +78,47 @@ void Test::tearDown()
BootstrapFixture
::
tearDown
();
}
void
Test
::
checkRectPrimitive
(
Primitive2DSequence
&
rPrimitive
)
{
Primitive2dXmlDump
dumper
;
xmlDocPtr
pDocument
=
dumper
.
dumpAndParse
(
rPrimitive
);
CPPUNIT_ASSERT
(
pDocument
);
assertXPath
(
pDocument
,
"/primitive2D/transform/polypolygoncolor"
,
"color"
,
"#00cc00"
);
// rect background color
assertXPath
(
pDocument
,
"/primitive2D/transform/polypolygonstroke/line"
,
"color"
,
"#ff0000"
);
// rect stroke color
assertXPath
(
pDocument
,
"/primitive2D/transform/polypolygonstroke/line"
,
"width"
,
"3"
);
// rect stroke width
}
// Attributes for an object (like rect as in this case) can be defined
// in different ways (directly with xml attributes, or with CSS styles),
// however the end result should be the same.
void
Test
::
testStyles
()
{
Primitive2DSequence
maSequenceRect
=
parseSvg
(
"/svgio/qa/cppunit/data/Rect.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
maSequenceRect
.
getLength
());
Primitive2DSequence
aSequenceRect
=
parseSvg
(
"/svgio/qa/cppunit/data/Rect.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
aSequenceRect
.
getLength
());
checkRectPrimitive
(
aSequenceRect
);
Primitive2DSequence
maSequenceRectWithStyle
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithStyles.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
maSequenceRectWithStyle
.
getLength
());
Primitive2DSequence
aSequenceRectWithStyle
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithStyles.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
aSequenceRectWithStyle
.
getLength
());
checkRectPrimitive
(
aSequenceRectWithStyle
);
Primitive2DSequence
maSequenceRectWithParentStyle
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithParentStyles.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
maSequenceRectWithParentStyle
.
getLength
());
Primitive2DSequence
aSequenceRectWithParentStyle
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithParentStyles.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
aSequenceRectWithParentStyle
.
getLength
());
checkRectPrimitive
(
aSequenceRectWithParentStyle
);
Primitive2DSequence
maSequenceRectWithStylesByGroup
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithStylesByGroup.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
maSequenceRectWithStylesByGroup
.
getLength
());
Primitive2DSequence
aSequenceRectWithStylesByGroup
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithStylesByGroup.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
aSequenceRectWithStylesByGroup
.
getLength
());
checkRectPrimitive
(
aSequenceRectWithStylesByGroup
);
CPPUNIT_ASSERT
(
arePrimitive2DSequencesEqual
(
aSequenceRect
,
aSequenceRectWithStyle
));
CPPUNIT_ASSERT
(
arePrimitive2DSequencesEqual
(
aSequenceRect
,
aSequenceRectWithParentStyle
));
CPPUNIT_ASSERT
(
arePrimitive2DSequencesEqual
(
aSequenceRect
,
aSequenceRectWithStylesByGroup
));
CPPUNIT_ASSERT
(
arePrimitive2DSequencesEqual
(
maSequenceRect
,
maSequenceRectWithStyle
));
CPPUNIT_ASSERT
(
arePrimitive2DSequencesEqual
(
maSequenceRect
,
maSequenceRectWithParentStyle
));
CPPUNIT_ASSERT
(
arePrimitive2DSequencesEqual
(
maSequenceRect
,
maSequenceRectWithStylesByGroup
));
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
}
...
...
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