summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* jpeg: Limit the memory size when loading image dataEmmanuele Bassi2022-08-093-0/+37
| | | | | | | | | | | | | | Specially crafted JPEG images may lead to a crash when their size is too large; in the most benign of cases, the OS might terminate the process after it tries to allocate all the memory in the world. We can tell libjpeg to limit the size of the memory pool when loading, to avoid this kind of result. For the time being, 100 MB seems like a good threshold. Original patch by: Sam Ezeh <sam.z.ezeh@gmail.com> Fixes: #205
* Add tests for GIF files with invalid LZW code sizesRobert Ancell2022-02-029-0/+35
|
* Fix test GIF that was broken in the LZW code size, not the values of the pixelsRobert Ancell2022-02-021-0/+0
|
* Disable TAP for testsEmmanuele Bassi2021-04-061-2/+1
| | | | | | | | | Sadly, GTest intercepts debugging messages and prints them as they are; this means that multi-line messages will inevitably break the TAP protocol. GLib 2.68 has started printing out a long g_debug() message on Windows, which ends up failing the whole test suite on the MSYS2 CI jobs.
* Meson: Disable tests that needs resources on WindowsXavier Claessens2021-01-291-1/+5
| | | | | To be working on Windows we need to fix meson gnome module first: https://github.com/mesonbuild/meson/issues/8266.
* Pass glib-compile-resources's path to gen-resources.pyEmmanuele Bassi2021-01-041-46/+40
| | | | | | Since the gen-resources.py needs to call glib-compile-resources, we need to figure out where the binary is, and tell gen-resources.py to use that, instead of relying on it being in the PATH.
* Skip resource tests with glib subprojectmacos-ciMatthias Clasen2021-01-031-38/+46
| | | | It doesn't work.
* Merge branch 'wip/run-gif-tests-again' into 'master'Simon McVittie2020-12-141-26/+24
|\ | | | | | | | | Run GIF tests again, and fix regression for short reads See merge request GNOME/gdk-pixbuf!95
| * tests: Don't check whether bmp and gif loaders are enabledwip/run-gif-tests-againSimon McVittie2020-12-121-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This is conceptually similar to commit 2fd7d21f "tests: Fix GIF tests being permanently disabled". One way or another, gdk-pixbuf always supports these two formats: on Windows with the native gdiplus loader enabled, it covers these two formats; otherwise, format-specific loaders are used. This means we will run the GIF tests, as intended. Fixes: 7f0b214a "tests: Conditionally build and run tests" Signed-off-by: Simon McVittie <smcv@debian.org>
| * build: Do not install .test files when test is skippedwip/jtojnar/no-install-skipped-testJan Tojnar2020-12-081-22/+23
| | | | | | | | | | | | | | | | The skipping prevented the executable from being installed but not the .test file that referenced it. This caused installed tests to fail: Running test: gdk-pixbuf/pixbuf-pixdata.test Caught exception during testing: Failed to execute child process ?/nix/store/kqmj2776mw24qxyswfbqlmybpws4g4yn-gdk-pixbuf-2.42.0-installedTests/libexec/installed-tests/gdk-pixbuf/pixbuf-pixdata? (No such file or directory)
* | tests: Fix some memory leaksSimon McVittie2020-12-121-1/+3
|/ | | | | | | | | This is enough to make many of the tests pass under gcc's AddressSanitizer. pixbuf-randomly-modified still fails when it cannot allocate more memory, and pixbuf-fail fails with memory allocation errors unless run with ASAN_OPTIONS=allocator_may_return_null=1. Signed-off-by: Simon McVittie <smcv@debian.org>
* gif: Fix LZW decoder accepting invalid LZW code.Robert Ancell2020-12-081-0/+0
| | | | | | | | | The code value after a reset wasn't being validated, which means we would accept invalid codes. This could cause an infinite loop in the decoder. Fixes CVE-2020-29385 Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/164
* tests: Fix GIF tests being permanently disabledRobert Ancell2020-11-241-1/+0
| | | | GIF support is always built in.
* tests: Replace g_assert with g_assert_trueRobert Ancell2020-11-241-2/+2
| | | | The former can be disabled at build time.
* tests: Fix checking of GIF frame delaysRobert Ancell2020-11-241-13/+1
|
* Fix GIF tests broken due to a typo.Robert Ancell2020-11-241-1/+1
| | | | Regression introduced in e3adcf0c86dbd56b01d0d55f29a95065cbd95eb8.
* Remove the libjasper-based JPEG2000 loaderEmmanuele Bassi2020-06-263-2/+0
| | | | | | | | | | | | | | | | | Libjasper is not really maintained any more, and has been dropped by various Linux distributions over the years. GdkPixbuf has not enabled the JPEG2000 loader by default in many years, relying on downstream distributors to do so if they also shipped libjasper. This means that it's unlikely anybody has relied on GdkPixbuf to load a JPEG2000 image for the past 3 to 5 years, if at all. The only other option for loading JPEG2000 images is to use OpenJPEG, and for that there is an out of tree GdkPixbuf module available: https://notabug.org/necklace/jp2-pixbuf-loader Fixes: #152, #137
* tests: check for mmap failureTobias Mueller2020-06-101-1/+6
| | | | | | mmap does not return NULL on failure, but rather MAP_FAILED. https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/158
* tests: Add test for issue 70Bastien Nocera2020-04-021-0/+34
| | | | | Add test for the issue fixed by commit 35dcd72bbe7a9349861ff14389a38525fe9c949f.
* tests: Add test file for issue 70Bastien Nocera2020-04-022-1/+2
| | | | From https://bugs.launchpad.net/inkscape/+bug/1746054/comments/5
* tests: Conditionally build and run testsEmmanuele Bassi2020-04-021-95/+147
| | | | | | | | Some tests depend on build options—like the ability to load certain images. There's no point in compiling things that we know will fail, so might as well skip them. Fixes: #123
* tests: Skip composite test when PNG is unsupportedEmmanuele Bassi2020-04-021-0/+7
|
* tests: Skip tests when the ref format is unsupportedEmmanuele Bassi2020-04-021-1/+9
| | | | | We must skip the reference test when both the source and reference files are unsupported.
* tests: Skip GIF test when the format is not supportedEmmanuele Bassi2020-04-021-0/+6
| | | | | There's no point in failing the test when we know we don't support the file format.
* tests: install circular-table.gifRoss Burton2019-11-251-0/+1
| | | | | | This test data was added for the pixbuf-gif-circular-table test (added October 2018 in 0b9d004) but because the file was never actually installed the installed test suite never passes.
* (#91): Have a STORAGE_UNINITIALIZED for construction with all-default propertiesFederico Mena Quintero2019-09-112-0/+108
| | | | | | | | | | | | | | | | | | | If one does a plain GdkPixbuf *pixbuf = g_object_new (GDK_TYPE_PIXBUF, NULL); Then all the construct properties use their default values. This means that both "pixels" and "pixel-bytes" get passed as NULL to gdk_pixbuf_set_property(). Later, trying to get the property for "pixel-bytes" would assert, incorrectly, because it was trying to create a GBytes from a NULL pixels storage. This commit adds a test for that construction case, and tests for constructing with g_object_new() in general. Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues/91
* tests: Disable deprecation warnings for GTimeValEmmanuele Bassi2019-07-292-0/+2
|
* Remove uses of g_memmove()Emmanuele Bassi2019-06-291-1/+1
| | | | | | | | | There's no reason to use g_memmove() instead of memmove(). The `g_memmove()` wrapper was a symbol internal to GLib between 2004 and 2013, when it was exposed as a plain C pre-processor symbol around C90's memmove(). Starting from GLib 2.61, using g_memmove() is going to raise a deprecation warning from the compiler.
* tests: Add test image for invalid XPM dataBastien Nocera2019-03-012-0/+68
|
* tests: Add test for issue 95Bastien Nocera2019-03-011-0/+34
| | | | A laaaarge XPM file.
* tests: Add test for a PNG crasherBastien Nocera2019-02-271-0/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=793470
* gif: Add "Circular table entry" failing GIF image test caseRobert Ancell2019-01-163-0/+25
| | | | An example image that generates the "Circular table entry in GIF file" error.
* gif: Fix multiple LZW clear codes breaking decodingRobert Ancell2019-01-161-2/+2
| | | | | | | | | | | | | | | | The following was occurring: 1. A clear code is detected in the LZW stream 2. The first code is detected as a clear. 3. The following code is returned as a color index, this breaks if it is a clear. There were two codepaths in use, one for handling the first clear in the LZW sequence and another for handling clears within the sequence. The former handled sequential clears correctly, the latter did not. The solution is to the correct codepath and remove the other one. This simplification should not affect other decoding (as confirmed by the test suite).
* gif: Fix off by one error in LZW decoderRobert Ancell2019-01-161-2/+2
| | | | | | | | | | | | | | | | | The following was occurring: 1. Code words would be read from the LZW data blocks. 2. If there was exactly enough space for one more codeword in the block, more blocks were read. This is the off by one error. It should have read the last code before doing this. 3. If the next block was the terminating block the code would be marked as complete. 4. Another block would be attempted to be read, because the decoder was still in the same state as step 2. 5. An error was generated because the decoder was trying to read blocks after it had determined the stream had ended. This fixes the GIF decoder failing to decode images without an end-of-information code.
* tests: Add comprehensive GIF test suiteRobert Ancell2019-01-16226-0/+1558
| | | | | | | | | Add tests that exert many different types of GIF files. Some of the tests are disabled as the current gdk-pixbuf GIF implementation doesn't handle them correctly. Future commits will fix these issues and enable the tests. The test suite is generated in the PyGIF project (https://github.com/robert-ancell/pygif)
* tests: Don't depend on mime type detection without GDK_PIXBUF_USE_GIO_MIMEChristoph Reiter2018-12-114-16/+54
| | | | | | | When building without GDK_PIXBUF_USE_GIO_MIME detect the format based on the fill extension and not the mime type. This makes these tests pass on Windows.
* tests/pixbuf-reftest: Work around broken symlinks on WindowsChristoph Reiter2018-12-111-0/+22
| | | | | | | | When cloning the repo with git on Windows the symlinks end up being normal files which contain the target path as text. Make this kinda work by detecting if the files contain ascii only and then treating the content as a filename in the parent directory.
* tests/pixbuf-threads: use g_fopen instead of fopen and force binary modeChristoph Reiter2018-12-111-1/+2
| | | | | | | So we use the right path encoding on Windows and don't interpret the content as text. This makes the pixbuf-threads run on Windows.
* Add pixbuf-fail to the slow tests suiteEmmanuele Bassi2018-06-291-1/+1
| | | | | | It already takes about 20 seconds on my Core i7, and it can get worse when running multiple tests in parallel, so it's a prime candidate for timeouts on our CI infrastructure.
* tests: Add test for bug 775229Bastien Nocera2018-06-293-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=775229
* Merge branch 'ci-test' into 'master'Emmanuele Bassi2018-06-011-22/+33
|\ | | | | | | | | Run the test suite on the CI pipeline See merge request GNOME/gdk-pixbuf!7
| * Classify the test suiteci-testEmmanuele Bassi2018-05-241-22/+33
| | | | | | | | | | | | | | | | Meson allows us to classify each test in the test suite using one or more tags; this allows us to specify what kind of tests we want to run inside our CI infrastructure, for instance by tagging the "slow" tests that should have a special time out value, or that should only be run on demand to avoid hammering the build server.
* | Add test image for issue 58Emmanuele Bassi2018-05-301-0/+0
|/
* Drop Autotools buildEmmanuele Bassi2018-04-301-215/+0
| | | | | | We use Meson, now. The Meson build has been tested for almost a year in our continuous integration pipeline, and it's functionally equivalent to the Autotools one.
* meson: Add option for installing testsEmmanuele Bassi2018-04-291-4/+6
| | | | | | Like the Autotools build allows us to decide whether the tests should be installed in a known location, we should have this option for the Meson build.
* meson: Install bug753605-atsize.jpgEmmanuele Bassi2018-04-251-0/+1
| | | | | Same as commit fc2d02ed908c524cc2831e5404d5f06b02e3f9fd, but for the Meson build.
* tests: distribute test file for bug 753605 testJeremy Bicha2018-04-251-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=795210
* meson: Install tests and test dataEmmanuele Bassi2018-04-251-61/+71
| | | | | | | | We're currently installing the test launchers and parts of the test data, but we're not installing the binaries and the whole suite of image data we have. https://bugzilla.gnome.org/show_bug.cgi?id=795527
* tests: Add test for bug 779016Bastien Nocera2017-12-051-0/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=779016
* tests: Add test for bug 753605Bastien Nocera2017-12-052-0/+23
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=753605