Commit Graph

27 Commits (master)

Author SHA1 Message Date
wilson chen 08238a0ac2 Fix some memory leakage in test cases
Fix the memory leakage in following test cases: tests/bug_overflow_lagre_new_size.c, tests/gdimagecrop/bug00486.c, tests/bmp/bug00450.c
2020-03-21 10:59:33 +08:00
wilson chen b1151dedb1
tests: Correct some test depend errors 2020-01-02 20:27:29 +08:00
Romain DÉOUX d0859134fc Fix #450: Failed to open 1 bit per pixel bitmap
For 1 bit per pixel bitmap images, when the width of the image match
some specific values (for instance, 10px), the image loading fails.
2018-12-31 19:45:21 +01:00
Mike Frysinger c4ee95d1a4 tests: clean up various buffers/objects
These tests aren't broken because they didn't free the buffers, but
by cleaning these up, it's safe to run the testsuite through the leak
sanitizer (LSAN) to detect real leaks in the rest of the library.

See the previous commit 98b3f04b21 as
an example of LSAN being useful.
2018-06-21 21:22:31 -04:00
Mike Frysinger fdbd8df682 add underscores around attributes
We use __attribute__ instead of attribute everywhere to avoid namespace
issues, so make sure we use the same style for the attribute options too.
2018-01-25 21:51:03 -05:00
Mike Frysinger 00bbb69cc3 tests: add more checks for libpng (and other deps)
This fixes #382.
2017-02-23 17:31:41 -05:00
Mike Frysinger 12a0f039b3 tests: sync feature enable lists in cmake files #382 2017-02-15 11:14:25 -05:00
Christoph M. Becker 92991d1630 Fix issue #276: Sometimes pixels are missing when storing images as BMPs
That happens only when RLE is applied. The culprit is in compress_row(),
where the rightmost pixels which wouldn't be run-length encoded were
ignored; instead we now add them uncompressed to the `row`.
2016-07-24 23:45:28 +02:00
Christoph M. Becker cc6d20b36f Revert "Fix issue #276: Sometimes pixels are missing when storing images as BMPs"
This reverts commit b355a7f392, because
the test case is broken and has to be fixed.
2016-07-24 23:19:19 +02:00
Christoph M. Becker b355a7f392 Fix issue #276: Sometimes pixels are missing when storing images as BMPs
That happens only when RLE is applied. The culprit is in compress_row(),
where the rightmost pixels which wouldn't be run-length encoded were
ignored; instead we now add them uncompressed to the `row`.
2016-07-24 23:02:33 +02:00
Christoph M. Becker 272c06b4d9 Include tests/bmp/bug00275 in automake toolchain 2016-07-24 15:48:59 +02:00
Christoph M. Becker 497ba7fc3c Fix issue #275: gdImageBmpCtx() may segfault for non-seekable contexts
We must not check for `compression == 1`, but more generally for
`compression`. Furthermore we improve the related documentation.
2016-07-24 15:37:28 +02:00
Christoph M. Becker e210ff1149 Partially implement #220: tests: replace all printf error messages with gdTestErrorMsg 2016-07-15 14:59:21 +02:00
Mike Frysinger 3bb6aac422 tests: cmake: switch to list appending
This makes it a bit cleaner when dealing with optional tests as we
use the LIST(APPEND...) command everywhere instead of sometimes SET
and sometimes LIST.
2016-06-15 15:02:13 -04:00
Mike Frysinger 10a4915114 tests: rework handling of temp output files
Many of the tests open files in local paths for writing which leaves a
variety of temp files in the tests subdirs.  This ends up failing in a
few scenarios like out of tree builds or cmake builds.

Add a few helper functions to the common gdtest module to quickly get
handles to temp files for the tests to leverage.
2016-05-17 23:32:16 -04:00
Mike Frysinger 0315e441ec tests: gd2: add general read test helpers #208
Since we have random files we want to read & check, turn the two
read programs into general tools.  Then we have shell scripts to
run against the right inputs.

Most of the changes here are just shuffling variable names so we
can add to check_PROGRAMS independently of TESTS.
2016-04-30 21:52:45 -04:00
Mike Frysinger 613e8c93e3 tests: split up makefile entries
This matches what we've done with cmake files, and it makes managing
the subdirs much easier.
2016-04-30 21:02:45 -04:00
Mike Frysinger adc8598dcb tests: unify cmake test code into a single macro
This makes the test code a lot easier to manage rather than copying &
pasting the same boiler plate multiple times.

Also take the opportunity to add a common prefix to each test name so
we don't get collisions between subdirs if a test happens to use the
same exact name.
2016-04-30 21:02:45 -04:00
Mike Frysinger 4c6a07b263 gitignore: split up test entries
This makes it easier to keep track of things.  The single toplevel list
can make it hard to notice when something is stale.
2016-04-30 13:56:19 -04:00
Nathanael Jones b52b9c5579 Upgrade to long-syntax CMAKE add_test command to improve cross-platform compatibility. 2015-01-07 01:39:10 -05:00
Pierre Joye b6b19412b5 fix test build, missing gd_lib, TODO: run tests twice for static and shared builds (as they are done at the same time by default) 2013-04-24 07:51:17 +02:00
Ondřej Surý ac6222f945 Merge outstanding autotools changes 2013-04-08 09:12:06 +02:00
pierrejoye e20413bf6b - apply same CS everywhere 2013-04-03 14:23:11 +02:00
Takeshi Abe 804e369b49 search GD headers locally at first
at least for gcc's cpp: http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
2013-03-01 16:53:11 +09:00
Takeshi Abe 63da42ea82 GDTESTS_TARGET_LINK is just gdTest 2013-02-22 11:20:30 +09:00
tabe 53d6320309 fixed possible segfaults when gdNewDynamicCtx() returns null 2009-06-25 19:05:45 +00:00
tabe e27c3c7f2c fix for FS#204
* gdImageCreateFrom*() returns null if null pointer given
* gdImage*() puts nothing if null pointer given
2009-06-18 13:35:26 +00:00