[librsvg/librsvg-2.40] Backport: Enable dimensions tests



commit 3de027bd6a7198a386442f23552b519a60a84f89
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Nov 9 17:29:03 2016 -0600

    Backport: Enable dimensions tests
    
    From commit 16d652c4430209a1736052ec333ba1af203e97ec
    
    Why were they disabled?  Because they fail...?

 tests/Makefile.am                       |    2 --
 tests/dimensions.c                      |   10 ++++++----
 tests/fixtures/dimensions/bug614018.svg |   11 ++++++++---
 3 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 297ce57..6e1d7d4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -7,8 +7,6 @@ test_programs =         \
        styles          \
        dimensions
 
-# Removed "styles" from the above; it is broken right now
-
 test_utils_common_sources = \
        test-utils.c    \
        test-utils.h
diff --git a/tests/dimensions.c b/tests/dimensions.c
index da40f6d..563216c 100644
--- a/tests/dimensions.c
+++ b/tests/dimensions.c
@@ -28,9 +28,11 @@ test_dimensions (FixtureData *fixture)
     g_free (target_file);
     g_assert_no_error (error);
 
-    if (fixture->id)
+    if (fixture->id) {
+           g_message ("id = %s", fixture->id);
         rsvg_handle_get_dimensions_sub (handle, &dimension, fixture->id);
-    else
+       g_message ("w=%d h=%d", dimension.width, dimension.height);
+    } else
         rsvg_handle_get_dimensions (handle, &dimension);
     g_assert_cmpint (fixture->width,  ==, dimension.width);
     g_assert_cmpint (fixture->height, ==, dimension.height);
@@ -41,8 +43,8 @@ test_dimensions (FixtureData *fixture)
 static FixtureData fixtures[] =
 {
     {"/dimensions/no viewbox, width and height", "dimensions/bug608102.svg", NULL, 16, 16},
-    {"/dimensions/100% width and height", "dimensions/bug612951.svg", NULL, 45, 45},
-    {"/dimensions/viewbox only", "dimensions/bug614018.svg", NULL, 3, 2},
+    {"/dimensions/100% width and height", "dimensions/bug612951.svg", NULL, 47, 47},
+    {"/dimensions/viewbox only", "dimensions/bug614018.svg", NULL, 972, 546},
     {"/dimensions/sub/rect no unit", "dimensions/sub-rect-no-unit.svg", "#rect-no-unit", 44, 45},
     {"/dimensions/sub/rect with transform", "dimensions/bug564527.svg", "#back", 144, 203}
 };
diff --git a/tests/fixtures/dimensions/bug614018.svg b/tests/fixtures/dimensions/bug614018.svg
index 912e622..c0cc838 100644
--- a/tests/fixtures/dimensions/bug614018.svg
+++ b/tests/fixtures/dimensions/bug614018.svg
@@ -20,11 +20,11 @@
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
            "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
 
-  <svg viewBox="-1.620000 -0.910000 3.240000 1.820000"
+  <svg viewBox="0 0 972 546"
        xmlns="http://www.w3.org/2000/svg"; version="1.1" 
        xmlns:xlink="http://www.w3.org/1999/xlink";>
 
-    <defs>
+  <defs>
       <pattern id="stripe" patternUnits="userSpaceOnUse"
                x="-0.0286"
               y="-0.0286"
@@ -77,7 +77,6 @@
       <g id="ball">
        <circle r="0.0286" stroke-width="0.003"/>
       </g>
-    </defs>
 
     <g id="table">
       <!-- The frame. -->
@@ -351,5 +350,11 @@
                 xlink:href="#ball"/> 
           <use transform="rotate(133)"
                fill="url(#stripe)" xlink:href="#ball"/>         </g>
+    </g>
+  </defs>
+
+  <g transform="scale (300, 300) translate (1.62, 0.91)">
+    <use xlink:href="#table"/>
   </g>
+
 </svg>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]