summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2022-11-13 16:23:21 +0100
committerEven Rouault <even.rouault@spatialys.com>2022-11-21 23:23:23 +0100
commit21d7dac23f44697c43fb9155c8e746678f0c2a68 (patch)
tree8e19cd580f0a8d6b4a784c6c89b98b8abfbb333a /test
parent352c1a7d03cb12f5bc18d116da6b8c1ab5a281d7 (diff)
downloadlibtiff-git-21d7dac23f44697c43fb9155c8e746678f0c2a68.tar.gz
Rework TIFFOpenExt() and similar to use an opaque TIFFOpenOptions* opts argument, with alloc, free and setters
Diffstat (limited to 'test')
-rw-r--r--test/test_error_handlers.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/test_error_handlers.c b/test/test_error_handlers.c
index 56faa29e..d1ba0587 100644
--- a/test/test_error_handlers.c
+++ b/test/test_error_handlers.c
@@ -80,14 +80,12 @@ int test_open_ext(int handlers_set_in_open)
TIFF* tif;
if( handlers_set_in_open )
{
- TIFFOpenExtStruct arguments = {
- .version = 1,
- .errorhandler = myErrorHandler,
- .errorhandler_user_data = &errorhandler_user_data,
- .warnhandler = myErrorHandler,
- .warnhandler_user_data = &warnhandler_user_data
- };
- tif = TIFFOpenExt("test_error_handler.tif", "w", &arguments);
+ TIFFOpenOptions* opts = TIFFOpenOptionsAlloc();
+ assert(opts);
+ TIFFOpenOptionsSetErrorHandlerExtR(opts, myErrorHandler, &errorhandler_user_data);
+ TIFFOpenOptionsSetWarningHandlerExtR(opts, myErrorHandler, &warnhandler_user_data);
+ tif = TIFFOpenExt("test_error_handler.tif", "w", opts);
+ TIFFOpenOptionsFree(opts);
}
else
{