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
6ea64792
Kaydet (Commit)
6ea64792
authored
Eki 13, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
make test more readable - use Primitive2DSequence
Change-Id: I8e49fce5a4d8f5b46b9bd1dd3f71a8c7dc90c20d
üst
0b0c34c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
SvgImportTest.cxx
svgio/qa/cppunit/SvgImportTest.cxx
+9
-10
No files found.
svgio/qa/cppunit/SvgImportTest.cxx
Dosyayı görüntüle @
6ea64792
...
...
@@ -31,14 +31,15 @@ using namespace css::uno;
using
namespace
css
::
io
;
using
namespace
css
::
graphic
;
using
drawinglayer
::
primitive2d
::
arePrimitive2DSequencesEqual
;
using
drawinglayer
::
primitive2d
::
Primitive2DSequence
;
class
Test
:
public
test
::
BootstrapFixture
,
public
XmlTestTools
{
void
checkRectPrimitive
(
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
graphic
::
XPrimitive2D
>
>
&
rPrimitive
);
void
checkRectPrimitive
(
Primitive2DSequence
&
rPrimitive
);
void
testStyles
();
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
graphic
::
XPrimitive2D
>
>
parseSvg
(
const
char
*
aSource
);
Primitive2DSequence
parseSvg
(
const
char
*
aSource
);
public
:
virtual
void
setUp
()
override
;
...
...
@@ -49,7 +50,7 @@ public:
CPPUNIT_TEST_SUITE_END
();
};
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
graphic
::
XPrimitive2D
>
>
Test
::
parseSvg
(
const
char
*
aSource
)
Primitive2DSequence
Test
::
parseSvg
(
const
char
*
aSource
)
{
const
Reference
<
XSvgParser
>
xSvgParser
=
SvgTools
::
create
(
m_xContext
);
...
...
@@ -78,7 +79,7 @@ void Test::tearDown()
BootstrapFixture
::
tearDown
();
}
void
Test
::
checkRectPrimitive
(
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
graphic
::
XPrimitive2D
>
>
&
rPrimitive
)
void
Test
::
checkRectPrimitive
(
Primitive2DSequence
&
rPrimitive
)
{
Primitive2dXmlDump
dumper
;
xmlDocPtr
pDocument
=
dumper
.
dumpAndParse
(
rPrimitive
);
...
...
@@ -96,29 +97,27 @@ void Test::checkRectPrimitive(css::uno::Sequence< css::uno::Reference< css::grap
// however the end result should be the same.
void
Test
::
testStyles
()
{
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
graphic
::
XPrimitive2D
>
>
aSequenceRect
=
parseSvg
(
"/svgio/qa/cppunit/data/Rect.svg"
);
Primitive2DSequence
aSequenceRect
=
parseSvg
(
"/svgio/qa/cppunit/data/Rect.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
aSequenceRect
.
getLength
());
checkRectPrimitive
(
aSequenceRect
);
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
graphic
::
XPrimitive2D
>
>
aSequenceRectWithStyle
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithStyles.svg"
);
Primitive2DSequence
aSequenceRectWithStyle
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithStyles.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
aSequenceRectWithStyle
.
getLength
());
checkRectPrimitive
(
aSequenceRectWithStyle
);
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
graphic
::
XPrimitive2D
>
>
aSequenceRectWithParentStyle
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithParentStyles.svg"
);
Primitive2DSequence
aSequenceRectWithParentStyle
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithParentStyles.svg"
);
CPPUNIT_ASSERT_EQUAL
(
1
,
(
int
)
aSequenceRectWithParentStyle
.
getLength
());
checkRectPrimitive
(
aSequenceRectWithParentStyle
);
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
css
::
graphic
::
XPrimitive2D
>
>
aSequenceRectWithStylesByGroup
=
parseSvg
(
"/svgio/qa/cppunit/data/RectWithStylesByGroup.svg"
);
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_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