Changeset 15985 for trunk/psModules/test/objects/tap_pmSourceIO_PS1_DEV_0.c
- Timestamp:
- Jan 2, 2008, 10:45:23 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/objects/tap_pmSourceIO_PS1_DEV_0.c
r15726 r15985 5 5 #include "tap.h" 6 6 #include "pstap.h" 7 /* STATUS: 8 All functions are tested. 9 XX: These tests read/write a file. Must choose a more unique name. 10 */ 7 11 8 12 #define VERBOSE 0 … … 10 14 #define TEST_FLOATS_EQUAL(X, Y) (abs(X - Y) < 0.0001) 11 15 #define NUM_SOURCES 5 16 #define FITS_FILENAME ".tmp00" 12 17 int main(int argc, char* argv[]) 13 18 { … … 20 25 // ---------------------------------------------------------------------- 21 26 // pmSourcesWrite_PS1_DEV_0() tests 22 // bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources,23 // psMetadata *imageHeader, psMetadata *tableHeader, char *extname)24 27 // Call pmSourcesWrite_PS1_DEV_0() with NULL psFits input parameter 25 if (1){26 psMemId id = psMemGetId(); 27 psFits* fitsFile = psFitsOpen( ".tmp00", "w");28 { 29 psMemId id = psMemGetId(); 30 psFits* fitsFile = psFitsOpen(FITS_FILENAME, "w"); 28 31 psArray *sources = psArrayAlloc(NUM_SOURCES); 29 32 for (int i = 0 ; i < sources->n ; i++) { … … 48 51 49 52 // Call pmSourcesWrite_PS1_DEV_0() with NULL pmSource input parameter 50 if (1){51 psMemId id = psMemGetId(); 52 psFits* fitsFile = psFitsOpen( ".tmp00", "w");53 { 54 psMemId id = psMemGetId(); 55 psFits* fitsFile = psFitsOpen(FITS_FILENAME, "w"); 53 56 psArray *sources = psArrayAlloc(NUM_SOURCES); 54 57 for (int i = 0 ; i < sources->n ; i++) { … … 72 75 73 76 // Call pmSourcesWrite_PS1_DEV_0() with NULL extname input parameter 74 if (1){75 psMemId id = psMemGetId(); 76 psFits* fitsFile = psFitsOpen( ".tmp00", "w");77 { 78 psMemId id = psMemGetId(); 79 psFits* fitsFile = psFitsOpen(FITS_FILENAME, "w"); 77 80 psArray *sources = psArrayAlloc(NUM_SOURCES); 78 81 for (int i = 0 ; i < sources->n ; i++) { … … 97 100 // ---------------------------------------------------------------------- 98 101 // pmSourcesRead_PS1_DEV_0() tests 99 // psArray *pmSourcesRead_PS1_DEV_0 (psFits *fits, psMetadata *header)100 //101 102 // Call pmSourcesRead_PS1_DEV_0() with NULL psFits input parameter 102 if (1){103 psMemId id = psMemGetId(); 104 psFits* fitsFile = psFitsOpen( ".tmp00", "r");103 { 104 psMemId id = psMemGetId(); 105 psFits* fitsFile = psFitsOpen(FITS_FILENAME, "r"); 105 106 psMetadata *header = psMetadataAlloc(); 106 107 psArray *array = pmSourcesRead_PS1_DEV_0(NULL, header); … … 113 114 114 115 // Call pmSourcesRead_PS1_DEV_0() with NULL header input parameter 115 if (1){116 psMemId id = psMemGetId(); 117 psFits* fitsFile = psFitsOpen( ".tmp00", "r");116 { 117 psMemId id = psMemGetId(); 118 psFits* fitsFile = psFitsOpen(FITS_FILENAME, "r"); 118 119 psMetadata *header = psMetadataAlloc(); 119 120 psArray *array = pmSourcesRead_PS1_DEV_0(fitsFile, NULL); … … 137 138 #define TEST_BASE_PIX_WEIGHT 90.0 138 139 #define TEST_BASE_PEAK_FLUX 120.0 139 if (1){140 psMemId id = psMemGetId(); 141 psFits* fitsFile = psFitsOpen( ".tmp00", "w");140 { 141 psMemId id = psMemGetId(); 142 psFits* fitsFile = psFitsOpen(FITS_FILENAME, "w"); 142 143 psArray *sources = psArrayAlloc(NUM_SOURCES); 143 144 for (int i = 0 ; i < sources->n ; i++) { … … 187 188 188 189 // Call pmSourcesRead_PS1_DEV_0() with acceptable input parameters 189 if (1){190 psMemId id = psMemGetId(); 191 psFits* fitsFile = psFitsOpen( ".tmp00", "r");190 { 191 psMemId id = psMemGetId(); 192 psFits* fitsFile = psFitsOpen(FITS_FILENAME, "r"); 192 193 psMetadata *header = psMetadataAlloc(); 193 194 psArray *array = pmSourcesRead_PS1_DEV_0(fitsFile, header);
Note:
See TracChangeset
for help on using the changeset viewer.
