summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSu_Laus <sulau@freenet.de>2020-02-29 17:59:59 +0100
committerSu_Laus <sulau@freenet.de>2020-02-29 17:59:59 +0100
commit30222c13d66545b6e3a278059117be104cf341cd (patch)
tree649036df4a0ee6ffd1196c31941f2acd7b5e9279 /test
parentd04e3d26c51fea7e074d4a8234e88797a5c03a7d (diff)
downloadlibtiff-git-30222c13d66545b6e3a278059117be104cf341cd.tar.gz
tif_dirwrite.c: bugfix DoubleToSrational(), which returns plain signed interger values always as unsigned rationals.
Add a test into rational_precision2double.c for "-1.0" and some editorials in tif_dirwrite.c. (code is related to 6df997c786928757caea0dd68d26ea5f098f49df changes).
Diffstat (limited to 'test')
-rw-r--r--test/rational_precision2double.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/rational_precision2double.c b/test/rational_precision2double.c
index 782fb9fa..e33cc97d 100644
--- a/test/rational_precision2double.c
+++ b/test/rational_precision2double.c
@@ -498,7 +498,8 @@ write_test_tiff(TIFF* tif, const char* filenameRead, int blnAllCustomTags) {
fprintf(stderr, "Can't set TIFFTAG_RATIONAL_DOUBLE tag.\n");
goto failure;
}
- if (!TIFFSetField(tif, TIFFTAG_SRATIONAL_DOUBLE, (-1.0 * auxDoubleArrayW[101]))) {
+ /* test for plain integers */
+ if (!TIFFSetField(tif, TIFFTAG_SRATIONAL_DOUBLE, (-1.0 ))) {
fprintf(stderr, "Can't set TIFFTAG_SRATIONAL_DOUBLE tag.\n");
goto failure;
}
@@ -764,7 +765,7 @@ write_test_tiff(TIFF* tif, const char* filenameRead, int blnAllCustomTags) {
auxDblUnion.dbl = 0;
retCode = TIFFGetField(tif, TIFFTAG_SRATIONAL_DOUBLE, &auxDblUnion.dbl);
if (!retCode) { fprintf(stderr, "Can't read %s\n", "TIFFTAG_SRATIONAL_DOUBLE"); GOTOFAILURE }
- auxDouble = -1.0 * auxDoubleArrayW[101];
+ auxDouble = -1.0;
dblDiffLimit = RATIONAL_EPS * auxDouble;
dblDiff = auxDblUnion.dbl - auxDouble;
if (fabs(dblDiff) > fabs(dblDiffLimit)) {