Changeset 38427
- Timestamp:
- Jun 8, 2015, 11:01:33 AM (11 years ago)
- Location:
- branches/eam_branches/ohana.20150429/src
- Files:
-
- 6 edited
-
dvomerge/src/dvomergeUpdate_catalogs.c (modified) (1 diff)
-
libdvo/src/dvo_catalog_split.c (modified) (7 diffs)
-
libfits/Makefile (modified) (1 diff)
-
libfits/extern/gzip.c (modified) (4 diffs)
-
libfits/test/imagecomp.c (modified) (1 diff)
-
libfits/test/zlib.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/dvomerge/src/dvomergeUpdate_catalogs.c
r38421 r38427 176 176 177 177 // if no catalog already exists, use the input catalog to define the format or the specified format 178 if (outcatalog.Naverage_disk == 0) { 179 if (UPDATE_CATFORMAT) { 180 outcatalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT); 181 } else { 182 outcatalog.catformat = incatalog.catformat; 183 } 184 if (UPDATE_CATCOMPRESS) { 185 outcatalog.catcompress = dvo_catalog_catcompress (UPDATE_CATCOMPRESS); 186 } else { 187 outcatalog.catcompress = incatalog.catcompress; 188 } 178 if (UPDATE_CATFORMAT) { 179 outcatalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT); 180 } else { 181 outcatalog.catformat = incatalog.catformat; 182 } 183 if (UPDATE_CATCOMPRESS) { 184 outcatalog.catcompress = dvo_catalog_catcompress (UPDATE_CATCOMPRESS); 185 } else { 186 outcatalog.catcompress = incatalog.catcompress; 189 187 } 190 188 -
branches/eam_branches/ohana.20150429/src/libdvo/src/dvo_catalog_split.c
r38422 r38427 884 884 885 885 // write out Measure table 886 catalog->measure_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 886 887 if (!dvo_catalog_save_subcat (catalog[0].measure_catalog, &ftable, start, Nrows, catalog[0].Nmeasure_disk, Nmeasure_disk_new)) { 887 888 fprintf (stderr, "trouble writing Measure table\n"); … … 910 911 911 912 // write out Missing table (must write out entire table) 913 catalog->missing_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 912 914 if (!dvo_catalog_save_subcat (catalog[0].missing_catalog, &ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing)) { 913 915 fprintf (stderr, "trouble writing Missing Table\n"); … … 942 944 943 945 // write out SecFilt table 946 catalog->secfilt_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 944 947 if (!dvo_catalog_save_subcat (catalog[0].secfilt_catalog, &ftable, start, Nrows, catalog[0].Nsecfilt_disk, Nsecfilt_disk_new)) { 945 948 fprintf (stderr, "failure writing SecFilt table\n"); … … 972 975 973 976 // write out Lensing table 977 catalog->lensing_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 974 978 if (!dvo_catalog_save_subcat (catalog[0].lensing_catalog, &ftable, start, Nrows, catalog[0].Nlensing_disk, Nlensing_disk_new)) { 975 979 fprintf (stderr, "trouble writing Lensing table\n"); … … 1002 1006 1003 1007 // write out Lensobj table 1008 catalog->lensobj_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1004 1009 if (!dvo_catalog_save_subcat (catalog[0].lensobj_catalog, &ftable, start, Nrows, catalog[0].Nlensobj_disk, Nlensobj_disk_new)) { 1005 1010 fprintf (stderr, "trouble writing Lensobj table\n"); … … 1032 1037 1033 1038 // write out StarPar table 1039 catalog->starpar_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1034 1040 if (!dvo_catalog_save_subcat (catalog[0].starpar_catalog, &ftable, start, Nrows, catalog[0].Nstarpar_disk, Nstarpar_disk_new)) { 1035 1041 fprintf (stderr, "trouble writing StarPar table\n"); … … 1062 1068 1063 1069 // write out GalPhot table 1070 catalog->galphot_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1064 1071 if (!dvo_catalog_save_subcat (catalog[0].galphot_catalog, &ftable, start, Nrows, catalog[0].Ngalphot_disk, Ngalphot_disk_new)) { 1065 1072 fprintf (stderr, "trouble writing GalPhot table\n"); -
branches/eam_branches/ohana.20150429/src/libfits/Makefile
r38426 r38427 27 27 28 28 29 TESTXTRA = zlibtcomptiming30 TESTPROG = imagecomp tablecomp ricetest29 TESTXTRA = tcomptiming 30 TESTPROG = zlib ricetest imagecomp tablecomp 31 31 $(TESTPROG) : % : $(TESTBIN)/% 32 32 $(TESTXTRA) : % : $(TESTBIN)/% -
branches/eam_branches/ohana.20150429/src/libfits/extern/gzip.c
r38342 r38427 119 119 # define ESCAPE(RET) { fprintf (stderr, "gzip error in %s @ %s:%d\n", __func__, __FILE__, __LINE__); return (RET); } 120 120 121 // NOTE: CFITSIO uses gzip format, not just zlib 122 int gfits_uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) 123 { 121 int gfits_compress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) { 122 124 123 z_stream stream; 125 124 int i, err; … … 130 129 /* Check for source > 64K on 16-bit machine: */ 131 130 if ((uLong)stream.avail_in != sourceLen) ESCAPE (Z_BUF_ERROR); 132 131 133 132 stream.next_out = dest; 134 stream.avail_out = (uInt)*destLen; 133 stream.avail_out = (uInt)*destLen; // allocated space 135 134 if ((uLong)stream.avail_out != *destLen) ESCAPE (Z_BUF_ERROR); 136 135 137 136 stream.zalloc = Z_NULL; 138 137 stream.zfree = Z_NULL; 139 138 stream.opaque = Z_NULL; 140 141 if (EXTRA_VERBOSE) {142 fprintf (stderr, "inp unc: ");143 for (i = 0; i < sourceLen; i++) {144 fprintf (stderr, "0x%02hhx ", source[i]);145 }146 fprintf (stderr, "\n");147 }148 149 // a value of 32 tells inflate to use the window size used in the compression AND to look for both zlib and gzip headers150 err = inflateInit2(&stream, 32);151 if (err != Z_OK) ESCAPE (err);152 153 err = inflate(&stream, Z_FINISH);154 if (err != Z_STREAM_END) {155 inflateEnd(&stream);156 if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) ESCAPE (Z_DATA_ERROR);157 ESCAPE(err);158 }159 160 if (EXTRA_VERBOSE) {161 fprintf (stderr, "out unc: ");162 for (i = 0; i < stream.total_out; i++) {163 fprintf (stderr, "0x%02hhx ", dest[i]);164 }165 fprintf (stderr, "\n");166 }167 168 assert (stream.total_out <= *destLen);169 *destLen = stream.total_out;170 171 err = inflateEnd(&stream);172 return err;173 }174 175 int gfits_compress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)176 {177 z_stream stream;178 int i, err;179 180 stream.next_in = (Bytef*)source;181 stream.avail_in = (uInt)sourceLen;182 183 /* Check for source > 64K on 16-bit machine: */184 if ((uLong)stream.avail_in != sourceLen) ESCAPE (Z_BUF_ERROR);185 186 stream.next_out = dest;187 stream.avail_out = (uInt)*destLen; // allocated space188 if ((uLong)stream.avail_out != *destLen) ESCAPE (Z_BUF_ERROR);189 190 stream.zalloc = Z_NULL;191 stream.zfree = Z_NULL;192 stream.opaque = Z_NULL;193 139 194 140 if (EXTRA_VERBOSE) { … … 203 149 // NOTE: cfitsio uses a fixed value of 1 204 150 // I am using deflateInit2 because cfitsio expects gzip, not just zlib 151 // windowBits = 31 = (15 + 16) = (2^15 window bits) + (create a gzip stream) 205 152 err = deflateInit2(&stream, 1, Z_DEFLATED, 31, 8, Z_DEFAULT_STRATEGY); 206 153 if (0) fprintf (stderr, "inp buffers cmp 0: %d => %d => %d\n", stream.avail_in, stream.avail_out, (int) stream.total_out); … … 230 177 return err; 231 178 } 179 180 // NOTE: CFITSIO uses gzip format, not just zlib 181 int gfits_uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) { 182 183 z_stream stream; 184 int i, err; 185 186 stream.next_in = (Bytef*)source; 187 stream.avail_in = (uInt)sourceLen; 188 189 /* Check for source > 64K on 16-bit machine: */ 190 if ((uLong)stream.avail_in != sourceLen) ESCAPE (Z_BUF_ERROR); 191 192 stream.next_out = dest; 193 stream.avail_out = (uInt)*destLen; 194 if ((uLong)stream.avail_out != *destLen) ESCAPE (Z_BUF_ERROR); 195 196 stream.zalloc = Z_NULL; 197 stream.zfree = Z_NULL; 198 stream.opaque = Z_NULL; 199 200 if (EXTRA_VERBOSE) { 201 fprintf (stderr, "inp unc: "); 202 for (i = 0; i < sourceLen; i++) { 203 fprintf (stderr, "0x%02hhx ", source[i]); 204 } 205 fprintf (stderr, "\n"); 206 } 207 208 // windowBits = 47 = (15 + 32) = (2^15 window bits) + (test for either gzip or zlib 209 // streams). NOTE: modern versions of zlib (version > 1.2.3.4) allow for windowBits = 0 210 // (or 16 or 32) to use the compressed stream windowBits value. IPP cluster still has 211 // zlib version = 1.2.3, so we cannot use this feature. 212 err = inflateInit2(&stream, 47); 213 if (err != Z_OK) ESCAPE (err); 214 215 err = inflate(&stream, Z_FINISH); 216 if (err != Z_STREAM_END) { 217 inflateEnd(&stream); 218 if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) ESCAPE (Z_DATA_ERROR); 219 ESCAPE(err); 220 } 221 222 if (EXTRA_VERBOSE) { 223 fprintf (stderr, "out unc: "); 224 for (i = 0; i < stream.total_out; i++) { 225 fprintf (stderr, "0x%02hhx ", dest[i]); 226 } 227 fprintf (stderr, "\n"); 228 } 229 230 assert (stream.total_out <= *destLen); 231 *destLen = stream.total_out; 232 233 err = inflateEnd(&stream); 234 return err; 235 } 236 -
branches/eam_branches/ohana.20150429/src/libfits/test/imagecomp.c
r38418 r38427 11 11 int bitpix[] = {8, 16, 32, -32, -64, 0}; 12 12 13 // char *cmptype[] = {"NONE_2", NULL};14 // int bitpix[] = {16, 0};13 //char *cmptype[] = {"GZIP_1", NULL}; 14 //int bitpix[] = {16, 0}; 15 15 16 16 static int NX = 10; -
branches/eam_branches/ohana.20150429/src/libfits/test/zlib.c
r38404 r38427 1 # include <stdio.h> 2 # include <stdlib.h> 3 # include <string.h> 4 # include <assert.h> 1 # include <ohana.h> 2 # include <gfitsio.h> 5 3 # include <zlib.h> 6 4 # include "tap_ohana.h" 5 6 # define VERBOSE 0 7 7 # define NSRC 10 8 8 # define NTGT 20 … … 18 18 int main (int argc, char **argv) { 19 19 20 plan_tests (7); 21 22 diag ("libfits zlib.c tests"); 23 24 diag ("zlib version: %s", ZLIB_VERSION); 25 diag ("zlib vernum: %x", ZLIB_VERNUM); 26 20 27 int i, err; 21 28 double srcbuf[NSRC], tgtbuf[NTGT], outbuf[NOUT]; … … 41 48 } 42 49 43 # ifdef VERBOSE44 50 char *rawdata = (char *) srcbuf; 45 fprintf (stderr, "inp: ");46 for (i = 0; i < NSRC*8; i++) {51 if (VERBOSE) fprintf (stderr, "inp: "); 52 for (i = 0; VERBOSE && (i < NSRC*8); i++) { 47 53 fprintf (stderr, "0x%02hhx ", rawdata[i]); 48 54 } 49 fprintf (stderr, "\n"); 50 # endif 55 if (VERBOSE) fprintf (stderr, "\n"); 51 56 52 57 // the '5' is the compression level: make this a user argument 53 58 err = deflateInit(&zdn, 5); 54 //fprintf (stderr, "inp buffers cmp 0: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out);55 if (err != Z_OK) { fprintf (stdout, "not ok: error 1: %d vs %d\n", err, Z_OK); exit (1); }59 if (VERBOSE) fprintf (stderr, "inp buffers cmp 0: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out); 60 ok (err == Z_OK, "result is Z_OK: %d vs %d", err, Z_OK); 56 61 57 62 err = deflate(&zdn, Z_FINISH); 58 // fprintf (stderr, "out buffers cmp 1: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out); 59 if (err != Z_STREAM_END) { fprintf (stdout, "not ok: error 2: %d vs %d\n", err, Z_STREAM_END); exit (2); } 60 // fprintf (stderr, "out buffers cmp 2: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out); 63 if (VERBOSE) fprintf (stderr, "out buffers cmp 1: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out); 64 ok (err == Z_STREAM_END, "result is Z_STREAM_END: %d vs %d", err, Z_STREAM_END); 61 65 62 66 // dump out the data which failed to uncompress (and the input data) 63 # ifdef VERBOSE64 67 char *cmpdata = (char *) tgtbuf; 65 fprintf (stderr, "out: ");66 for (i = 0; i < zdn.total_out; i++) {68 if (VERBOSE) fprintf (stderr, "out: "); 69 for (i = 0; VERBOSE && (i < zdn.total_out); i++) { 67 70 fprintf (stderr, "0x%02hhx ", cmpdata[i]); 68 71 } 69 fprintf (stderr, "\n"); 70 # endif 71 72 assert (zdn.total_out <= NTGT*sizeof(double)); 73 74 // fprintf (stderr, "result: %d bytes\n", (int) zdn.total_out); 75 // for (i = 0; i < zdn.total_out / sizeof(double); i++) { 76 // fprintf (stderr, "%d : 0x%02hhx\n", i, tgtbuf[i]); 77 // } 72 if (VERBOSE) fprintf (stderr, "\n"); 73 74 ok (zdn.total_out <= NTGT*sizeof(double), "output compressed size is good"); 75 76 if (VERBOSE) fprintf (stderr, "result: %d bytes\n", (int) zdn.total_out); 77 for (i = 0; VERBOSE && (i < zdn.total_out / sizeof(double)); i++) { 78 fprintf (stderr, "%d : 0x%02hhx\n", i, tgtbuf[i]); 79 } 78 80 } 79 81 … … 91 93 // the '5' is the compression level: make this a user argument 92 94 err = inflateInit(&zup); 93 //fprintf (stderr, "out buffers unc 0: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out);94 if (err != Z_OK) { fprintf (stdout, "not ok: error 1: %d vs %d\n", err, Z_OK); exit (1); }95 if (VERBOSE) fprintf (stderr, "out buffers unc 0: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out); 96 ok (err == Z_OK, "result is Z_OK: %d vs %d", err, Z_OK); 95 97 96 98 err = inflate(&zup, Z_FINISH); 97 // fprintf (stderr, "out buffers unc 1: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out); 98 if (err != Z_STREAM_END) { fprintf (stderr, "error 2: %d vs %d\n", err, Z_STREAM_END); exit (2); } 99 // fprintf (stderr, "out buffers unc 2: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out); 100 101 # ifdef VERBOSE 99 if (VERBOSE) fprintf (stderr, "out buffers unc 1: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out); 100 ok (err == Z_STREAM_END, "result is Z_STREAM_END: %d vs %d", err, Z_STREAM_END); 101 102 102 char *outdata = (char *) outbuf; 103 fprintf (stderr, "unc: ");104 for (i = 0; i < zup.total_out; i++) {103 if (VERBOSE) fprintf (stderr, "unc: "); 104 for (i = 0; VERBOSE && (i < zup.total_out); i++) { 105 105 fprintf (stderr, "0x%02hhx ", outdata[i]); 106 106 } 107 fprintf (stderr, "\n"); 108 # endif 109 110 assert (zup.total_out <= NTGT*sizeof(double)); 111 112 // fprintf (stderr, "result: %d bytes\n", (int) zup.total_out); 107 if (VERBOSE) fprintf (stderr, "\n"); 108 109 ok (zup.total_out <= NTGT*sizeof(double), "uncompressed size is good"); 110 111 int Nbad = 0; 113 112 for (i = 0; 0 && i < zup.total_out / sizeof(double); i++) { 114 // fprintf (stderr, "%d : %f : %f\n", i, outbuf[i], srcbuf[i]); 115 assert (outbuf[i] == srcbuf[i]); 116 } 117 } 118 119 return exit_status(); 120 } 121 122 int main_old (int argc, char **argv) { 123 124 int i, err; 125 char srcbuf[NSRC], tgtbuf[NTGT], outbuf[NTGT]; 126 113 if (outbuf[i] != srcbuf[i]) Nbad++; 114 } 115 ok (Nbad == 0, "no mismatched bytes"); 116 } 117 118 /**** TEST 2 : use gzip headers ****/ 127 119 { 128 120 z_stream zdn; 129 zdn.next_in = srcbuf;130 zdn.avail_in = NSRC ;131 zdn.next_out = tgtbuf;132 zdn.avail_out = NTGT ;121 zdn.next_in = (char *) srcbuf; 122 zdn.avail_in = NSRC * sizeof(double); 123 zdn.next_out = (char *) tgtbuf; 124 zdn.avail_out = NTGT * sizeof(double); 133 125 134 126 zdn.zalloc = Z_NULL; … … 136 128 zdn.opaque = Z_NULL; 137 129 138 for (i = 0; i < NSRC; i++) srcbuf[i] = i; 139 memset (tgtbuf, 0, NTGT); 140 memset (outbuf, 0, NTGT); 130 for (i = 0; i < NSRC; i++) srcbuf[i] = 1.001*(i + 10); 131 memset (tgtbuf, 0, NTGT * sizeof(double)); 132 memset (outbuf, 0, NOUT * sizeof(double)); 133 134 for (i = 0; i < NSRC; i++) { 135 char *Pout = (char *) &srcbuf[i]; 136 SWAP_DBLE; 137 } 138 139 char *rawdata = (char *) srcbuf; 140 if (VERBOSE) fprintf (stderr, "inp: "); 141 for (i = 0; VERBOSE && (i < NSRC*8); i++) { 142 fprintf (stderr, "0x%02hhx ", rawdata[i]); 143 } 144 if (VERBOSE) fprintf (stderr, "\n"); 141 145 142 146 // the '5' is the compression level: make this a user argument 143 err = deflateInit(&zdn, 5); 144 if (err != Z_OK) { fprintf (stderr, "error 1: %d vs %d\n", err, Z_OK); exit (1); } 147 // windowBits = 31 = (15 + 16) = (2^15 window bits) + (create a gzip stream) 148 err = deflateInit2(&zdn, 1, Z_DEFLATED, 31, 8, Z_DEFAULT_STRATEGY); 149 if (VERBOSE) fprintf (stderr, "inp buffers cmp 0: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out); 150 ok (err == Z_OK, "result is Z_OK: %d vs %d", err, Z_OK); 145 151 146 152 err = deflate(&zdn, Z_FINISH); 147 if (err != Z_STREAM_END) { fprintf (stderr, "error 2: %d vs %d\n", err, Z_STREAM_END); exit (2); } 148 149 assert (zdn.total_out <= NTGT); 150 151 fprintf (stderr, "result: %d bytes\n", (int) zdn.total_out); 152 for (i = 0; i < zdn.total_out; i++) { 153 if (VERBOSE) fprintf (stderr, "out buffers cmp 1: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out); 154 ok (err == Z_STREAM_END, "result is Z_STREAM_END: %d vs %d", err, Z_STREAM_END); 155 156 // dump out the data which failed to uncompress (and the input data) 157 char *cmpdata = (char *) tgtbuf; 158 if (VERBOSE) fprintf (stderr, "out: "); 159 for (i = 0; VERBOSE && (i < zdn.total_out); i++) { 160 fprintf (stderr, "0x%02hhx ", cmpdata[i]); 161 } 162 if (VERBOSE) fprintf (stderr, "\n"); 163 164 ok (zdn.total_out <= NTGT*sizeof(double), "output compressed size is good"); 165 166 if (VERBOSE) fprintf (stderr, "result: %d bytes\n", (int) zdn.total_out); 167 for (i = 0; VERBOSE && (i < zdn.total_out / sizeof(double)); i++) { 153 168 fprintf (stderr, "%d : 0x%02hhx\n", i, tgtbuf[i]); 154 169 } … … 157 172 { 158 173 z_stream zup; 159 zup.next_in = tgtbuf;160 zup.avail_in = NTGT ;161 zup.next_out = outbuf;162 zup.avail_out = N TGT;174 zup.next_in = (char *) tgtbuf; 175 zup.avail_in = NTGT * sizeof(double); 176 zup.next_out = (char *) outbuf; 177 zup.avail_out = NOUT * sizeof(double); 163 178 164 179 zup.zalloc = Z_NULL; … … 166 181 zup.opaque = Z_NULL; 167 182 168 // the '5' is the compression level: make this a user argument 169 err = inflateInit(&zup); 170 if (err != Z_OK) { fprintf (stderr, "error 1: %d vs %d\n", err, Z_OK); exit (1); } 183 // a value of 32 tells inflate to use the window size used in the compression AND to look for both zlib and gzip headers 184 // windowBits = 47 = (15 + 32) = (2^15 window bits) + (test for either gzip or zlib streams) 185 err = inflateInit2(&zup, 47); 186 if (VERBOSE) fprintf (stderr, "out buffers unc 0: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out); 187 ok (err == Z_OK, "inflateInit2 result is Z_OK: %d vs %d", err, Z_OK); 171 188 172 189 err = inflate(&zup, Z_FINISH); 173 if (err != Z_STREAM_END) { fprintf (stderr, "error 2: %d vs %d\n", err, Z_STREAM_END); exit (2); } 174 175 assert (zup.total_out <= NTGT); 176 177 fprintf (stderr, "result: %d bytes\n", (int) zup.total_out); 178 for (i = 0; i < zup.total_out; i++) { 179 fprintf (stderr, "%d : 0x%02hhx : 0x%02hhx\n", i, outbuf[i], srcbuf[i]); 180 assert (outbuf[i] == srcbuf[i]); 181 } 182 } 190 if (VERBOSE) fprintf (stderr, "out buffers unc 1: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out); 191 ok (err == Z_STREAM_END, "inflate result is Z_STREAM_END: %d vs %d", err, Z_STREAM_END); 192 193 char *outdata = (char *) outbuf; 194 if (VERBOSE) fprintf (stderr, "unc: "); 195 for (i = 0; VERBOSE && (i < zup.total_out); i++) { 196 fprintf (stderr, "0x%02hhx ", outdata[i]); 197 } 198 if (VERBOSE) fprintf (stderr, "\n"); 199 200 ok (zup.total_out <= NTGT*sizeof(double), "uncompressed size is good"); 201 202 int Nbad = 0; 203 for (i = 0; 0 && i < zup.total_out / sizeof(double); i++) { 204 if (outbuf[i] != srcbuf[i]) Nbad++; 205 } 206 ok (Nbad == 0, "no mismatched bytes"); 207 } 208 183 209 return exit_status(); 184 210 }
Note:
See TracChangeset
for help on using the changeset viewer.
