diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-05-31 00:13:00 +0200 |
---|---|---|
committer | Xisco FaulĂ <anistenis@gmail.com> | 2016-05-31 07:41:56 +0000 |
commit | 53f9762889f96a5c29e1b414e0b9e2866ad1c2e6 (patch) | |
tree | fdc461c5068ddc01511dd379e04e56a32c0d5bef /svgio | |
parent | 5d613f920510a5a16ddb50c1577d8c29f1a8e069 (diff) |
SVGIO: Add support for font-family in unittests and unify...
.. textsimpleportion's assert
Change-Id: I97d4c76dcfaa6d3ebebfe3eebfabc8ee7799589d
Reviewed-on: https://gerrit.libreoffice.org/25691
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco FaulĂ <anistenis@gmail.com>
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 67 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/FontsizeKeywords.svg | 20 |
2 files changed, 77 insertions, 10 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index e43c1b16ab27..3fd6c4147369 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -213,16 +213,55 @@ void Test::testFontsizeKeywords() CPPUNIT_ASSERT (pDocument); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "fontcolor", "#000000"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "9"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "familyname", "Times New Roman"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "fontcolor", "#ffffff"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "height", "11"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "familyname", "Times New Roman"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "fontcolor", "#ffd700"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "height", "13"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "familyname", "Times New Roman"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]", "fontcolor", "#ff0000"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]", "height", "16"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]", "familyname", "Times New Roman"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[5]", "fontcolor", "#ffff00"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[5]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[5]", "height", "19"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[5]", "familyname", "Times New Roman"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[6]", "fontcolor", "#0000ff"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[6]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[6]", "height", "23"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[6]", "familyname", "Times New Roman"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[7]", "fontcolor", "#008000"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[7]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[7]", "height", "27"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[7]", "familyname", "Times New Roman"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[8]", "fontcolor", "#ff7f50"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[8]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[8]", "height", "13"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[8]", "familyname", "Times New Roman"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[9]", "fontcolor", "#ffc0cb"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[9]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[9]", "height", "19"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[9]", "familyname", "Times New Roman"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[10]", "fontcolor", "#fffff0"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[10]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[10]", "height", "16"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[9]", "familyname", "Times New Roman"); } @@ -237,7 +276,10 @@ void Test::testFontsizePercentage() CPPUNIT_ASSERT (pDocument); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "fontcolor", "#000000"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "16"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "familyname", "Times New Roman"); } void Test::testFontsizeRelative() @@ -251,7 +293,10 @@ void Test::testFontsizeRelative() CPPUNIT_ASSERT (pDocument); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "fontcolor", "#000000"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "50"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "familyname", "Times New Roman"); } void Test::testTdf45771() @@ -265,7 +310,10 @@ void Test::testTdf45771() CPPUNIT_ASSERT (pDocument); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "fontcolor", "#000000"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "32"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "familyname", "Times New Roman"); } void Test::testTdf97941() @@ -279,7 +327,10 @@ void Test::testTdf97941() CPPUNIT_ASSERT (pDocument); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "fontcolor", "#000000"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "Sample"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "48"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "familyname", "Times New Roman"); } void Test::testTdf85770() @@ -292,9 +343,19 @@ void Test::testTdf85770() CPPUNIT_ASSERT (pDocument); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "fontcolor", "#000000"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "Start Middle End"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "11"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "familyname", "Times New Roman"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "fontcolor", "#000000"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "text", "Start "); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "height", "11"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "familyname", "Times New Roman"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "fontcolor", "#000000"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "text", "End"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "height", "11"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "familyname", "Times New Roman"); + } void Test::testTdf79163() @@ -322,6 +383,9 @@ void Test::testTdf97542_1() CPPUNIT_ASSERT (pDocument); assertXPath(pDocument, "/primitive2D/transform/objectinfo/textsimpleportion", "fontcolor", "#ffff00"); + assertXPath(pDocument, "/primitive2D/transform/objectinfo/textsimpleportion", "text", "Text"); + assertXPath(pDocument, "/primitive2D/transform/objectinfo/textsimpleportion", "height", "48"); + assertXPath(pDocument, "/primitive2D/transform/objectinfo/textsimpleportion", "familyname", "serif"); } void Test::testTdf97542_2() @@ -532,7 +596,10 @@ void Test::testMaskText() CPPUNIT_ASSERT (pDocument); assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor", "color", "#000000"); + assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion", "fontcolor", "#ffffff"); assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion", "text", "Black White"); + assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion", "height", "26"); + assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion", "familyname", "Times New Roman"); } CPPUNIT_TEST_SUITE_REGISTRATION(Test); diff --git a/svgio/qa/cppunit/data/FontsizeKeywords.svg b/svgio/qa/cppunit/data/FontsizeKeywords.svg index c0a5caebdb80..9a97983c0136 100644 --- a/svgio/qa/cppunit/data/FontsizeKeywords.svg +++ b/svgio/qa/cppunit/data/FontsizeKeywords.svg @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <svg height="600" width="400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<text x="5" y="15" font-size="xx-small">Sample</text> -<text x="5" y="50" font-size="x-small">Sample</text> -<text x="5" y="100" font-size="small">Sample</text> -<text x="5" y="150" font-size="medium">Sample</text> -<text x="5" y="200" font-size="large">Sample</text> -<text x="5" y="250" font-size="x-large">Sample</text> -<text x="5" y="300" font-size="xx-large">Sample</text> -<text x="5" y="350" font-size="smaller">Sample</text> -<text x="5" y="400" font-size="larger">Sample</text> -<text x="5" y="450" font-size="initial">Sample</text> +<text x="5" y="15" font-size="xx-small" fill="black">Sample</text> +<text x="5" y="50" font-size="x-small" fill="white">Sample</text> +<text x="5" y="100" font-size="small" fill="gold">Sample</text> +<text x="5" y="150" font-size="medium" fill="red">Sample</text> +<text x="5" y="200" font-size="large" fill="yellow">Sample</text> +<text x="5" y="250" font-size="x-large" fill="blue">Sample</text> +<text x="5" y="300" font-size="xx-large" fill="green">Sample</text> +<text x="5" y="350" font-size="smaller" fill="coral">Sample</text> +<text x="5" y="400" font-size="larger" fill="pink">Sample</text> +<text x="5" y="450" font-size="initial" fill="ivory">Sample</text> </svg> |