summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Disable test for multiple-font-families; restore old reference filesFederico Mena Quintero2020-06-046-2/+0
| | | | | | | | | | | | | | | | | | | | I don't know what's making 577-multiple-font-families.svg pass on my machine but fail in CI and in RPM builds. So we'll go back to the old test files for a while. Findings so far: - This doesn't depend on order in which font files are added to FcConfig - changed test-utils.c to use a different order and nothing changed. - During pango_itemize for a layout, I think pango is using the first font in the fontset that contains the codepoint for a particular character, even if there are other fonts in the fontset. Maybe ordering is not constant? But given a PangoFontDescription like "Nonexistent, serif, sans-serif", why is it not using serif first? Sigh.
* Add test files for #577 - ensure font-family works with multiple familiesFederico Mena Quintero2020-05-272-0/+7
|
* Add a couple of serif fonts for the test suiteFederico Mena Quintero2020-05-2711-15/+20
| | | | | | | | | | | | | | We'll have support for multiple font families soon. We only test with a sans-serif font, so this commit adds two of the Noto Serif faces for the test suite. A few test files that use default font-family (which is "Times New Roman" for librsvg) get changed to explicitly use "sans", so their reference PNGs still match the output. Other test files which have both sans and serif fonts, but got rendered to sans-only, get their reference PNGs regenerated to match the newly available faces.
* (#593): Don't panic with an empty objectBoundingBox for a maskFederico Mena Quintero2020-04-301-0/+10
| | | | | | | I couldn't make it work with bbox.rect_to_transform, so here is an ugly check directly on the rectangle instead :( Fixes https://gitlab.gnome.org/GNOME/librsvg/-/issues/593
* Test that the pixbuf API doesn't overflowFederico Mena Quintero2020-04-291-0/+14
| | | | | | Hopefully I'm not testing too little by only testing a single function - they all go through the same internals right now, with checks in a single place.
* Test that files with big viewBox don't overflow the dimensions APIFederico Mena Quintero2020-04-291-0/+11
|
* Do all the GType checks for the C API in the Rust codeFederico Mena Quintero2020-04-291-0/+33
|
* Implement rsvg_return_if_fail / rsvg_return_val_if_fail in RustFederico Mena Quintero2020-04-291-0/+20
| | | | | | | | | | | The macros g_return_if_fail() and g_return_val_if_fail() just call the function g_return_if_fail_warning(). We'll implement equivalent macros in Rust, so we can move all the argument checks for the C API to Rust. Then we can hopefully remove the C wrapper library that just calls into Rust immediately.
* (#590): Fix regression when rendering masksFederico Mena Quintero2020-04-232-0/+26
| | | | | | | | There was a cut&paste error in Mask::get_units(). I'm not sure why the test suite didn't catch this; maybe we don't have a test with the defaults for maskUnits and maskContentUnits? Fixes https://gitlab.gnome.org/GNOME/librsvg/-/issues/590
* (#588) - Fix panic when a big viewBox does creates an invalid transformFederico Mena Quintero2020-04-221-0/+23
| | | | | | | | | | | | | | The example file, created through fuzzing, has a viewBox="0 0 6E20 540". This creates a non-invertible transform in AspectRatio.viewport_to_viewbox_transform(), and when the calling code sets that transform on a cr, it panics because the cr ends up in an error state. This commit makes viewport_to_viewbox_transform() return a Result, so that it returns Err when it would create an invalid transform. Fixes one of the cases in https://gitlab.gnome.org/GNOME/librsvg/-/issues/588
* (#578): Link the C tests to harfbuzz so they can call hb_version_string()Federico Mena Quintero2020-03-311-0/+4
| | | | Fixes https://gitlab.gnome.org/GNOME/librsvg/-/issues/578
* (#548): Support images with data: URLs that don't have a MIME-typeFederico Mena Quintero2020-03-272-0/+6
| | | | | | | | This is to be resilient with Open Clip Art images generated by an (old?) version of Adobe Illustrator, which creates data: URLs without a MIME-type. We'll sniff those images instead of using text/plain. https://gitlab.gnome.org/GNOME/librsvg/-/issues/548
* (#129): Fix baseline-shift for simple subscripts/superscripts and absolute ↵Federico Mena Quintero2020-03-272-0/+71
| | | | | | | | | | | | | | | | | | | | | | offsets This has two parts: 1. Start a new chunk for a tspan even if it does not have absolute positions. This is so that <text> Foo bar<tspan baseline-shift="sub">subscript</tspan> </text> will actually pick up the span's ComputedValues - note how the tspan does not have x/y position properties. 2. If the baseline-shift is a length with an absolute unit, add it to the parent's instead of ignoring it. As a limitation, we still use only the parent's baseline-shift if the units are different. Fixes https://gitlab.gnome.org/GNOME/librsvg/-/issues/129
* tests/test-utils.c: Fix build without PangoFT2Chun-wei Fan2020-03-251-0/+6
| | | | | | | | PangoFT2's headers included the FreeType2 headers for us, but builds without PangoFT2 had to include them explicitly. So do so here if we don't have PangoFT2. Also, if we are building against Pango that is before 1.44.0, include the HarfBuzz headers explicitly, since Pango core only included that for us since 1.44.0.
* tests: indent test-utils.c according to the rules defined at the topSven Neumann2020-02-071-113/+116
|
* tests: print the run-time version of freetypeSven Neumann2020-02-071-2/+10
| | | | Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/553
* Update test reference filesFederico Mena Quintero2020-02-01162-0/+0
| | | | | Pango changed from 1.43 to 1.44 and creates different results. I'm not completely convinced that they are correct.
* Print dependency versions in rsvg-test.logFederico Mena Quintero2020-02-013-0/+14
|
* tests: add test cases for pattern fill (issue #510)Sven Neumann2020-01-294-0/+42
|
* transform: implement our own Transform typePaolo Borelli2020-01-201-0/+0
| | | | | | | | | | | | | | | | Use our own Transform type, rather than cairo::Matrix. Beside paving the way to other rendering backends, using our own type has the benefit of not having to cross the ffi boundary for every transformation and also allows us to have a nicer api. The code matches the conventions of cairo::Matrix (eg the internal representation), but for the API I also checked euclid::Transform2D and resvg's Transform type, and where possible makes things more clear and ergonomic (explicit pre_ and post_ variants for each method, chainable methods). Note: the filters-composite-02-b reftest differs by one pixel, I am assuming this is a rounding issue and hence I am updating the reference image.
* Improve feOffset reftestPaolo Borelli2020-01-012-3/+22
| | | | Cover more cases: zero-offset and no-intersection
* (#408): Don't clip feImage to integer boundsFederico Mena Quintero2019-12-093-0/+0
| | | | | | | | | feImage doesn't do pixel processing, so it is able to use exact floating-point bounds. Thanks to Paolo Borelli for unlocking the solution to this in !262. Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/408
* Consider specificity during matchingFederico Mena Quintero2019-11-112-0/+25
|
* Move the test for #336 to tests/fixtures/crash/Federico Mena Quintero2019-11-111-0/+0
| | | | | | | | This is not an infinite-loop test anymore; those are supposed to catch infinite loops and return FALSE from rsvg_handle_render_cairo(). We don't have tests to catch infinite loops during loading, so for now just move that test file to the load crasher tests.
* Add test case for issue #336Paolo Borelli2019-11-111-0/+7
| | | | This is now fixed with the switch from croco to cssparser
* Cover both variants of @importPaolo Borelli2019-11-103-1/+8
|
* (#525): Consider specificity when applying CSS selector matchesFederico Mena Quintero2019-11-062-0/+27
| | | | | | | We still don't consider ordering of rules in stylesheets, but at least we handle specificity for conflicting matches with this. Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/525
* document: accumulate all the style text before parsing itPaolo Borelli2019-11-032-0/+10
| | | | | | | Fixes a regression introduced in the recent refactoring. While at it, improve the style type attribute parsing so that invalid values are detected during the parsing of attributes. A corresponding test case is included.
* tests: add a test for issue 524Paolo Borelli2019-11-011-0/+9
|
* Merge branch 'namespaces'Federico Mena Quintero2019-10-269-11/+13
|\
| * tests/fixtures/infinite-loop/* - Fix missing namespacesFederico Mena Quintero2019-10-262-2/+2
| |
| * tests/fixtures/errors/*.svg - Add missing namespace declarationsFederico Mena Quintero2019-10-263-3/+3
| |
| * 777155-zero-sized-pattern.svg: Fix invalid namespacesFederico Mena Quintero2019-10-261-3/+5
| | | | | | | | This is also a fuzzed file, where the point was to test a zero-sized pattern.
| * 497-path-with-all-invalid-commands.svg: Remove invalid namespace declarationFederico Mena Quintero2019-10-261-1/+1
| | | | | | | | | | This is a fuzzed file; the point was to test invalid path data, and namespaces are irrelevant for this particular test.
| * 342-use-references-ancestor.svg: Add missing namespace declaration for xlinkFederico Mena Quintero2019-10-261-1/+1
| |
| * 338-zero-sized-image.svg: Add missing namespace declaration for xlinkFederico Mena Quintero2019-10-261-1/+1
| |
* | (#521): Compute geometries correctly if there is a viewBox attributeFederico Mena Quintero2019-10-222-0/+11
|/ | | | | | | | | | Commit a2b34631 broke geometry computation of elements when the toplevel SVG has a viewBox attribute. Every time we change the matrix to draw, we need to retransform the drawings's resulting bbox to the original matrix. Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/521
* Add a test for recursive feImageFederico Mena Quintero2019-10-151-0/+13
|
* (#308): Don't exhaust the stack on recursive <use>Federico Mena Quintero2019-10-154-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | This was not handled properly because our <use> implementation did this: - Acquire the node referenced by <use xlink:href="#foo"/> - Clone the node referene, causing the AcquiredNode to be dropped... - ... so that the node reference is "free" now, outside of the AcquiredNodes stack... - ... so that if the node somehow ends up referencing itself as a clipPath or a mask or something, it will work. I.e. doing cycle detection with our old scheme made the test for 761175-recursive-masks.svg fail, since it <use>s a group which in turn contains a <use href="#foo" mask="#mask-which-uses-foo"/>. With the new cycle detection scheme, only <use> and elements which are referenced indirectly (patterns, gradients, filters, etc.) get put into the AcquiredNodes stack. This seems to find cycles properly while not breaking that particular test. Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/308
* (#515) - Add a limit for the number of loaded elementsFederico Mena Quintero2019-10-112-3/+12
| | | | | | | | | | | | This fixes the last part of #515, an enormous SVG file with millions of elements, which causes out-of-memory. To avoid unbounded memory consumption, we'll set a hard limit on the number of loaded elements. The largest legitimate file I have is a map rendering with about 26K elements; here we set a limit of 200,000 elements for good measure. Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/515
* Add test for the billion-laughs equivalent from issue #515Federico Mena Quintero2019-10-102-3/+144
| | | | | This is billion-laughs, but done with elements inside <pattern>. They in turn reference a fill="url(#next_sublevel_pattern)".
* Remove the 91-nonzero-translation.svg testFederico Mena Quintero2019-09-192-19764/+0
| | | | | | | | This fucking file's rendering frequently changes subtly. I hope I'm not just sticking my head in the ground by deleting it; we already have other tests for things that break when the initial transformation matrix has a translation component, so I *hope* we can safely remove this test.
* (#506): Fix empty patterns which reference a fallback pattern with childrenFederico Mena Quintero2019-09-192-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | When we do draw_ctx.acquired_nodes().get_node_of_type() to acquire a pattern, or its fallback, we need to set the NodePattern.node to the corresponding node weakref. This was being done correctly at the beginning of the implementation of resolve(), as of commit 03cbbe96, where the sequence is this: DrawingCtx.set_source_paint_server() paint_server = acquired_nodes.get_node() <paint_server as NodePattern>.resolve_fallbacks_and_set_pattern() self.resolve(node, ...) *self.node.borrow_mut() = Some(node.downgrade()); However, this setting of self.node (where self is a NodePattern) to the corresponding weakref was missing in the "while" loop in NodePattern.resolve(), where it acquires the fallback pattern - the fallback's NodePattern also needs its .node to be set to its node's weakref. We'll clean this up at some point. Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/506
* Regenerate test reference files with textFederico Mena Quintero2019-08-2662-0/+0
| | | | Freetype changed, once again, the spacing between glyphs...
* (#497): Don't panic on paths with all-invalid commandsFederico Mena Quintero2019-08-171-0/+13
| | | | | | | | | | | The path parser creates a PathBuilder with zero commands. In turn, builder.to_cairo() does nothing, as expected. But then we stroke_and_fill(), and the wrapper call to with_discrete_layer() doesn't like not having bounds. Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/497
* (#494): Fix combination of "x" and "dy" attributes for tspan elementsFederico Mena Quintero2019-08-132-0/+14
| | | | | | | | When computing the positions of spans, the values of the dx/dy attributes need to be added in, not just for the render position of each span, but for the position of the *next* span as well. Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/494
* Add new API rsvg_handle_render_element()Federico Mena Quintero2019-07-301-2/+38
|
* Add new API rsvg_handle_get_geometry_for_element()Federico Mena Quintero2019-07-302-0/+46
|
* Add new API rsvg_handle_render_document()Federico Mena Quintero2019-07-292-0/+53
|
* Add C version of rsvg_handle_render_layer()Federico Mena Quintero2019-07-292-0/+52
|