Commit Graph

47 Commits (master)

Author SHA1 Message Date
Pierre Joye 8074c82046 fix warning 2021-09-10 04:51:57 +07:00
wilson chen b1151dedb1
tests: Correct some test depend errors 2020-01-02 20:27:29 +08:00
Christoph M. Becker 553702980a Fix #492: Potential double-free in gdImage*Ptr()
Whenever `gdImage*Ptr()` calls `gdImage*Ctx()` and the latter fails, we
must not call `gdDPExtractData()`; otherwise a double-free would
happen.  Since `gdImage*Ctx()` are void functions, and we can't change
that for BC reasons, we're introducing static helpers which are used
internally.

We're adding a regression test for `gdImageJpegPtr()`, but not for
`gdImageGifPtr()` and `gdImageWbmpPtr()` since we don't know how to
trigger failure of the respective `gdImage*Ctx()` calls.

This potential security issue has been reported by Solmaz Salimi (aka.
Rooney).
2019-01-17 11:54:55 +01:00
Mike Frysinger aac77143dd convert all files to native line encodings
A bunch of these files were committed with Windows line encodings.
Strip all those ^M gremlins out as people working on Windows can
use git's autocrlf setting to convert back and forth as needed.
2018-06-21 21:44:54 -04:00
Christoph M. Becker 3b8a69cfe5 Merge branch 'pull-request/346' 2017-08-27 17:45:20 +02: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 fea55903ee Fix #338: Fatal and normal libjpeg/ibpng errors not distinguishable
libgd clients need to be able to distinguish between fatal and
"extremely fatal" libjpeg and libpng errors, because in the former case
execution can proceed, but in the latter case libgd calls exit().
Therefore we report fatal errors as GD_WARNING.
2016-11-16 18:10:29 +01:00
Pierre Joye 0f3eb3125d use test api 2016-07-17 16:57:50 +07:00
Christoph M. Becker 284bbdd85f Remove useless SVN Ids 2016-07-15 16:34:47 +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 cad672775d tests: cmake: move feature tests to subdirs
This makes it better match the autotools which makes it easier to
compare, and allows finer grain checks (since some subtests need
more than one feature test).

As an example, this makes it clear we were missing gdinterpolatedscale.
2016-06-15 14:53:42 -04:00
Mike Frysinger d6c50766ee tests: add helpers for accessing test data
A lot of tests want to read images/fonts that exist in tests/ for reading.
Rather than construct these paths by hand in every single test file, add a
few helper functions to quickly access them.

The helper functions are slightly slower (due to the repeated calls to the
strcat func), but they aren't terribly slow, especially relative to image
loading that these tests perform.  They also make writing/maintaining the
tests a lot easier which is more important here.
2016-06-03 20:31:02 -04:00
Mike Frysinger cff640c687 tests: add bug_github_18 to gitignore #18 2016-06-03 20:10:41 -04:00
Mike Frysinger c7c7e23a39 tests: fix typo in test name #18 2016-06-03 13:46:54 -04:00
Pierre Joye e5b6616de0 #18 add exp and src images 2016-06-04 00:32:15 +07:00
Pierre Joye 7fad13a913 Fix #18 Poor maximum jpeg quality 2016-06-04 00:20:08 +07: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
David Drysdale 05d70f6a07 tests: fix leaks in test code
Ensure all images etc. are freed so that we can enable leak checking
across the tests and not get any false positives.
2016-05-01 01:45:48 -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
Takeshi Abe b9ff2c3661 silence -Wunused-variable 2013-05-07 14:51:27 +09:00
Pierre Joye ba8f21afb5 skip if jpeg version >= 8 2013-05-03 09:08:47 +02:00
Ondřej Surý 9cde91e567 Debug output improvements in gdimageline/gdimageline_aa.c and jpeg/jpeg_read.c 2013-04-26 09:20:14 +02:00
Pierre Joye 59947a81f7 fix build on win 2013-04-24 08:35:27 +02:00
Ondřej Surý 35ce262dd4 One more gdTestAssert return value check 2013-04-22 23:15:45 +02:00
Ondřej Surý 73cab5d8af Use gdtest helper functions in jpeg/jpeg_read.c 2013-04-22 18:32:32 +02:00
Ondřej Surý 83f5b748c3 Make tests less chatty; silence them using our shiny new gdSetErrorMethod 2013-04-22 17:16:44 +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 e428d819b7 drop obsolete .cvsignore 2013-02-07 14:33:54 +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
tabe 267042ad67 fixed memory leaks. 2009-03-13 03:37:49 +00:00
tabe f40454c1b3 ref FS#176: added support of variable resolution by Alan Boudreault. 2009-03-08 09:16:04 +00:00
tabe f8c54a6fd4 get a test executable' location from its target property. 2009-01-07 15:12:31 +00:00
tabe be219b1a8b revert to the previous revision, as EXECUTABLE_OUTPUT_PATH enabled again. 2009-01-06 15:45:49 +00:00
tabe e4c8a57338 fixed the executable paths. 2009-01-04 10:28:36 +00:00
pajoye 3ea7765187 - add Makefile.am (to be packaged when used with auto*) 2008-05-10 20:19:28 +00:00
pajoye b406d91158 - fix tests running under MinGW
- jpeg and freetpye (2.3.5) compiled under mingw seems to behaves differently.
    jpeg_read and freetype/bug00132 tests fail. I will have to investigate later
2008-04-18 14:32:10 +00:00
pajoye 9bf4f83bf3 - mv src/tests tests 2007-10-02 09:01:53 +00:00