IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 2, 2008, 10:53:30 AM (18 years ago)
Author:
gusciora
Message:

Modified file reads to look for dataFiles and then ../dataFiles.
Other additions as well.
First version: tap_pmReadoutFake.c
First version: tap_pmReadoutStack.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/camera/tap_pmFPAFlags.c

    r14882 r15987  
    55#include "tap.h"
    66#include "pstap.h"
    7 // XXX: Use better name for the temporary FITS file
    8 // XXX: The code to generate and free the FPA hierarchy was copied from
    9 // tap-pmFPA.c.  EIther include it directly, or library, or something.
    10 // Also, get rid of the manual free functions and use psFree() once
    11 // it correctly frees child members
     7/* STATUS
     8    TESTED:
     9        pmFPASetFileStatus()
     10        pmChipSetFileStatus()
     11        pmCellSetFileStatus()
     12
     13        pmFPACheckFileStatus()
     14        pmChipCheckFileStatus()
     15        pmCellCheckFileStatus()
     16
     17        pmFPASetDataStatus()
     18        pmChipSetDataStatus()
     19        pmCellSetDataStatus()
     20
     21        pmFPACheckDataStatus()
     22        pmChipCheckDataStatus()
     23        pmCellCheckDataStatus()
     24        pmReadoutCheckDataStatus()
     25    MUST TEST:
     26        pmFPAviewCheckDataStatus()
     27        pmFPASelectChip()
     28        pmChipSelectCell()
     29        pmFPAExcludeChip()
     30        pmChipExcludeCell()
     31*/
     32
    1233// XXX: For the genSimpleFPA() code, add IDs to each function so that
    1334// the values set in each chip-?cell-?hdu-?image are unique
     
    82103    cell->hdu = pmHDUAlloc("cellExtName");
    83104    for (int i = 0 ; i < NUM_READOUTS ; i++) {
    84         cell->readouts->data[i] = generateSimpleReadout(cell);
    85     }
    86 
    87     bool rc = pmConfigFileRead(&cell->hdu->format, "data/camera0/format0.config", "Camera format 0");
     105        cell->readouts->data[i] = psMemDecrRefCounter((psPtr) generateSimpleReadout(cell));
     106    }
     107
     108    bool rc = pmConfigFileRead(&cell->hdu->format, "dataFiles/camera0/format0.config", "Camera format 0");
    88109    if (!rc) {
    89         diag("pmConfigFileRead() was unsuccessful (from generateSimpleCell())");
     110        rc = pmConfigFileRead(&cell->hdu->format, "../dataFiles/camera0/format0.config", "Camera format 0");
     111        if (!rc) {
     112            diag("pmConfigFileRead() was unsuccessful (from generateSimpleCell())");
     113        }
    90114    }
    91115
     
    103127
    104128    //XXX: Should the region be set some other way?  Like through the various config files?
    105 //    psRegion *region = psRegionAlloc(0.0, TEST_NUM_COLS-1, 0.0, TEST_NUM_ROWS-1);
    106129    psRegion *region = psRegionAlloc(0.0, 0.0, 0.0, 0.0);
    107130    // You shouldn't have to remove the key from the metadata.  Find out how to simply change the key value.
     
    123146    psMetadataAddS32(chip->analysis, PS_LIST_HEAD, MISC_NAME, 0, NULL, MISC_NUM);
    124147    psMetadataAddS32(chip->concepts, PS_LIST_HEAD, MISC_NAME, 0, NULL, MISC_NUM);
    125 //    chip->hdu = pmHDUAlloc("chipExtName");
    126 //
    127 //    bool rc = pmConfigFileRead(&chip->hdu->format, "data/camera0/format0.config", "Camera format 0");
    128 //    if (!rc) {
    129 //        diag("pmConfigFileRead() was unsuccessful (from generateSimpleChip())");
    130 //    }
    131 //
    132148    psArrayRealloc(chip->cells, NUM_CELLS);
    133149    for (int i = 0 ; i < NUM_CELLS ; i++) {
    134         chip->cells->data[i] = generateSimpleCell(chip);
     150        chip->cells->data[i] = psMemDecrRefCounter((psPtr) generateSimpleCell(chip));
    135151    }
    136152
     
    154170    psMetadataAddS32((psMetadata *) fpa->camera, PS_LIST_HEAD, MISC_NAME, 0, NULL, MISC_NUM);
    155171    psMetadataAddS32(fpa->concepts, PS_LIST_HEAD, MISC_NAME, 0, NULL, MISC_NUM);
    156 //    fpa->hdu = pmHDUAlloc("fpaExtName");
    157 //
    158 //    bool rc = pmConfigFileRead(&fpa->hdu->format, "data/camera0/format0.config", "Camera format 0");
    159 //    if (!rc) {
    160 //        diag("pmConfigFileRead() was unsuccessful (from generateSimpleFPA())");
    161 //    }
    162 
    163172    psArrayRealloc(fpa->chips, NUM_CHIPS);
    164173    for (int i = 0 ; i < NUM_CHIPS ; i++) {
    165         fpa->chips->data[i] = generateSimpleChip(fpa);
     174        fpa->chips->data[i] = psMemDecrRefCounter((psPtr) generateSimpleChip(fpa));
    166175    }
    167176
     
    169178    // reading code from wherever.
    170179    pmConceptsBlankFPA(fpa);
    171 //    bool mdok;
    172 //    psMetadata *fileData = psMetadataLookupMetadata(&mdok, fpa->hdu->format, "FILE");
    173 //    char *fpaNameHdr = psMetadataLookupStr(&mdok, fileData, "FPA.NAME");
    174 //    psMetadataAddStr(fpa->concepts, PS_LIST_TAIL, "FPA.NAME", PS_META_REPLACE, NULL, fpaNameHdr);
    175 
    176180    return(fpa);
    177181}
    178182
    179 // XXX: This should only be necessary until the psFree() functions for
    180 // FPA/chip/cell/readout correctly free all child chips/cells/readouts
    181 void myFreeCell(pmCell *cell)
    182 {
    183     for (int k = 0 ; k < cell->readouts->n ; k++) {
    184         psFree(cell->readouts->data[k]);
    185     }
    186     psFree(cell);
    187 }
    188 
    189 void myFreeChip(pmChip *chip) {
    190     for (int j = 0 ; j < chip->cells->n ; j++) {
    191         myFreeCell(chip->cells->data[j]);
    192     }
    193     psFree(chip);
    194 }
    195 
    196 void myFreeFPA(pmFPA *fpa)
    197 {
     183void SetCellFileExists(pmCell *cell) {
     184    cell->file_exists = true;
     185    for (int i = 0 ; i < cell->readouts->n ; i++) {
     186        pmReadout *readout = cell->readouts->data[i];
     187        readout->file_exists = true;
     188    }
     189}
     190
     191void SetChipFileExists(pmChip *chip) {
     192    chip->file_exists = true;
     193    for (int i = 0 ; i < chip->cells->n ; i++) {
     194        pmCell *cell = chip->cells->data[i];
     195        cell->file_exists = true;
     196        SetCellFileExists(cell);
     197    }
     198}
     199
     200void SetFPAFileExists(pmFPA *fpa) {
    198201    for (int i = 0 ; i < fpa->chips->n ; i++) {
    199         myFreeChip(fpa->chips->data[i]);
    200     }
    201     psFree(fpa);
     202        pmChip *chip = fpa->chips->data[i];
     203        chip->file_exists = true;
     204        SetChipFileExists(chip);
     205    }
     206}
     207
     208void SetReadoutDataExists(pmReadout *readout) {
     209    readout->data_exists = true;
     210}
     211
     212void SetCellDataExists(pmCell *cell) {
     213    cell->data_exists = true;
     214    for (int i = 0 ; i < cell->readouts->n ; i++) {
     215        pmReadout *readout = cell->readouts->data[i];
     216        readout->data_exists = true;
     217    }
     218}
     219
     220void SetChipDataExists(pmChip *chip) {
     221    chip->data_exists = true;
     222    for (int i = 0 ; i < chip->cells->n ; i++) {
     223        pmCell *cell = chip->cells->data[i];
     224        cell->data_exists = true;
     225        SetCellDataExists(cell);
     226    }
     227}
     228
     229void SetFPADataExists(pmFPA *fpa) {
     230    for (int i = 0 ; i < fpa->chips->n ; i++) {
     231        pmChip *chip = fpa->chips->data[i];
     232        chip->data_exists = true;
     233        SetChipDataExists(chip);
     234    }
    202235}
    203236
     
    208241    psLogSetLevel(PS_LOG_INFO);
    209242    psTraceSetLevel("err", ERR_TRACE_LEVEL);
    210     plan_tests(72);
    211 
    212     // ----------------------------------------------------------------------
    213     // ----------------------------------------------------------------------
    214     // pmCellSetFileStatus() tests: verify with NULL pmCell param
    215     // bool pmCellSetFileStatus(pmCell *cell, bool status)
    216     {
    217         psMemId id = psMemGetId();
    218         bool rc = pmCellSetFileStatus(NULL, false);
    219         ok(!rc, "pmCellSetFileStatus() returned FALSE with NULL pmCell param");
    220         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    221     }
    222 
    223 
    224     // pmCellSetFileStatus() tests: verify with acceptable data
    225     // bool pmCellSetFileStatus(pmCell *cell, bool status)
    226     {
    227         psMemId id = psMemGetId();
    228         // Generate the pmFPA heirarchy
    229         psMetadata *camera = psMetadataAlloc();
    230         pmFPA* fpa = generateSimpleFPA(camera);
    231         pmChip *chip = fpa->chips->data[0];
    232         pmCell *cell = chip->cells->data[0];
    233         ok(fpa != NULL, "Allocated a pmFPA successfully");
    234         ok(chip != NULL, "Allocated a pmChip successfully");
    235         ok(cell != NULL, "Allocated a pmCell successfully");
    236 
    237         // First, set all flags to FALSE
    238         bool correctStatus = false;
    239         bool rc = pmCellSetFileStatus(cell, correctStatus);
    240         ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
    241         bool errorFlag = false;
    242         if (cell->file_exists != correctStatus) {
    243             diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
    244             errorFlag = true;
    245         }
    246         for (int i = 0; i < cell->readouts->n; i++) {
    247 
    248             pmReadout *readout = cell->readouts->data[i];
    249             if (readout->file_exists != correctStatus) {
    250                 diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell %d\n", i);
    251                 errorFlag = true;
    252             }
    253         }
    254         ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to FALSE");
    255 
    256         // Second, set all flags to TRUE
    257         correctStatus = true;
    258         rc = pmCellSetFileStatus(cell, correctStatus);
    259         ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
    260         errorFlag = false;
    261         if (cell->file_exists != correctStatus) {
    262             diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
    263             errorFlag = true;
    264         }
    265         for (int i = 0; i < cell->readouts->n; i++) {
    266             pmReadout *readout = cell->readouts->data[i];
    267             if (readout->file_exists != correctStatus) {
    268                 diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell %d\n", i);
    269                 errorFlag = true;
    270             }
    271         }
    272         ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to TRUE");
    273 
    274         // Third, set all flags to FALSE
    275         correctStatus = false;
    276         rc = pmCellSetFileStatus(cell, correctStatus);
    277         ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
    278         errorFlag = false;
    279         if (cell->file_exists != correctStatus) {
    280             diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
    281             errorFlag = true;
    282         }
    283         for (int i = 0; i < cell->readouts->n; i++) {
    284             pmReadout *readout = cell->readouts->data[i];
    285             if (readout->file_exists != correctStatus) {
    286                 diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for readout %d\n", i);
    287                 errorFlag = true;
    288             }
    289         }
    290         ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to FALSE");
    291 
    292         myFreeFPA(fpa);
    293         psFree(camera);
    294         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    295     }
    296 
    297 
    298     // ----------------------------------------------------------------------
    299     // ----------------------------------------------------------------------
    300     // pmChipSetFileStatus() tests: verify with NULL pmChip param
    301     // bool pmChipSetFileStatus(pmChip *chip, bool status)
    302     {
    303         psMemId id = psMemGetId();
    304         bool rc = pmChipSetFileStatus(NULL, false);
    305         ok(!rc, "pmChipSetFileStatus() returned FALSE with NULL pmChip param");
    306         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    307     }
    308 
    309 
    310     // pmChipSetFileStatus() tests: verify with acceptable data
    311     // bool pmChipSetFileStatus(pmChip *chip, bool status)
    312     {
    313         psMemId id = psMemGetId();
    314         // Generate the pmFPA heirarchy
    315         psMetadata *camera = psMetadataAlloc();
    316         pmFPA* fpa = generateSimpleFPA(camera);
    317         pmChip *chip = fpa->chips->data[0];
    318         pmCell *cell = chip->cells->data[0];
    319         ok(fpa != NULL, "Allocated a pmFPA successfully");
    320         ok(chip != NULL, "Allocated a pmChip successfully");
    321         ok(cell != NULL, "Allocated a pmCell successfully");
    322 
    323         // First, set all flags to FALSE
    324         bool correctStatus = false;
    325         bool rc = pmChipSetFileStatus(chip, correctStatus);
    326         ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
    327         bool errorFlag = false;
    328         if (chip->file_exists != correctStatus) {
    329             diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
    330             errorFlag = true;
    331         }
    332         for (int j = 0 ; j < chip->cells->n ; j++) {
    333             pmCell *cell = chip->cells->data[j];
    334             if (cell->file_exists != correctStatus) {
    335                 diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
    336                 errorFlag = true;
    337             }
    338 
    339             for (int i = 0; i < cell->readouts->n; i++) {
    340                 pmReadout *readout = cell->readouts->data[i];
    341                 if (readout->file_exists != correctStatus) {
    342                     diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
    343                     errorFlag = true;
    344                 }
    345             }
    346         }
    347         ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to FALSE");
    348 
    349         // Second, set all flags to TRUE
    350         correctStatus = true;
    351         rc = pmChipSetFileStatus(chip, correctStatus);
    352         ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
    353         errorFlag = false;
    354         if (chip->file_exists != correctStatus) {
    355             diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
    356             errorFlag = true;
    357         }
    358         for (int j = 0 ; j < chip->cells->n ; j++) {
    359             pmCell *cell = chip->cells->data[j];
    360             if (cell->file_exists != correctStatus) {
    361                 diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
    362                 errorFlag = true;
    363             }
    364 
    365             for (int i = 0; i < cell->readouts->n; i++) {
    366                 pmReadout *readout = cell->readouts->data[i];
    367                 if (readout->file_exists != correctStatus) {
    368                     diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
    369                     errorFlag = true;
    370                 }
    371             }
    372         }
    373         ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to TRUE");
    374 
    375         // Third, set all flags to FALSE
    376         correctStatus = false;
    377         rc = pmChipSetFileStatus(chip, correctStatus);
    378         ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
    379         errorFlag = false;
    380         if (chip->file_exists != correctStatus) {
    381             diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
    382             errorFlag = true;
    383         }
    384         for (int j = 0 ; j < chip->cells->n ; j++) {
    385             pmCell *cell = chip->cells->data[j];
    386             if (cell->file_exists != correctStatus) {
    387                 diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
    388                 errorFlag = true;
    389             }
    390 
    391             for (int i = 0; i < cell->readouts->n; i++) {
    392                 pmReadout *readout = cell->readouts->data[i];
    393                 if (readout->file_exists != correctStatus) {
    394                     diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
    395                     errorFlag = true;
    396                 }
    397             }
    398         }
    399         ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to FALSE");
    400 
    401 
    402         myFreeFPA(fpa);
    403         psFree(camera);
    404         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    405     }
    406 
    407     // ----------------------------------------------------------------------
     243    plan_tests(107);
     244
     245
    408246    // ----------------------------------------------------------------------
    409247    // pmFPASetFileStatus() tests: verify with NULL pmFPA param
     
    505343        ok(!errorFlag, "pmFPASetFileStatus() set file status in all cells to FALSE");
    506344
    507         myFreeFPA(fpa);
     345        psFree(fpa);
    508346        psFree(camera);
    509347        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    510348    }
    511349
    512     // ----------------------------------------------------------------------
    513     // ----------------------------------------------------------------------
    514     // pmCellSetDataStatus() tests: verify with NULL pmCell param
    515     // bool pmCellSetDataStatus(pmCell *cell, bool status)
    516     {
    517         psMemId id = psMemGetId();
    518         bool rc = pmCellSetDataStatus(NULL, false);
    519         ok(!rc, "pmCellSetDataStatus() returned FALSE with NULL pmCell param");
    520         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    521     }
    522 
    523 
    524     // pmCellSetDataStatus() tests: verify with acceptable data
    525     // bool pmCellSetDataStatus(pmCell *cell, bool status)
     350
     351    // ----------------------------------------------------------------------
     352    // pmChipSetFileStatus() tests: verify with NULL pmChip param
     353    // bool pmChipSetFileStatus(pmChip *chip, bool status)
     354    {
     355        psMemId id = psMemGetId();
     356        bool rc = pmChipSetFileStatus(NULL, false);
     357        ok(!rc, "pmChipSetFileStatus() returned FALSE with NULL pmChip param");
     358        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     359    }
     360
     361
     362    // pmChipSetFileStatus() tests: verify with acceptable data
     363    // bool pmChipSetFileStatus(pmChip *chip, bool status)
    526364    {
    527365        psMemId id = psMemGetId();
     
    537375        // First, set all flags to FALSE
    538376        bool correctStatus = false;
    539         bool rc = pmCellSetDataStatus(cell, correctStatus);
    540         ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
     377        bool rc = pmChipSetFileStatus(chip, correctStatus);
     378        ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
    541379        bool errorFlag = false;
    542         if (cell->data_exists != correctStatus) {
    543             diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
    544             errorFlag = true;
    545         }
    546         for (int i = 0; i < cell->readouts->n; i++) {
    547             pmReadout *readout = cell->readouts->data[i];
    548             if (readout->data_exists != correctStatus) {
    549                 diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell %d\n", i);
    550                 errorFlag = true;
    551             }
    552         }
    553         ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to FALSE");
     380        if (chip->file_exists != correctStatus) {
     381            diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
     382            errorFlag = true;
     383        }
     384        for (int j = 0 ; j < chip->cells->n ; j++) {
     385            pmCell *cell = chip->cells->data[j];
     386            if (cell->file_exists != correctStatus) {
     387                diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
     388                errorFlag = true;
     389            }
     390
     391            for (int i = 0; i < cell->readouts->n; i++) {
     392                pmReadout *readout = cell->readouts->data[i];
     393                if (readout->file_exists != correctStatus) {
     394                    diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
     395                    errorFlag = true;
     396                }
     397            }
     398        }
     399        ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to FALSE");
    554400
    555401        // Second, set all flags to TRUE
    556402        correctStatus = true;
    557         rc = pmCellSetDataStatus(cell, correctStatus);
    558         ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
    559         errorFlag = false;
    560         if (cell->data_exists != correctStatus) {
    561             diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
    562             errorFlag = true;
    563         }
    564         for (int i = 0; i < cell->readouts->n; i++) {
    565             pmReadout *readout = cell->readouts->data[i];
    566             if (readout->data_exists != correctStatus) {
    567                 diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell %d\n", i);
    568                 errorFlag = true;
    569             }
    570         }
    571         ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to TRUE");
     403        rc = pmChipSetFileStatus(chip, correctStatus);
     404        ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
     405        errorFlag = false;
     406        if (chip->file_exists != correctStatus) {
     407            diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
     408            errorFlag = true;
     409        }
     410        for (int j = 0 ; j < chip->cells->n ; j++) {
     411            pmCell *cell = chip->cells->data[j];
     412            if (cell->file_exists != correctStatus) {
     413                diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
     414                errorFlag = true;
     415            }
     416
     417            for (int i = 0; i < cell->readouts->n; i++) {
     418                pmReadout *readout = cell->readouts->data[i];
     419                if (readout->file_exists != correctStatus) {
     420                    diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
     421                    errorFlag = true;
     422                }
     423            }
     424        }
     425        ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to TRUE");
    572426
    573427        // Third, set all flags to FALSE
    574428        correctStatus = false;
    575         rc = pmCellSetDataStatus(cell, correctStatus);
    576         ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
    577         errorFlag = false;
    578         if (cell->data_exists != correctStatus) {
    579             diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
    580             errorFlag = true;
    581         }
    582         for (int i = 0; i < cell->readouts->n; i++) {
    583             pmReadout *readout = cell->readouts->data[i];
    584             if (readout->data_exists != correctStatus) {
    585                 diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for readout %d\n", i);
    586                 errorFlag = true;
    587             }
    588         }
    589         ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to FALSE");
    590 
    591         myFreeFPA(fpa);
     429        rc = pmChipSetFileStatus(chip, correctStatus);
     430        ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
     431        errorFlag = false;
     432        if (chip->file_exists != correctStatus) {
     433            diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
     434            errorFlag = true;
     435        }
     436        for (int j = 0 ; j < chip->cells->n ; j++) {
     437            pmCell *cell = chip->cells->data[j];
     438            if (cell->file_exists != correctStatus) {
     439                diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
     440                errorFlag = true;
     441            }
     442
     443            for (int i = 0; i < cell->readouts->n; i++) {
     444                pmReadout *readout = cell->readouts->data[i];
     445                if (readout->file_exists != correctStatus) {
     446                    diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
     447                    errorFlag = true;
     448                }
     449            }
     450        }
     451        ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to FALSE");
     452
     453
     454        psFree(fpa);
    592455        psFree(camera);
    593456        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     
    596459
    597460    // ----------------------------------------------------------------------
    598     // ----------------------------------------------------------------------
    599     // pmChipSetDataStatus() tests: verify with NULL pmChip param
    600     // bool pmChipSetDataStatus(pmChip *chip, bool status)
    601     {
    602         psMemId id = psMemGetId();
    603         bool rc = pmChipSetDataStatus(NULL, false);
    604         ok(!rc, "pmChipSetDataStatus() returned FALSE with NULL pmChip param");
    605         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    606     }
    607 
    608 
    609     // pmChipSetDataStatus() tests: verify with acceptable data
    610     // bool pmChipSetDataStatus(pmChip *chip, bool status)
     461    // pmCellSetFileStatus() tests: verify with NULL pmCell param
     462    {
     463        psMemId id = psMemGetId();
     464        bool rc = pmCellSetFileStatus(NULL, false);
     465        ok(!rc, "pmCellSetFileStatus() returned FALSE with NULL pmCell param");
     466        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     467    }
     468
     469
     470    // pmCellSetFileStatus() tests: verify with acceptable data
     471    // bool pmCellSetFileStatus(pmCell *cell, bool status)
    611472    {
    612473        psMemId id = psMemGetId();
     
    622483        // First, set all flags to FALSE
    623484        bool correctStatus = false;
    624         bool rc = pmChipSetDataStatus(chip, correctStatus);
    625         ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
     485        bool rc = pmCellSetFileStatus(cell, correctStatus);
     486        ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
    626487        bool errorFlag = false;
    627         if (chip->data_exists != correctStatus) {
    628             diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
    629             errorFlag = true;
    630         }
    631         for (int j = 0 ; j < chip->cells->n ; j++) {
    632             pmCell *cell = chip->cells->data[j];
    633             if (cell->data_exists != correctStatus) {
    634                 diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
    635                 errorFlag = true;
    636             }
    637 
    638             for (int i = 0; i < cell->readouts->n; i++) {
    639                 pmReadout *readout = cell->readouts->data[i];
    640                 if (readout->data_exists != correctStatus) {
    641                     diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
    642                     errorFlag = true;
    643                 }
    644             }
    645         }
    646         ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to FALSE");
     488        if (cell->file_exists != correctStatus) {
     489            diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
     490            errorFlag = true;
     491        }
     492        for (int i = 0; i < cell->readouts->n; i++) {
     493
     494            pmReadout *readout = cell->readouts->data[i];
     495            if (readout->file_exists != correctStatus) {
     496                diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell %d\n", i);
     497                errorFlag = true;
     498            }
     499        }
     500        ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to FALSE");
    647501
    648502        // Second, set all flags to TRUE
    649503        correctStatus = true;
    650         rc = pmChipSetDataStatus(chip, correctStatus);
    651         ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
    652         errorFlag = false;
    653         if (chip->data_exists != correctStatus) {
    654             diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
    655             errorFlag = true;
    656         }
    657         for (int j = 0 ; j < chip->cells->n ; j++) {
    658             pmCell *cell = chip->cells->data[j];
    659             if (cell->data_exists != correctStatus) {
    660                 diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
    661                 errorFlag = true;
    662             }
    663 
    664             for (int i = 0; i < cell->readouts->n; i++) {
    665                 pmReadout *readout = cell->readouts->data[i];
    666                 if (readout->data_exists != correctStatus) {
    667                     diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
    668                     errorFlag = true;
    669                 }
    670             }
    671         }
    672         ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to TRUE");
    673 
    674         // ThirdSecond, set all flags to FALSE
     504        rc = pmCellSetFileStatus(cell, correctStatus);
     505        ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
     506        errorFlag = false;
     507        if (cell->file_exists != correctStatus) {
     508            diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
     509            errorFlag = true;
     510        }
     511        for (int i = 0; i < cell->readouts->n; i++) {
     512            pmReadout *readout = cell->readouts->data[i];
     513            if (readout->file_exists != correctStatus) {
     514                diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell %d\n", i);
     515                errorFlag = true;
     516            }
     517        }
     518        ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to TRUE");
     519
     520        // Third, set all flags to FALSE
    675521        correctStatus = false;
    676         rc = pmChipSetDataStatus(chip, correctStatus);
    677         ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
    678         errorFlag = false;
    679         if (chip->data_exists != correctStatus) {
    680             diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
    681             errorFlag = true;
    682         }
    683         for (int j = 0 ; j < chip->cells->n ; j++) {
    684             pmCell *cell = chip->cells->data[j];
    685             if (cell->data_exists != correctStatus) {
    686                 diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
    687                 errorFlag = true;
    688             }
    689 
    690             for (int i = 0; i < cell->readouts->n; i++) {
    691                 pmReadout *readout = cell->readouts->data[i];
    692                 if (readout->data_exists != correctStatus) {
    693                     diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
    694                     errorFlag = true;
    695                 }
    696             }
    697         }
    698         ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to FALSE");
    699 
    700 
    701         myFreeFPA(fpa);
     522        rc = pmCellSetFileStatus(cell, correctStatus);
     523        ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
     524        errorFlag = false;
     525        if (cell->file_exists != correctStatus) {
     526            diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
     527            errorFlag = true;
     528        }
     529        for (int i = 0; i < cell->readouts->n; i++) {
     530            pmReadout *readout = cell->readouts->data[i];
     531            if (readout->file_exists != correctStatus) {
     532                diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for readout %d\n", i);
     533                errorFlag = true;
     534            }
     535        }
     536        ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to FALSE");
     537
     538        psFree(fpa);
    702539        psFree(camera);
    703540        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    704541    }
    705542
    706     // ----------------------------------------------------------------------
    707     // ----------------------------------------------------------------------
    708     // pmFPASetFileStatus() tests: verify with NULL pmFPA param
    709     // bool pmFPASetFileStatus(pmFPA *fpa, bool status)
    710     {
    711         psMemId id = psMemGetId();
    712         bool rc = pmFPASetFileStatus(NULL, false);
    713         ok(!rc, "pmFPASetFileStatus() returned FALSE with NULL pmFPA param");
    714         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    715     }
    716 
    717 
     543
     544    // ----------------------------------------------------------------------
     545    // pmFPACheckFileStatus() tests
     546    // bool pmFPACheckFileStatus(const pmFPA *fpa)
     547    // Call with NULL pmFPA input parameter
     548    {
     549        psMemId id = psMemGetId();
     550        bool rc = pmFPACheckFileStatus(NULL);
     551        ok(rc == false, "pmFPACheckFileStatus() returned FALSE with NULL pmFPA input parameter");
     552        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     553    }
     554
     555
     556    // Call with acceptable input parameters
     557    {
     558        psMemId id = psMemGetId();
     559        pmFPA *fpa = generateSimpleFPA(NULL);
     560        bool rc = pmFPACheckFileStatus(fpa);
     561        ok(rc == false, "pmFPACheckFileStatus() returned FALSE with NULL pmFPA input parameter");
     562        SetFPAFileExists(fpa);
     563        rc = pmFPACheckFileStatus(fpa);
     564        ok(rc == true, "pmFPACheckFileStatus() returned TRUE with NULL pmFPA input parameter");
     565        psFree(fpa);
     566        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     567    }
     568
     569
     570    // ----------------------------------------------------------------------
     571    // pmChipCheckFileStatus() tests
     572    // Call with NULL pmChip input parameter
     573    {
     574        psMemId id = psMemGetId();
     575        bool rc = pmChipCheckFileStatus(NULL);
     576        ok(rc == false, "pmChipCheckFileStatus() returned FALSE with NULL pmChip input parameter");
     577        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     578    }
     579
     580
     581    // Call with acceptable input parameter
     582    {
     583        psMemId id = psMemGetId();
     584        pmChip *chip = generateSimpleChip(NULL);
     585        bool rc = pmChipCheckFileStatus(chip);
     586        ok(rc == false, "pmChipCheckFileStatus() returned FALSE with NULL pmChip input parameter");
     587        SetChipFileExists(chip);
     588        rc = pmChipCheckFileStatus(chip);
     589        ok(rc == true, "pmChipCheckFileStatus() returned TRUE with NULL pmChip input parameter");
     590        psFree(chip);
     591        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     592    }
     593
     594
     595    // ----------------------------------------------------------------------
     596    // pmCellCheckFileStatus() tests
     597    // bool pmCellCheckFileStatus(const pmCell *cell)
     598    // Call with NULL pmCell input parameter
     599    {
     600        psMemId id = psMemGetId();
     601        bool rc = pmCellCheckFileStatus(NULL);
     602        ok(rc == false, "pmCellCheckFileStatus() returned FALSE with NULL pmCell input parameter");
     603        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     604    }
     605
     606
     607    // Call with acceptable input parameters
     608    {
     609        psMemId id = psMemGetId();
     610        pmCell *cell = generateSimpleCell(NULL);
     611        bool rc = pmCellCheckFileStatus(cell);
     612        ok(rc == false, "pmCellCheckFileStatus() returned FALSE with acceptable input parameters");
     613        SetCellFileExists(cell);
     614        rc = pmCellCheckFileStatus(cell);
     615        ok(rc == true, "pmCellCheckFileStatus() returned TRUE with acceptable input parameters");
     616        psFree(cell);
     617        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     618    }
     619
     620
     621    // ----------------------------------------------------------------------
     622    // pmFPASetDataStatus() tests: verify with NULL pmFPA param
     623    {
     624        psMemId id = psMemGetId();
     625        bool rc = pmFPASetDataStatus(NULL, false);
     626        ok(!rc, "pmFPASetDataStatus() returned FALSE with NULL pmFPA param");
     627        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     628    }
    718629
    719630
     
    806717        ok(!errorFlag, "pmFPASetDataStatus() set file status in all cells to FALSE");
    807718
    808         myFreeFPA(fpa);
     719        psFree(fpa);
    809720        psFree(camera);
    810721        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    811722    }
    812723
    813 }
     724
     725    // ----------------------------------------------------------------------
     726    // pmChipSetDataStatus() tests: verify with NULL pmChip param
     727    // bool pmChipSetDataStatus(pmChip *chip, bool status)
     728    {
     729        psMemId id = psMemGetId();
     730        bool rc = pmChipSetDataStatus(NULL, false);
     731        ok(!rc, "pmChipSetDataStatus() returned FALSE with NULL pmChip param");
     732        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     733    }
     734
     735
     736    // pmChipSetDataStatus() tests: verify with acceptable data
     737    // bool pmChipSetDataStatus(pmChip *chip, bool status)
     738    {
     739        psMemId id = psMemGetId();
     740        // Generate the pmFPA heirarchy
     741        psMetadata *camera = psMetadataAlloc();
     742        pmFPA* fpa = generateSimpleFPA(camera);
     743        pmChip *chip = fpa->chips->data[0];
     744        pmCell *cell = chip->cells->data[0];
     745        ok(fpa != NULL, "Allocated a pmFPA successfully");
     746        ok(chip != NULL, "Allocated a pmChip successfully");
     747        ok(cell != NULL, "Allocated a pmCell successfully");
     748
     749        // First, set all flags to FALSE
     750        bool correctStatus = false;
     751        bool rc = pmChipSetDataStatus(chip, correctStatus);
     752        ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
     753        bool errorFlag = false;
     754        if (chip->data_exists != correctStatus) {
     755            diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
     756            errorFlag = true;
     757        }
     758        for (int j = 0 ; j < chip->cells->n ; j++) {
     759            pmCell *cell = chip->cells->data[j];
     760            if (cell->data_exists != correctStatus) {
     761                diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
     762                errorFlag = true;
     763            }
     764
     765            for (int i = 0; i < cell->readouts->n; i++) {
     766                pmReadout *readout = cell->readouts->data[i];
     767                if (readout->data_exists != correctStatus) {
     768                    diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
     769                    errorFlag = true;
     770                }
     771            }
     772        }
     773        ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to FALSE");
     774
     775        // Second, set all flags to TRUE
     776        correctStatus = true;
     777        rc = pmChipSetDataStatus(chip, correctStatus);
     778        ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
     779        errorFlag = false;
     780        if (chip->data_exists != correctStatus) {
     781            diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
     782            errorFlag = true;
     783        }
     784        for (int j = 0 ; j < chip->cells->n ; j++) {
     785            pmCell *cell = chip->cells->data[j];
     786            if (cell->data_exists != correctStatus) {
     787                diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
     788                errorFlag = true;
     789            }
     790
     791            for (int i = 0; i < cell->readouts->n; i++) {
     792                pmReadout *readout = cell->readouts->data[i];
     793                if (readout->data_exists != correctStatus) {
     794                    diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
     795                    errorFlag = true;
     796                }
     797            }
     798        }
     799        ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to TRUE");
     800
     801        // ThirdSecond, set all flags to FALSE
     802        correctStatus = false;
     803        rc = pmChipSetDataStatus(chip, correctStatus);
     804        ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
     805        errorFlag = false;
     806        if (chip->data_exists != correctStatus) {
     807            diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
     808            errorFlag = true;
     809        }
     810        for (int j = 0 ; j < chip->cells->n ; j++) {
     811            pmCell *cell = chip->cells->data[j];
     812            if (cell->data_exists != correctStatus) {
     813                diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
     814                errorFlag = true;
     815            }
     816
     817            for (int i = 0; i < cell->readouts->n; i++) {
     818                pmReadout *readout = cell->readouts->data[i];
     819                if (readout->data_exists != correctStatus) {
     820                    diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
     821                    errorFlag = true;
     822                }
     823            }
     824        }
     825        ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to FALSE");
     826
     827
     828        psFree(fpa);
     829        psFree(camera);
     830        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     831    }
     832
     833
     834    // ----------------------------------------------------------------------
     835    // pmCellSetDataStatus() tests: verify with NULL pmCell param
     836    // bool pmCellSetDataStatus(pmCell *cell, bool status)
     837    {
     838        psMemId id = psMemGetId();
     839        bool rc = pmCellSetDataStatus(NULL, false);
     840        ok(!rc, "pmCellSetDataStatus() returned FALSE with NULL pmCell param");
     841        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     842    }
     843
     844
     845    // pmCellSetDataStatus() tests: verify with acceptable data
     846    // bool pmCellSetDataStatus(pmCell *cell, bool status)
     847    {
     848        psMemId id = psMemGetId();
     849        // Generate the pmFPA heirarchy
     850        psMetadata *camera = psMetadataAlloc();
     851        pmFPA* fpa = generateSimpleFPA(camera);
     852        pmChip *chip = fpa->chips->data[0];
     853        pmCell *cell = chip->cells->data[0];
     854        ok(fpa != NULL, "Allocated a pmFPA successfully");
     855        ok(chip != NULL, "Allocated a pmChip successfully");
     856        ok(cell != NULL, "Allocated a pmCell successfully");
     857
     858        // First, set all flags to FALSE
     859        bool correctStatus = false;
     860        bool rc = pmCellSetDataStatus(cell, correctStatus);
     861        ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
     862        bool errorFlag = false;
     863        if (cell->data_exists != correctStatus) {
     864            diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
     865            errorFlag = true;
     866        }
     867        for (int i = 0; i < cell->readouts->n; i++) {
     868            pmReadout *readout = cell->readouts->data[i];
     869            if (readout->data_exists != correctStatus) {
     870                diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell %d\n", i);
     871                errorFlag = true;
     872            }
     873        }
     874        ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to FALSE");
     875
     876        // Second, set all flags to TRUE
     877        correctStatus = true;
     878        rc = pmCellSetDataStatus(cell, correctStatus);
     879        ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
     880        errorFlag = false;
     881        if (cell->data_exists != correctStatus) {
     882            diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
     883            errorFlag = true;
     884        }
     885        for (int i = 0; i < cell->readouts->n; i++) {
     886            pmReadout *readout = cell->readouts->data[i];
     887            if (readout->data_exists != correctStatus) {
     888                diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell %d\n", i);
     889                errorFlag = true;
     890            }
     891        }
     892        ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to TRUE");
     893
     894        // Third, set all flags to FALSE
     895        correctStatus = false;
     896        rc = pmCellSetDataStatus(cell, correctStatus);
     897        ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
     898        errorFlag = false;
     899        if (cell->data_exists != correctStatus) {
     900            diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
     901            errorFlag = true;
     902        }
     903        for (int i = 0; i < cell->readouts->n; i++) {
     904            pmReadout *readout = cell->readouts->data[i];
     905            if (readout->data_exists != correctStatus) {
     906                diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for readout %d\n", i);
     907                errorFlag = true;
     908            }
     909        }
     910        ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to FALSE");
     911
     912        psFree(fpa);
     913        psFree(camera);
     914        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     915    }
     916
     917
     918    // ----------------------------------------------------------------------
     919    // pmFPACheckDataStatus() tests
     920    // bool pmFPACheckDataStatus(const pmFPA *fpa)
     921    // Call with NULL pmFPA input parameter
     922    {
     923        psMemId id = psMemGetId();
     924        bool rc = pmFPACheckDataStatus(NULL);
     925        ok(rc == false, "pmFPACheckDataStatus() returned FALSE with NULL pmFPA input parameter");
     926        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     927    }
     928
     929
     930    // Call with acceptable input parameters
     931    {
     932        psMemId id = psMemGetId();
     933        pmFPA *fpa = generateSimpleFPA(NULL);
     934        bool rc = pmFPACheckDataStatus(fpa);
     935        ok(rc == false, "pmFPACheckDataStatus() returned FALSE with NULL pmFPA input parameter");
     936        SetFPADataExists(fpa);
     937        rc = pmFPACheckDataStatus(fpa);
     938        ok(rc == true, "pmFPACheckDataStatus() returned TRUE with NULL pmFPA input parameter");
     939        psFree(fpa);
     940        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     941    }
     942
     943
     944    // ----------------------------------------------------------------------
     945    // pmChipCheckDataStatus() tests
     946    // Call with NULL pmChip input parameter
     947    {
     948        psMemId id = psMemGetId();
     949        bool rc = pmChipCheckDataStatus(NULL);
     950        ok(rc == false, "pmChipCheckDataStatus() returned FALSE with NULL pmChip input parameter");
     951        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     952    }
     953
     954
     955    // Call with acceptable input parameter
     956    {
     957        psMemId id = psMemGetId();
     958        pmChip *chip = generateSimpleChip(NULL);
     959        bool rc = pmChipCheckDataStatus(chip);
     960        ok(rc == false, "pmChipCheckDataStatus() returned FALSE with NULL pmChip input parameter");
     961        SetChipDataExists(chip);
     962        rc = pmChipCheckDataStatus(chip);
     963        ok(rc == true, "pmChipCheckDataStatus() returned TRUE with NULL pmChip input parameter");
     964        psFree(chip);
     965        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     966    }
     967
     968
     969    // ----------------------------------------------------------------------
     970    // pmCellCheckDataStatus() tests
     971    // bool pmCellCheckDataStatus(const pmCell *cell)
     972    // Call with NULL pmCell input parameter
     973    {
     974        psMemId id = psMemGetId();
     975        bool rc = pmCellCheckDataStatus(NULL);
     976        ok(rc == false, "pmCellCheckDataStatus() returned FALSE with NULL pmCell input parameter");
     977        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     978    }
     979
     980
     981    // Call with acceptable input parameters
     982    {
     983        psMemId id = psMemGetId();
     984        pmCell *cell = generateSimpleCell(NULL);
     985        bool rc = pmCellCheckDataStatus(cell);
     986        ok(rc == false, "pmCellCheckDataStatus() returned FALSE with acceptable input parameters");
     987        SetCellDataExists(cell);
     988        rc = pmCellCheckDataStatus(cell);
     989        ok(rc == true, "pmCellCheckDataStatus() returned TRUE with acceptable input parameters");
     990        psFree(cell);
     991        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     992    }
     993
     994
     995    // ----------------------------------------------------------------------
     996    // pmReadoutCheckDataStatus() tests
     997    // bool pmReadoutCheckDataStatus(const pmReadout *readout)
     998    // Call with NULL pmReadout input parameter
     999    {
     1000        psMemId id = psMemGetId();
     1001        bool rc = pmReadoutCheckDataStatus(NULL);
     1002        ok(rc == false, "pmReadoutCheckDataStatus() returned FALSE with NULL pmReadout input parameter");
     1003        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     1004    }
     1005
     1006
     1007    // Call with acceptable input parameters
     1008    {
     1009        psMemId id = psMemGetId();
     1010        pmReadout *readout = generateSimpleReadout(NULL);
     1011        bool rc = pmReadoutCheckDataStatus(readout);
     1012        ok(rc == false, "pmReadoutCheckDataStatus() returned FALSE with acceptable input parameters");
     1013        SetReadoutDataExists(readout);
     1014        rc = pmReadoutCheckDataStatus(readout);
     1015        ok(rc == true, "pmReadoutCheckDataStatus() returned TRUE with acceptable input parameters");
     1016        psFree(readout);
     1017        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     1018    }
     1019}
Note: See TracChangeset for help on using the changeset viewer.