diff --git a/contrib/libtests/pngimage.c b/contrib/libtests/pngimage.c index 442b2f430..c44dd77cb 100644 --- a/contrib/libtests/pngimage.c +++ b/contrib/libtests/pngimage.c @@ -36,6 +36,15 @@ # include /* because png.h did *not* include this */ #endif +/* 1.6.1 added support for the configure test harness, which uses 77 to indicate + * a skipped test, in earlier versions we need to succeed on a skipped test, so: + */ +#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +# define SKIP 77 +#else +# define SKIP 0 +#endif + #if defined(PNG_INFO_IMAGE_SUPPORTED) && defined(PNG_SEQUENTIAL_READ_SUPPORTED)\ && (defined(PNG_READ_PNG_SUPPORTED) || PNG_LIBPNG_VER < 10700) /* If a transform is valid on both read and write this implies that if the @@ -1682,6 +1691,6 @@ int main(void) { fprintf(stderr, "pngimage: no support for png_read/write_image\n"); - return 77; + return SKIP; } #endif diff --git a/contrib/libtests/pngstest.c b/contrib/libtests/pngstest.c index d70871b28..996c87153 100644 --- a/contrib/libtests/pngstest.c +++ b/contrib/libtests/pngstest.c @@ -26,6 +26,15 @@ # include #endif +/* 1.6.1 added support for the configure test harness, which uses 77 to indicate + * a skipped test, in earlier versions we need to succeed on a skipped test, so: + */ +#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +# define SKIP 77 +#else +# define SKIP 0 +#endif + /* Define the following to use this test against your installed libpng, rather * than the one being built here: */ @@ -3470,7 +3479,7 @@ main(int argc, char **argv) # ifdef PNG_STDIO_SUPPORTED opts |= USE_FILE; # else - return 77; /* skipped: no support */ + return SKIP; /* skipped: no support */ # endif else if (strcmp(arg, "--memory") == 0) opts &= ~USE_FILE; @@ -3478,7 +3487,7 @@ main(int argc, char **argv) # ifdef PNG_STDIO_SUPPORTED opts |= USE_STDIO; # else - return 77; /* skipped: no support */ + return SKIP; /* skipped: no support */ # endif else if (strcmp(arg, "--name") == 0) opts &= ~USE_STDIO; @@ -3764,6 +3773,6 @@ int main(void) { fprintf(stderr, "pngstest: no read support in libpng, test skipped\n"); /* So the test is skipped: */ - return 77; + return SKIP; } #endif /* PNG_SIMPLIFIED_READ_SUPPORTED */ diff --git a/contrib/libtests/pngunknown.c b/contrib/libtests/pngunknown.c index eb8d6ad3b..915033ea8 100644 --- a/contrib/libtests/pngunknown.c +++ b/contrib/libtests/pngunknown.c @@ -30,6 +30,16 @@ # include "../../png.h" #endif +/* 1.6.1 added support for the configure test harness, which uses 77 to indicate + * a skipped test, in earlier versions we need to succeed on a skipped test, so: + */ +#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +# define SKIP 77 +#else +# define SKIP 0 +#endif + + /* Since this program tests the ability to change the unknown chunk handling * these must be defined: */ @@ -1260,7 +1270,7 @@ main(void) fprintf(stderr, " test ignored: no support to find out about unknown chunks\n"); /* So the test is skipped: */ - return 77; + return SKIP; } #endif /* READ_USER_CHUNKS || SAVE_UNKNOWN_CHUNKS */ @@ -1271,6 +1281,6 @@ main(void) fprintf(stderr, " test ignored: no support to modify unknown chunk handling\n"); /* So the test is skipped: */ - return 77; + return SKIP; } #endif /* SET_UNKNOWN_CHUNKS && READ*/ diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index a32b21f2c..c82c269fd 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -62,10 +62,10 @@ /* 1.6.1 added support for the configure test harness, which uses 77 to indicate * a skipped test, in earlier versions we need to succeed on a skipped test, so: */ -#if PNG_LIBPNG_VER < 10601 -# define SKIP 0 -#else +#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) # define SKIP 77 +#else +# define SKIP 0 #endif /* pngvalid requires write support and one of the fixed or floating point APIs. diff --git a/pngtest.c b/pngtest.c index 95b918a9a..041a454ab 100644 --- a/pngtest.c +++ b/pngtest.c @@ -43,6 +43,15 @@ #include "png.h" +/* 1.6.1 added support for the configure test harness, which uses 77 to indicate + * a skipped test, in earlier versions we need to succeed on a skipped test, so: + */ +#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H) +# define SKIP 77 +#else +# define SKIP 0 +#endif + /* Known chunks that exist in pngtest.png must be supported or pngtest will fail * simply as a result of re-ordering them. This may be fixed in 1.7 * @@ -2065,7 +2074,7 @@ main(void) fprintf(STDERR, " test ignored because libpng was not built with read support\n"); /* And skip this test */ - return PNG_LIBPNG_VER < 10600 ? 0 : 77; + return SKIP; } #endif