- Timestamp:
- Jun 5, 2015, 7:58:50 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/test/zlib.c
r38334 r38399 41 41 } 42 42 43 # ifdef VERBOSE 43 44 char *rawdata = (char *) srcbuf; 44 45 fprintf (stderr, "inp: "); … … 47 48 } 48 49 fprintf (stderr, "\n"); 50 # endif 49 51 50 52 // the '5' is the compression level: make this a user argument 51 53 err = deflateInit(&zdn, 5); 52 fprintf (stderr, "inp buffers cmp 0: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out);54 // fprintf (stderr, "inp buffers cmp 0: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out); 53 55 if (err != Z_OK) { fprintf (stderr, "error 1: %d vs %d\n", err, Z_OK); exit (1); } 54 56 55 57 err = deflate(&zdn, Z_FINISH); 56 fprintf (stderr, "out buffers cmp 1: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out);58 // fprintf (stderr, "out buffers cmp 1: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out); 57 59 if (err != Z_STREAM_END) { fprintf (stderr, "error 2: %d vs %d\n", err, Z_STREAM_END); exit (2); } 58 fprintf (stderr, "out buffers cmp 2: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out);60 // fprintf (stderr, "out buffers cmp 2: %d => %d => %d\n", zdn.avail_in, zdn.avail_out, (int) zdn.total_out); 59 61 60 62 // dump out the data which failed to uncompress (and the input data) 63 # ifdef VERBOSE 61 64 char *cmpdata = (char *) tgtbuf; 62 65 fprintf (stderr, "out: "); … … 65 68 } 66 69 fprintf (stderr, "\n"); 70 # endif 67 71 68 72 assert (zdn.total_out <= NTGT*sizeof(double)); 69 73 70 fprintf (stderr, "result: %d bytes\n", (int) zdn.total_out);74 // fprintf (stderr, "result: %d bytes\n", (int) zdn.total_out); 71 75 // for (i = 0; i < zdn.total_out / sizeof(double); i++) { 72 76 // fprintf (stderr, "%d : 0x%02hhx\n", i, tgtbuf[i]); … … 87 91 // the '5' is the compression level: make this a user argument 88 92 err = inflateInit(&zup); 89 fprintf (stderr, "out buffers unc 0: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out);93 // fprintf (stderr, "out buffers unc 0: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out); 90 94 if (err != Z_OK) { fprintf (stderr, "error 1: %d vs %d\n", err, Z_OK); exit (1); } 91 95 92 96 err = inflate(&zup, Z_FINISH); 93 fprintf (stderr, "out buffers unc 1: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out);97 // fprintf (stderr, "out buffers unc 1: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out); 94 98 if (err != Z_STREAM_END) { fprintf (stderr, "error 2: %d vs %d\n", err, Z_STREAM_END); exit (2); } 95 fprintf (stderr, "out buffers unc 2: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out);99 // fprintf (stderr, "out buffers unc 2: %d => %d => %d\n", zup.avail_in, zup.avail_out, (int) zup.total_out); 96 100 101 # ifdef VERBOSE 97 102 char *outdata = (char *) outbuf; 98 103 fprintf (stderr, "unc: "); … … 101 106 } 102 107 fprintf (stderr, "\n"); 108 # endif 103 109 104 110 assert (zup.total_out <= NTGT*sizeof(double)); 105 111 106 fprintf (stderr, "result: %d bytes\n", (int) zup.total_out);112 // fprintf (stderr, "result: %d bytes\n", (int) zup.total_out); 107 113 for (i = 0; 0 && i < zup.total_out / sizeof(double); i++) { 108 fprintf (stderr, "%d : %f : %f\n", i, outbuf[i], srcbuf[i]);114 // fprintf (stderr, "%d : %f : %f\n", i, outbuf[i], srcbuf[i]); 109 115 assert (outbuf[i] == srcbuf[i]); 110 116 } 111 117 } 112 113 exit (0); 118 return exit_status(); 114 119 } 115 120 … … 175 180 } 176 181 } 177 178 exit (0); 182 return exit_status(); 179 183 }
Note:
See TracChangeset
for help on using the changeset viewer.
