- 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/ricetest.c
r38356 r38399 8 8 int main (int argc, char **argv) { 9 9 10 plan_tests (64); 10 plan_tests (45); 11 12 diag ("libfits ricetest.c tests"); 11 13 12 14 // buffers to store max array … … 14 16 char cmpdata[NBYTE]; 15 17 char outdata[NBYTE]; 18 19 if (1) { 20 char *rawvalue = (char *) rawdata; 21 char *outvalue = (char *) outdata; 22 23 int j; 24 for (j = 0; j < 5; j++) { 25 int i; 26 for (i = 0; i < NPIX; i++) { 27 rawvalue[i] = i; 28 } 29 30 int Ncmp = fits_rcomp_byte (rawvalue, NPIX, cmpdata, NBYTE, 32); 31 ok (Ncmp > 0, "compressed byte data"); 32 33 int status = fits_rdecomp_byte (cmpdata, Ncmp, outdata, NPIX, 32); 34 ok (!status, "decompressed byte data"); 35 36 int Nbad = 0; 37 for (i = 0; i < NPIX; i++) { 38 if (rawvalue[i] != outvalue[i]) Nbad ++; 39 } 40 41 ok (!Nbad, "values match"); 42 } 43 } 16 44 17 45 if (1) { … … 27 55 28 56 int Ncmp = fits_rcomp_short (rawvalue, NPIX, cmpdata, NBYTE, 32); 29 fprintf (stderr, "Ncmp: %d\n", Ncmp);57 ok (Ncmp > 0, "compressed short data"); 30 58 31 59 int status = fits_rdecomp_short (cmpdata, Ncmp, outdata, NPIX, 32); 32 fprintf (stderr, "status: %d\n", status);60 ok (!status, "decompressed short data"); 33 61 34 62 int Nbad = 0; … … 41 69 } 42 70 43 if ( 0) {71 if (1) { 44 72 int *rawvalue = (int *) rawdata; 45 73 int *outvalue = (int *) outdata; … … 53 81 54 82 int Ncmp = fits_rcomp (rawvalue, NPIX, cmpdata, NBYTE, 32); 55 fprintf (stderr, "Ncmp: %d\n", Ncmp);83 ok (Ncmp > 0, "compressed int data"); 56 84 57 85 int status = fits_rdecomp (cmpdata, Ncmp, outdata, NPIX, 32); 58 fprintf (stderr, "status: %d\n", status);86 ok (!status, "decompressed int data"); 59 87 60 88 int Nbad = 0; … … 62 90 if (rawvalue[i] != outvalue[i]) Nbad ++; 63 91 } 64 65 92 ok (!Nbad, "values match"); 66 93 } 67 94 } 68 exit (0);95 return exit_status(); 69 96 }
Note:
See TracChangeset
for help on using the changeset viewer.
