Commit Graph

54 Commits (efffd21c3692df73ebaa146823386a2db057c125)

Author SHA1 Message Date
Pierre Joye efffd21c36 Merge from 2.3 2021-09-11 23:38:22 +07:00
Pierre Joye 228eee9af6 restore logic 2021-08-29 01:09:58 +07:00
Pierre Joye 10cd1fdf82 too early return 2021-08-28 11:46:59 +07:00
Pierre Joye 60ac1286ee windows logic 2021-08-28 11:34:54 +07:00
Pierre Joye 5c6dcd1648 don't attempt to create it, fall back to /tmp on linux/mingw like 2021-08-28 11:20:13 +07:00
Pierre Joye 9e02f64325 fix linux variants mkdstemp 2021-08-28 11:11:44 +07:00
Pierre Joye 9f597cb6d9 fix windows build 2021-08-28 10:52:19 +07:00
Pierre Joye 87ac6fdd02 fix linux/macos build 2021-08-28 15:41:42 +07:00
Pierre Joye 33ade122c1 don't use gdTestAssert in these functions, we are not testing them. Proper null return and avoid random segv if environment is not setup correctly 2021-08-28 14:25:40 +07:00
Pierre Joye 6c38955d73 for the tests, it seems mingw can fail too often to find/create the tmpidr, let default it to ./tmp and fail if it cannot be created/used 2021-08-28 12:00:04 +07:00
Pierre Joye 0482d7a7e9 MINGW32 or MINGW64 2021-08-28 11:39:13 +07:00
Pierre Joye 6b5946fea0 Mingw support, and refactor a bit gdTest on Windows, simplifies 2021-08-27 18:16:19 +07:00
willson-chen 2874546a44 update gdtest.c to support msys (#528)
* config.h is never generated in msys with existing windows/msys/Makefile
* errno.h is to solve EEXIST is not defined error
* GDTEST_TOP_DIR is defined in other compile ways except msys and test_config.h is created by windows/msys/run_test.sh
* Ui64 is only created by microsoft by not support in windows and ULL is common used and general supported
* _int64 is only support by vc but __int64 can be support in win
2019-10-28 01:14:47 -06:00
Mike Frysinger a91cb62f01 add stub ABI funcs when formats are disabled #345
We do this for some funcs already, so add jpeg/png/tiff/liq/webp
stubs too.  This keeps our ABI stable and lets code do runtime
detection instead.
2019-02-09 13:16:57 -05:00
Mike Frysinger fd06f7f83c clean up trailing whitespace/newlines
This is preparation for adding some linting checks for new commits from
people.  Shouldn't be any functional changes here (tests still pass!).
2018-06-21 22:47:42 -04:00
Christoph M. Becker 794e884705 Fix memory leak in gdTestImageCompareToImage()
We also have to destroy `surface_diff`, if there are pixel differences.
2017-09-02 22:14:54 +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 8d63621487 tests: fix out-of-tree runs with relative images
When we build out-of-tree, the gdTestImageFromPng logic will be passed a
fully constructed relative path using existing test helpers.  Don't try
to create a relative path on top of the relative path as the result will
be invalid.
2016-07-21 20:49:27 +05:30
Mike Frysinger ae2eea3de3 tests: add missing newlines to error messages 2016-07-21 20:52:06 +05:30
Mike Frysinger 7d04b45481 tests: drop test_config.h
This header provides a single define: GDTEST_TOP_DIR.  Move it to the
build CPPFLAGS instead since it's a path var and that's the recommended
way of handling these (by autotools standards), and it simplifies the
build overall.  It also harmonizes the autotool & cmake build paths.

We localize this define to the gdtest/ subdir as we don't want any of
the other tests using the path.  We have gdtest helpers instead.
2016-07-21 20:25:29 +05:30
Christoph M. Becker 5a8139faae No need to print the message argument of _gdTestAssertMsg() 2016-07-20 18:31:28 +02:00
Pierre Joye 1561a21a84 WS 2016-07-17 16:57:20 +07:00
Pierre Joye 32e3d2a21c Merge branch 'master' of github.com:libgd/libgd 2016-07-12 17:30:50 +07:00
Pierre Joye 76e7490711 #249, fix use of given temporary file name to be created in the tmpdir on windows 2016-07-12 17:30:04 +07:00
Ondřej Surý 80b0884bcc Don't free NULL fp when image doesn't exist in gdTestImageFromPng 2016-07-12 12:09:20 +02:00
Pierre Joye 102ed54bba #249 fix gdtest for windows paths 2016-07-12 15:53:00 +07:00
Pierre Joye 5bc1b232b0 port gdTestTempFile and gdTestTempDir to windows 2016-07-12 12:02:14 +07:00
Pierre Joye ddd30d73a4 implement clean_dir on windows 2016-07-11 16:53:58 +07:00
Pierre Joye 81dc18cd6d fix bad merge 2016-06-15 10:00:27 +07:00
Pierre Joye e22448e6dd Merge branch 'GD-2.2'
* GD-2.2:
  fix #227 drop usage of GD_BILINEAR_FIXED and GD_BICUBIC_FIXED for gdImageRotateInterpolated, the quality does not match expectation. It is also trickier to maintain for little gain. The generic method is used and will be optimized for 2.3 to match fixed pt performance, if necessary. Also use png for comparison to avoid jpeg artifact, making impossible to exactly  compare results
  fix #227 drop usage of GD_BILINEAR_FIXED and GD_BICUBIC_FIXED for gdImageRotateInterpolated, the quality does not match expectation. It is also trickier to maintain for little gain. The generic method is used and will be optimized for 2.3 to match fixed pt performance, if necessary. Also use png for comparison to avoid jpeg artifact, making impossible to exactly  compare results
  fix #227 drop usage of GD_BILINEAR_FIXED and GD_BICUBIC_FIXED for gdImageRotateInterpolated, the quality does not match expectation. It is also trickier to maintain for little gain. The generic method is used and will be optimized for 2.3 to match fixed pt performance, if necessary. Also use png for comparison to avoid jpeg artifact, making impossible to exactly  compare results
  WS
  #230 fix crash on fail
  gdTestAssert should not accept any message. Also crashes if assert failed

Conflicts:
	tests/gdimagerotate/bug00067.c
	tests/gdtest/gdtest.c
2016-06-15 09:53:28 +07:00
Pierre Joye 46b23c189a gdTestAssert should not accept any message. Also crashes if assert failed 2016-06-14 20:16:39 +07: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 703f847420 tests: clean up GDTEST_STRING_MAX usage
This static buffer size is rarely used, and when it is, it isn't
necessary.  Clean up the few places using it and punt it.
2016-06-03 20:18:11 -04:00
pierre 5bf8b8fed9 calc diff and store the max diff for a channel 2016-06-04 00:17:36 +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
Mike Frysinger 75c38f6b32 fix various gcc/clang warnings found with -Wall 2016-05-13 22:19:26 -04:00
Nathanael Jones 56f79f3749 C89 compat; define vars at top of function 2015-01-07 01:39:10 -05:00
Nathanael Jones 90c37990d2 Add gdTestAssertMsg(condition, formatmessage, variables) to support detailed failure messages.
Improve error reporting and diagnostics in gdimagefile test.
Fix 'max' definition conflict on some compilers.
2014-10-02 13:30:57 -04:00
Chris Reuter 65fce84a50 Improved testing code
Assertions in gdtest.c do nothing on failure except print a message.
This change also makes them keep a count of failures which can be
retrieved with the function 'gdNumFailures()', making it easy to
return an error status if an assertion condition fails.

Also added gdMaxPixelDiff(), a function to return the largest
difference between two corresponding pixels.  Used to detect pixels
that are similar except for a little color change.
2013-10-09 21:24:57 -04:00
Ondřej Surý bbb506eeaf Remove extra file, line from rewritten _gdTestErrorMsg 2013-05-28 10:26:06 +02:00
Ondřej Surý 6cc113c88a Fix warning: C++ style comments are not allowed in ISO C90 [enabled by default] 2013-05-22 10:42:40 +02:00
Takeshi Abe b9ff2c3661 silence -Wunused-variable 2013-05-07 14:51:27 +09:00
Ondřej Surý e5dcee5ddf gdErrorMethod declaration was wrong, we need to pass rest of the arguments in va_list 2013-04-23 11:01:57 +02:00
Ondřej Surý be262a9197 Cleanup gdtest functions to actually report usefull information. 2013-04-22 18:32:13 +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
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
tabe 7c51c9b063 fix -Wreturn-type 2013-02-11 12:12:41 +09:00
tabe c18dfcd3cd fix -Wunused-variable 2013-02-11 11:41:52 +09:00
tabe 3aaf1ab557 fix -Wunused-parameter 2013-02-11 11:31:40 +09:00