Index: trunk/psModules/test/camera/tap_pmFPAFlags.c
===================================================================
--- trunk/psModules/test/camera/tap_pmFPAFlags.c	(revision 14882)
+++ trunk/psModules/test/camera/tap_pmFPAFlags.c	(revision 15987)
@@ -5,9 +5,30 @@
 #include "tap.h"
 #include "pstap.h"
-// XXX: Use better name for the temporary FITS file
-// XXX: The code to generate and free the FPA hierarchy was copied from
-// tap-pmFPA.c.  EIther include it directly, or library, or something.
-// Also, get rid of the manual free functions and use psFree() once
-// it correctly frees child members
+/* STATUS
+    TESTED:
+        pmFPASetFileStatus()
+        pmChipSetFileStatus()
+        pmCellSetFileStatus()
+
+        pmFPACheckFileStatus()
+        pmChipCheckFileStatus()
+        pmCellCheckFileStatus()
+
+        pmFPASetDataStatus()
+        pmChipSetDataStatus()
+        pmCellSetDataStatus()
+
+        pmFPACheckDataStatus()
+        pmChipCheckDataStatus()
+        pmCellCheckDataStatus()
+        pmReadoutCheckDataStatus()
+    MUST TEST:
+        pmFPAviewCheckDataStatus()
+        pmFPASelectChip()
+        pmChipSelectCell()
+        pmFPAExcludeChip()
+        pmChipExcludeCell()
+*/
+
 // XXX: For the genSimpleFPA() code, add IDs to each function so that
 // the values set in each chip-?cell-?hdu-?image are unique
@@ -82,10 +103,13 @@
     cell->hdu = pmHDUAlloc("cellExtName");
     for (int i = 0 ; i < NUM_READOUTS ; i++) {
-        cell->readouts->data[i] = generateSimpleReadout(cell);
-    }
-
-    bool rc = pmConfigFileRead(&cell->hdu->format, "data/camera0/format0.config", "Camera format 0");
+        cell->readouts->data[i] = psMemDecrRefCounter((psPtr) generateSimpleReadout(cell));
+    }
+
+    bool rc = pmConfigFileRead(&cell->hdu->format, "dataFiles/camera0/format0.config", "Camera format 0");
     if (!rc) {
-        diag("pmConfigFileRead() was unsuccessful (from generateSimpleCell())");
+        rc = pmConfigFileRead(&cell->hdu->format, "../dataFiles/camera0/format0.config", "Camera format 0");
+        if (!rc) {
+            diag("pmConfigFileRead() was unsuccessful (from generateSimpleCell())");
+        }
     }
 
@@ -103,5 +127,4 @@
 
     //XXX: Should the region be set some other way?  Like through the various config files?
-//    psRegion *region = psRegionAlloc(0.0, TEST_NUM_COLS-1, 0.0, TEST_NUM_ROWS-1);
     psRegion *region = psRegionAlloc(0.0, 0.0, 0.0, 0.0);
     // You shouldn't have to remove the key from the metadata.  Find out how to simply change the key value.
@@ -123,14 +146,7 @@
     psMetadataAddS32(chip->analysis, PS_LIST_HEAD, MISC_NAME, 0, NULL, MISC_NUM);
     psMetadataAddS32(chip->concepts, PS_LIST_HEAD, MISC_NAME, 0, NULL, MISC_NUM);
-//    chip->hdu = pmHDUAlloc("chipExtName");
-//
-//    bool rc = pmConfigFileRead(&chip->hdu->format, "data/camera0/format0.config", "Camera format 0");
-//    if (!rc) {
-//        diag("pmConfigFileRead() was unsuccessful (from generateSimpleChip())");
-//    }
-//
     psArrayRealloc(chip->cells, NUM_CELLS);
     for (int i = 0 ; i < NUM_CELLS ; i++) {
-        chip->cells->data[i] = generateSimpleCell(chip);
+        chip->cells->data[i] = psMemDecrRefCounter((psPtr) generateSimpleCell(chip));
     }
 
@@ -154,14 +170,7 @@
     psMetadataAddS32((psMetadata *) fpa->camera, PS_LIST_HEAD, MISC_NAME, 0, NULL, MISC_NUM);
     psMetadataAddS32(fpa->concepts, PS_LIST_HEAD, MISC_NAME, 0, NULL, MISC_NUM);
-//    fpa->hdu = pmHDUAlloc("fpaExtName");
-//
-//    bool rc = pmConfigFileRead(&fpa->hdu->format, "data/camera0/format0.config", "Camera format 0");
-//    if (!rc) {
-//        diag("pmConfigFileRead() was unsuccessful (from generateSimpleFPA())");
-//    }
-
     psArrayRealloc(fpa->chips, NUM_CHIPS);
     for (int i = 0 ; i < NUM_CHIPS ; i++) {
-        fpa->chips->data[i] = generateSimpleChip(fpa);
+        fpa->chips->data[i] = psMemDecrRefCounter((psPtr) generateSimpleChip(fpa));
     }
 
@@ -169,35 +178,59 @@
     // reading code from wherever.
     pmConceptsBlankFPA(fpa);
-//    bool mdok;
-//    psMetadata *fileData = psMetadataLookupMetadata(&mdok, fpa->hdu->format, "FILE");
-//    char *fpaNameHdr = psMetadataLookupStr(&mdok, fileData, "FPA.NAME");
-//    psMetadataAddStr(fpa->concepts, PS_LIST_TAIL, "FPA.NAME", PS_META_REPLACE, NULL, fpaNameHdr);
-
     return(fpa);
 }
 
-// XXX: This should only be necessary until the psFree() functions for
-// FPA/chip/cell/readout correctly free all child chips/cells/readouts
-void myFreeCell(pmCell *cell)
-{
-    for (int k = 0 ; k < cell->readouts->n ; k++) {
-        psFree(cell->readouts->data[k]);
-    }
-    psFree(cell);
-}
-
-void myFreeChip(pmChip *chip) {
-    for (int j = 0 ; j < chip->cells->n ; j++) {
-        myFreeCell(chip->cells->data[j]);
-    }
-    psFree(chip);
-}
-
-void myFreeFPA(pmFPA *fpa)
-{
+void SetCellFileExists(pmCell *cell) {
+    cell->file_exists = true;
+    for (int i = 0 ; i < cell->readouts->n ; i++) {
+        pmReadout *readout = cell->readouts->data[i];
+        readout->file_exists = true;
+    }
+}
+
+void SetChipFileExists(pmChip *chip) {
+    chip->file_exists = true;
+    for (int i = 0 ; i < chip->cells->n ; i++) {
+        pmCell *cell = chip->cells->data[i];
+        cell->file_exists = true;
+        SetCellFileExists(cell);
+    }
+}
+
+void SetFPAFileExists(pmFPA *fpa) {
     for (int i = 0 ; i < fpa->chips->n ; i++) {
-        myFreeChip(fpa->chips->data[i]);
-    }
-    psFree(fpa);
+        pmChip *chip = fpa->chips->data[i];
+        chip->file_exists = true;
+        SetChipFileExists(chip);
+    }
+}
+
+void SetReadoutDataExists(pmReadout *readout) {
+    readout->data_exists = true;
+}
+
+void SetCellDataExists(pmCell *cell) {
+    cell->data_exists = true;
+    for (int i = 0 ; i < cell->readouts->n ; i++) {
+        pmReadout *readout = cell->readouts->data[i];
+        readout->data_exists = true;
+    }
+}
+
+void SetChipDataExists(pmChip *chip) {
+    chip->data_exists = true;
+    for (int i = 0 ; i < chip->cells->n ; i++) {
+        pmCell *cell = chip->cells->data[i];
+        cell->data_exists = true;
+        SetCellDataExists(cell);
+    }
+}
+
+void SetFPADataExists(pmFPA *fpa) {
+    for (int i = 0 ; i < fpa->chips->n ; i++) {
+        pmChip *chip = fpa->chips->data[i];
+        chip->data_exists = true;
+        SetChipDataExists(chip);
+    }
 }
 
@@ -208,202 +241,7 @@
     psLogSetLevel(PS_LOG_INFO);
     psTraceSetLevel("err", ERR_TRACE_LEVEL);
-    plan_tests(72);
-
-    // ----------------------------------------------------------------------
-    // ----------------------------------------------------------------------
-    // pmCellSetFileStatus() tests: verify with NULL pmCell param
-    // bool pmCellSetFileStatus(pmCell *cell, bool status)
-    {
-        psMemId id = psMemGetId();
-        bool rc = pmCellSetFileStatus(NULL, false);
-        ok(!rc, "pmCellSetFileStatus() returned FALSE with NULL pmCell param");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // pmCellSetFileStatus() tests: verify with acceptable data
-    // bool pmCellSetFileStatus(pmCell *cell, bool status)
-    {
-        psMemId id = psMemGetId();
-        // Generate the pmFPA heirarchy
-        psMetadata *camera = psMetadataAlloc();
-        pmFPA* fpa = generateSimpleFPA(camera);
-        pmChip *chip = fpa->chips->data[0];
-        pmCell *cell = chip->cells->data[0];
-        ok(fpa != NULL, "Allocated a pmFPA successfully");
-        ok(chip != NULL, "Allocated a pmChip successfully");
-        ok(cell != NULL, "Allocated a pmCell successfully");
-
-        // First, set all flags to FALSE
-        bool correctStatus = false;
-        bool rc = pmCellSetFileStatus(cell, correctStatus);
-        ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
-        bool errorFlag = false;
-        if (cell->file_exists != correctStatus) {
-            diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
-            errorFlag = true;
-        }
-        for (int i = 0; i < cell->readouts->n; i++) {
-
-            pmReadout *readout = cell->readouts->data[i];
-            if (readout->file_exists != correctStatus) {
-                diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell %d\n", i);
-                errorFlag = true;
-            }
-        }
-        ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to FALSE");
-
-        // Second, set all flags to TRUE
-        correctStatus = true;
-        rc = pmCellSetFileStatus(cell, correctStatus);
-        ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
-        errorFlag = false;
-        if (cell->file_exists != correctStatus) {
-            diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
-            errorFlag = true;
-        }
-        for (int i = 0; i < cell->readouts->n; i++) {
-            pmReadout *readout = cell->readouts->data[i];
-            if (readout->file_exists != correctStatus) {
-                diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell %d\n", i);
-                errorFlag = true;
-            }
-        }
-        ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to TRUE");
-
-        // Third, set all flags to FALSE
-        correctStatus = false;
-        rc = pmCellSetFileStatus(cell, correctStatus);
-        ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
-        errorFlag = false;
-        if (cell->file_exists != correctStatus) {
-            diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
-            errorFlag = true;
-        }
-        for (int i = 0; i < cell->readouts->n; i++) {
-            pmReadout *readout = cell->readouts->data[i];
-            if (readout->file_exists != correctStatus) {
-                diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for readout %d\n", i);
-                errorFlag = true;
-            }
-        }
-        ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to FALSE");
-
-        myFreeFPA(fpa);
-        psFree(camera);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // ----------------------------------------------------------------------
-    // ----------------------------------------------------------------------
-    // pmChipSetFileStatus() tests: verify with NULL pmChip param
-    // bool pmChipSetFileStatus(pmChip *chip, bool status)
-    {
-        psMemId id = psMemGetId();
-        bool rc = pmChipSetFileStatus(NULL, false);
-        ok(!rc, "pmChipSetFileStatus() returned FALSE with NULL pmChip param");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // pmChipSetFileStatus() tests: verify with acceptable data
-    // bool pmChipSetFileStatus(pmChip *chip, bool status)
-    {
-        psMemId id = psMemGetId();
-        // Generate the pmFPA heirarchy
-        psMetadata *camera = psMetadataAlloc();
-        pmFPA* fpa = generateSimpleFPA(camera);
-        pmChip *chip = fpa->chips->data[0];
-        pmCell *cell = chip->cells->data[0];
-        ok(fpa != NULL, "Allocated a pmFPA successfully");
-        ok(chip != NULL, "Allocated a pmChip successfully");
-        ok(cell != NULL, "Allocated a pmCell successfully");
-
-        // First, set all flags to FALSE
-        bool correctStatus = false;
-        bool rc = pmChipSetFileStatus(chip, correctStatus);
-        ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
-        bool errorFlag = false;
-        if (chip->file_exists != correctStatus) {
-            diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
-            errorFlag = true;
-        }
-        for (int j = 0 ; j < chip->cells->n ; j++) {
-            pmCell *cell = chip->cells->data[j];
-            if (cell->file_exists != correctStatus) {
-                diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
-                errorFlag = true;
-            }
-
-            for (int i = 0; i < cell->readouts->n; i++) {
-                pmReadout *readout = cell->readouts->data[i];
-                if (readout->file_exists != correctStatus) {
-                    diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
-                    errorFlag = true;
-                }
-            }
-        }
-        ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to FALSE");
-
-        // Second, set all flags to TRUE
-        correctStatus = true;
-        rc = pmChipSetFileStatus(chip, correctStatus);
-        ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
-        errorFlag = false;
-        if (chip->file_exists != correctStatus) {
-            diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
-            errorFlag = true;
-        }
-        for (int j = 0 ; j < chip->cells->n ; j++) {
-            pmCell *cell = chip->cells->data[j];
-            if (cell->file_exists != correctStatus) {
-                diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
-                errorFlag = true;
-            }
-
-            for (int i = 0; i < cell->readouts->n; i++) {
-                pmReadout *readout = cell->readouts->data[i];
-                if (readout->file_exists != correctStatus) {
-                    diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
-                    errorFlag = true;
-                }
-            }
-        }
-        ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to TRUE");
-
-        // Third, set all flags to FALSE
-        correctStatus = false;
-        rc = pmChipSetFileStatus(chip, correctStatus);
-        ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
-        errorFlag = false;
-        if (chip->file_exists != correctStatus) {
-            diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
-            errorFlag = true;
-        }
-        for (int j = 0 ; j < chip->cells->n ; j++) {
-            pmCell *cell = chip->cells->data[j];
-            if (cell->file_exists != correctStatus) {
-                diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
-                errorFlag = true;
-            }
-
-            for (int i = 0; i < cell->readouts->n; i++) {
-                pmReadout *readout = cell->readouts->data[i];
-                if (readout->file_exists != correctStatus) {
-                    diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
-                    errorFlag = true;
-                }
-            }
-        }
-        ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to FALSE");
-
-
-        myFreeFPA(fpa);
-        psFree(camera);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-    // ----------------------------------------------------------------------
+    plan_tests(107);
+
+
     // ----------------------------------------------------------------------
     // pmFPASetFileStatus() tests: verify with NULL pmFPA param
@@ -505,23 +343,23 @@
         ok(!errorFlag, "pmFPASetFileStatus() set file status in all cells to FALSE");
 
-        myFreeFPA(fpa);
+        psFree(fpa);
         psFree(camera);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
 
-    // ----------------------------------------------------------------------
-    // ----------------------------------------------------------------------
-    // pmCellSetDataStatus() tests: verify with NULL pmCell param
-    // bool pmCellSetDataStatus(pmCell *cell, bool status)
-    {
-        psMemId id = psMemGetId();
-        bool rc = pmCellSetDataStatus(NULL, false);
-        ok(!rc, "pmCellSetDataStatus() returned FALSE with NULL pmCell param");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // pmCellSetDataStatus() tests: verify with acceptable data
-    // bool pmCellSetDataStatus(pmCell *cell, bool status)
+
+    // ----------------------------------------------------------------------
+    // pmChipSetFileStatus() tests: verify with NULL pmChip param
+    // bool pmChipSetFileStatus(pmChip *chip, bool status)
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmChipSetFileStatus(NULL, false);
+        ok(!rc, "pmChipSetFileStatus() returned FALSE with NULL pmChip param");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // pmChipSetFileStatus() tests: verify with acceptable data
+    // bool pmChipSetFileStatus(pmChip *chip, bool status)
     {
         psMemId id = psMemGetId();
@@ -537,57 +375,82 @@
         // First, set all flags to FALSE
         bool correctStatus = false;
-        bool rc = pmCellSetDataStatus(cell, correctStatus);
-        ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
+        bool rc = pmChipSetFileStatus(chip, correctStatus);
+        ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
         bool errorFlag = false;
-        if (cell->data_exists != correctStatus) {
-            diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
-            errorFlag = true;
-        }
-        for (int i = 0; i < cell->readouts->n; i++) {
-            pmReadout *readout = cell->readouts->data[i];
-            if (readout->data_exists != correctStatus) {
-                diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell %d\n", i);
-                errorFlag = true;
-            }
-        }
-        ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to FALSE");
+        if (chip->file_exists != correctStatus) {
+            diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
+            errorFlag = true;
+        }
+        for (int j = 0 ; j < chip->cells->n ; j++) {
+            pmCell *cell = chip->cells->data[j];
+            if (cell->file_exists != correctStatus) {
+                diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
+                errorFlag = true;
+            }
+
+            for (int i = 0; i < cell->readouts->n; i++) {
+                pmReadout *readout = cell->readouts->data[i];
+                if (readout->file_exists != correctStatus) {
+                    diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
+                    errorFlag = true;
+                }
+            }
+        }
+        ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to FALSE");
 
         // Second, set all flags to TRUE
         correctStatus = true;
-        rc = pmCellSetDataStatus(cell, correctStatus);
-        ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
-        errorFlag = false;
-        if (cell->data_exists != correctStatus) {
-            diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
-            errorFlag = true;
-        }
-        for (int i = 0; i < cell->readouts->n; i++) {
-            pmReadout *readout = cell->readouts->data[i];
-            if (readout->data_exists != correctStatus) {
-                diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell %d\n", i);
-                errorFlag = true;
-            }
-        }
-        ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to TRUE");
+        rc = pmChipSetFileStatus(chip, correctStatus);
+        ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
+        errorFlag = false;
+        if (chip->file_exists != correctStatus) {
+            diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
+            errorFlag = true;
+        }
+        for (int j = 0 ; j < chip->cells->n ; j++) {
+            pmCell *cell = chip->cells->data[j];
+            if (cell->file_exists != correctStatus) {
+                diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
+                errorFlag = true;
+            }
+
+            for (int i = 0; i < cell->readouts->n; i++) {
+                pmReadout *readout = cell->readouts->data[i];
+                if (readout->file_exists != correctStatus) {
+                    diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
+                    errorFlag = true;
+                }
+            }
+        }
+        ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to TRUE");
 
         // Third, set all flags to FALSE
         correctStatus = false;
-        rc = pmCellSetDataStatus(cell, correctStatus);
-        ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
-        errorFlag = false;
-        if (cell->data_exists != correctStatus) {
-            diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
-            errorFlag = true;
-        }
-        for (int i = 0; i < cell->readouts->n; i++) {
-            pmReadout *readout = cell->readouts->data[i];
-            if (readout->data_exists != correctStatus) {
-                diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for readout %d\n", i);
-                errorFlag = true;
-            }
-        }
-        ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to FALSE");
-
-        myFreeFPA(fpa);
+        rc = pmChipSetFileStatus(chip, correctStatus);
+        ok(rc, "pmChipSetFileStatus() returned successfully with acceptable input params");
+        errorFlag = false;
+        if (chip->file_exists != correctStatus) {
+            diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for chip param");
+            errorFlag = true;
+        }
+        for (int j = 0 ; j < chip->cells->n ; j++) {
+            pmCell *cell = chip->cells->data[j];
+            if (cell->file_exists != correctStatus) {
+                diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d\n", j);
+                errorFlag = true;
+            }
+
+            for (int i = 0; i < cell->readouts->n; i++) {
+                pmReadout *readout = cell->readouts->data[i];
+                if (readout->file_exists != correctStatus) {
+                    diag("TEST ERROR: pmChipSetFileStatus() failed to set file status for cell %d readout %d\n", j, i);
+                    errorFlag = true;
+                }
+            }
+        }
+        ok(!errorFlag, "pmChipSetFileStatus() set file status in all cells to FALSE");
+
+
+        psFree(fpa);
         psFree(camera);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -596,17 +459,15 @@
 
     // ----------------------------------------------------------------------
-    // ----------------------------------------------------------------------
-    // pmChipSetDataStatus() tests: verify with NULL pmChip param
-    // bool pmChipSetDataStatus(pmChip *chip, bool status)
-    {
-        psMemId id = psMemGetId();
-        bool rc = pmChipSetDataStatus(NULL, false);
-        ok(!rc, "pmChipSetDataStatus() returned FALSE with NULL pmChip param");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // pmChipSetDataStatus() tests: verify with acceptable data
-    // bool pmChipSetDataStatus(pmChip *chip, bool status)
+    // pmCellSetFileStatus() tests: verify with NULL pmCell param
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmCellSetFileStatus(NULL, false);
+        ok(!rc, "pmCellSetFileStatus() returned FALSE with NULL pmCell param");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // pmCellSetFileStatus() tests: verify with acceptable data
+    // bool pmCellSetFileStatus(pmCell *cell, bool status)
     {
         psMemId id = psMemGetId();
@@ -622,98 +483,148 @@
         // First, set all flags to FALSE
         bool correctStatus = false;
-        bool rc = pmChipSetDataStatus(chip, correctStatus);
-        ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
+        bool rc = pmCellSetFileStatus(cell, correctStatus);
+        ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
         bool errorFlag = false;
-        if (chip->data_exists != correctStatus) {
-            diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
-            errorFlag = true;
-        }
-        for (int j = 0 ; j < chip->cells->n ; j++) {
-            pmCell *cell = chip->cells->data[j];
-            if (cell->data_exists != correctStatus) {
-                diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
-                errorFlag = true;
-            }
-
-            for (int i = 0; i < cell->readouts->n; i++) {
-                pmReadout *readout = cell->readouts->data[i];
-                if (readout->data_exists != correctStatus) {
-                    diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
-                    errorFlag = true;
-                }
-            }
-        }
-        ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to FALSE");
+        if (cell->file_exists != correctStatus) {
+            diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
+            errorFlag = true;
+        }
+        for (int i = 0; i < cell->readouts->n; i++) {
+
+            pmReadout *readout = cell->readouts->data[i];
+            if (readout->file_exists != correctStatus) {
+                diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell %d\n", i);
+                errorFlag = true;
+            }
+        }
+        ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to FALSE");
 
         // Second, set all flags to TRUE
         correctStatus = true;
-        rc = pmChipSetDataStatus(chip, correctStatus);
-        ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
-        errorFlag = false;
-        if (chip->data_exists != correctStatus) {
-            diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
-            errorFlag = true;
-        }
-        for (int j = 0 ; j < chip->cells->n ; j++) {
-            pmCell *cell = chip->cells->data[j];
-            if (cell->data_exists != correctStatus) {
-                diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
-                errorFlag = true;
-            }
-
-            for (int i = 0; i < cell->readouts->n; i++) {
-                pmReadout *readout = cell->readouts->data[i];
-                if (readout->data_exists != correctStatus) {
-                    diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
-                    errorFlag = true;
-                }
-            }
-        }
-        ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to TRUE");
-
-        // ThirdSecond, set all flags to FALSE
+        rc = pmCellSetFileStatus(cell, correctStatus);
+        ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
+        errorFlag = false;
+        if (cell->file_exists != correctStatus) {
+            diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
+            errorFlag = true;
+        }
+        for (int i = 0; i < cell->readouts->n; i++) {
+            pmReadout *readout = cell->readouts->data[i];
+            if (readout->file_exists != correctStatus) {
+                diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell %d\n", i);
+                errorFlag = true;
+            }
+        }
+        ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to TRUE");
+
+        // Third, set all flags to FALSE
         correctStatus = false;
-        rc = pmChipSetDataStatus(chip, correctStatus);
-        ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
-        errorFlag = false;
-        if (chip->data_exists != correctStatus) {
-            diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
-            errorFlag = true;
-        }
-        for (int j = 0 ; j < chip->cells->n ; j++) {
-            pmCell *cell = chip->cells->data[j];
-            if (cell->data_exists != correctStatus) {
-                diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
-                errorFlag = true;
-            }
-
-            for (int i = 0; i < cell->readouts->n; i++) {
-                pmReadout *readout = cell->readouts->data[i];
-                if (readout->data_exists != correctStatus) {
-                    diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
-                    errorFlag = true;
-                }
-            }
-        }
-        ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to FALSE");
-
-
-        myFreeFPA(fpa);
+        rc = pmCellSetFileStatus(cell, correctStatus);
+        ok(rc, "pmCellSetFileStatus() returned successfully with acceptable input params");
+        errorFlag = false;
+        if (cell->file_exists != correctStatus) {
+            diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for cell param\n");
+            errorFlag = true;
+        }
+        for (int i = 0; i < cell->readouts->n; i++) {
+            pmReadout *readout = cell->readouts->data[i];
+            if (readout->file_exists != correctStatus) {
+                diag("TEST ERROR: pmCellSetFileStatus() failed to set file status for readout %d\n", i);
+                errorFlag = true;
+            }
+        }
+        ok(!errorFlag, "pmCellSetFileStatus() set file status in all cells to FALSE");
+
+        psFree(fpa);
         psFree(camera);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
 
-    // ----------------------------------------------------------------------
-    // ----------------------------------------------------------------------
-    // pmFPASetFileStatus() tests: verify with NULL pmFPA param
-    // bool pmFPASetFileStatus(pmFPA *fpa, bool status)
-    {
-        psMemId id = psMemGetId();
-        bool rc = pmFPASetFileStatus(NULL, false);
-        ok(!rc, "pmFPASetFileStatus() returned FALSE with NULL pmFPA param");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
+
+    // ----------------------------------------------------------------------
+    // pmFPACheckFileStatus() tests
+    // bool pmFPACheckFileStatus(const pmFPA *fpa)
+    // Call with NULL pmFPA input parameter
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmFPACheckFileStatus(NULL);
+        ok(rc == false, "pmFPACheckFileStatus() returned FALSE with NULL pmFPA input parameter");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Call with acceptable input parameters
+    {
+        psMemId id = psMemGetId();
+        pmFPA *fpa = generateSimpleFPA(NULL);
+        bool rc = pmFPACheckFileStatus(fpa);
+        ok(rc == false, "pmFPACheckFileStatus() returned FALSE with NULL pmFPA input parameter");
+        SetFPAFileExists(fpa);
+        rc = pmFPACheckFileStatus(fpa);
+        ok(rc == true, "pmFPACheckFileStatus() returned TRUE with NULL pmFPA input parameter");
+        psFree(fpa);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ----------------------------------------------------------------------
+    // pmChipCheckFileStatus() tests
+    // Call with NULL pmChip input parameter
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmChipCheckFileStatus(NULL);
+        ok(rc == false, "pmChipCheckFileStatus() returned FALSE with NULL pmChip input parameter");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Call with acceptable input parameter
+    {
+        psMemId id = psMemGetId();
+        pmChip *chip = generateSimpleChip(NULL);
+        bool rc = pmChipCheckFileStatus(chip);
+        ok(rc == false, "pmChipCheckFileStatus() returned FALSE with NULL pmChip input parameter");
+        SetChipFileExists(chip);
+        rc = pmChipCheckFileStatus(chip);
+        ok(rc == true, "pmChipCheckFileStatus() returned TRUE with NULL pmChip input parameter");
+        psFree(chip);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ----------------------------------------------------------------------
+    // pmCellCheckFileStatus() tests
+    // bool pmCellCheckFileStatus(const pmCell *cell)
+    // Call with NULL pmCell input parameter
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmCellCheckFileStatus(NULL);
+        ok(rc == false, "pmCellCheckFileStatus() returned FALSE with NULL pmCell input parameter");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Call with acceptable input parameters
+    {
+        psMemId id = psMemGetId();
+        pmCell *cell = generateSimpleCell(NULL);
+        bool rc = pmCellCheckFileStatus(cell);
+        ok(rc == false, "pmCellCheckFileStatus() returned FALSE with acceptable input parameters");
+        SetCellFileExists(cell);
+        rc = pmCellCheckFileStatus(cell);
+        ok(rc == true, "pmCellCheckFileStatus() returned TRUE with acceptable input parameters");
+        psFree(cell);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ----------------------------------------------------------------------
+    // pmFPASetDataStatus() tests: verify with NULL pmFPA param
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmFPASetDataStatus(NULL, false);
+        ok(!rc, "pmFPASetDataStatus() returned FALSE with NULL pmFPA param");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
 
 
@@ -806,8 +717,303 @@
         ok(!errorFlag, "pmFPASetDataStatus() set file status in all cells to FALSE");
 
-        myFreeFPA(fpa);
+        psFree(fpa);
         psFree(camera);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
 
-}
+
+    // ----------------------------------------------------------------------
+    // pmChipSetDataStatus() tests: verify with NULL pmChip param
+    // bool pmChipSetDataStatus(pmChip *chip, bool status)
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmChipSetDataStatus(NULL, false);
+        ok(!rc, "pmChipSetDataStatus() returned FALSE with NULL pmChip param");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // pmChipSetDataStatus() tests: verify with acceptable data
+    // bool pmChipSetDataStatus(pmChip *chip, bool status)
+    {
+        psMemId id = psMemGetId();
+        // Generate the pmFPA heirarchy
+        psMetadata *camera = psMetadataAlloc();
+        pmFPA* fpa = generateSimpleFPA(camera);
+        pmChip *chip = fpa->chips->data[0];
+        pmCell *cell = chip->cells->data[0];
+        ok(fpa != NULL, "Allocated a pmFPA successfully");
+        ok(chip != NULL, "Allocated a pmChip successfully");
+        ok(cell != NULL, "Allocated a pmCell successfully");
+
+        // First, set all flags to FALSE
+        bool correctStatus = false;
+        bool rc = pmChipSetDataStatus(chip, correctStatus);
+        ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
+        bool errorFlag = false;
+        if (chip->data_exists != correctStatus) {
+            diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
+            errorFlag = true;
+        }
+        for (int j = 0 ; j < chip->cells->n ; j++) {
+            pmCell *cell = chip->cells->data[j];
+            if (cell->data_exists != correctStatus) {
+                diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
+                errorFlag = true;
+            }
+
+            for (int i = 0; i < cell->readouts->n; i++) {
+                pmReadout *readout = cell->readouts->data[i];
+                if (readout->data_exists != correctStatus) {
+                    diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
+                    errorFlag = true;
+                }
+            }
+        }
+        ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to FALSE");
+
+        // Second, set all flags to TRUE
+        correctStatus = true;
+        rc = pmChipSetDataStatus(chip, correctStatus);
+        ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
+        errorFlag = false;
+        if (chip->data_exists != correctStatus) {
+            diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
+            errorFlag = true;
+        }
+        for (int j = 0 ; j < chip->cells->n ; j++) {
+            pmCell *cell = chip->cells->data[j];
+            if (cell->data_exists != correctStatus) {
+                diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
+                errorFlag = true;
+            }
+
+            for (int i = 0; i < cell->readouts->n; i++) {
+                pmReadout *readout = cell->readouts->data[i];
+                if (readout->data_exists != correctStatus) {
+                    diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
+                    errorFlag = true;
+                }
+            }
+        }
+        ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to TRUE");
+
+        // ThirdSecond, set all flags to FALSE
+        correctStatus = false;
+        rc = pmChipSetDataStatus(chip, correctStatus);
+        ok(rc, "pmChipSetDataStatus() returned successfully with acceptable input params");
+        errorFlag = false;
+        if (chip->data_exists != correctStatus) {
+            diag("TEST ERROR (a): pmChipSetDataStatus() failed to set file status for chip param\n");
+            errorFlag = true;
+        }
+        for (int j = 0 ; j < chip->cells->n ; j++) {
+            pmCell *cell = chip->cells->data[j];
+            if (cell->data_exists != correctStatus) {
+                diag("TEST ERROR (b): pmChipSetDataStatus() failed to set file status for cell %d\n", j);
+                errorFlag = true;
+            }
+
+            for (int i = 0; i < cell->readouts->n; i++) {
+                pmReadout *readout = cell->readouts->data[i];
+                if (readout->data_exists != correctStatus) {
+                    diag("TEST ERROR (c): pmChipSetDataStatus() failed to set file status for cell %d readout %d\n", j, i);
+                    errorFlag = true;
+                }
+            }
+        }
+        ok(!errorFlag, "pmChipSetDataStatus() set data status in all cells to FALSE");
+
+
+        psFree(fpa);
+        psFree(camera);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ----------------------------------------------------------------------
+    // pmCellSetDataStatus() tests: verify with NULL pmCell param
+    // bool pmCellSetDataStatus(pmCell *cell, bool status)
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmCellSetDataStatus(NULL, false);
+        ok(!rc, "pmCellSetDataStatus() returned FALSE with NULL pmCell param");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // pmCellSetDataStatus() tests: verify with acceptable data
+    // bool pmCellSetDataStatus(pmCell *cell, bool status)
+    {
+        psMemId id = psMemGetId();
+        // Generate the pmFPA heirarchy
+        psMetadata *camera = psMetadataAlloc();
+        pmFPA* fpa = generateSimpleFPA(camera);
+        pmChip *chip = fpa->chips->data[0];
+        pmCell *cell = chip->cells->data[0];
+        ok(fpa != NULL, "Allocated a pmFPA successfully");
+        ok(chip != NULL, "Allocated a pmChip successfully");
+        ok(cell != NULL, "Allocated a pmCell successfully");
+
+        // First, set all flags to FALSE
+        bool correctStatus = false;
+        bool rc = pmCellSetDataStatus(cell, correctStatus);
+        ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
+        bool errorFlag = false;
+        if (cell->data_exists != correctStatus) {
+            diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
+            errorFlag = true;
+        }
+        for (int i = 0; i < cell->readouts->n; i++) {
+            pmReadout *readout = cell->readouts->data[i];
+            if (readout->data_exists != correctStatus) {
+                diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell %d\n", i);
+                errorFlag = true;
+            }
+        }
+        ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to FALSE");
+
+        // Second, set all flags to TRUE
+        correctStatus = true;
+        rc = pmCellSetDataStatus(cell, correctStatus);
+        ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
+        errorFlag = false;
+        if (cell->data_exists != correctStatus) {
+            diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
+            errorFlag = true;
+        }
+        for (int i = 0; i < cell->readouts->n; i++) {
+            pmReadout *readout = cell->readouts->data[i];
+            if (readout->data_exists != correctStatus) {
+                diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell %d\n", i);
+                errorFlag = true;
+            }
+        }
+        ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to TRUE");
+
+        // Third, set all flags to FALSE
+        correctStatus = false;
+        rc = pmCellSetDataStatus(cell, correctStatus);
+        ok(rc, "pmCellSetDataStatus() returned successfully with acceptable input params");
+        errorFlag = false;
+        if (cell->data_exists != correctStatus) {
+            diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for cell param\n");
+            errorFlag = true;
+        }
+        for (int i = 0; i < cell->readouts->n; i++) {
+            pmReadout *readout = cell->readouts->data[i];
+            if (readout->data_exists != correctStatus) {
+                diag("TEST ERROR: pmCellSetDataStatus() failed to set file status for readout %d\n", i);
+                errorFlag = true;
+            }
+        }
+        ok(!errorFlag, "pmCellSetDataStatus() set data status in all cells to FALSE");
+
+        psFree(fpa);
+        psFree(camera);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ----------------------------------------------------------------------
+    // pmFPACheckDataStatus() tests
+    // bool pmFPACheckDataStatus(const pmFPA *fpa)
+    // Call with NULL pmFPA input parameter
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmFPACheckDataStatus(NULL);
+        ok(rc == false, "pmFPACheckDataStatus() returned FALSE with NULL pmFPA input parameter");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Call with acceptable input parameters
+    {
+        psMemId id = psMemGetId();
+        pmFPA *fpa = generateSimpleFPA(NULL);
+        bool rc = pmFPACheckDataStatus(fpa);
+        ok(rc == false, "pmFPACheckDataStatus() returned FALSE with NULL pmFPA input parameter");
+        SetFPADataExists(fpa);
+        rc = pmFPACheckDataStatus(fpa);
+        ok(rc == true, "pmFPACheckDataStatus() returned TRUE with NULL pmFPA input parameter");
+        psFree(fpa);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ----------------------------------------------------------------------
+    // pmChipCheckDataStatus() tests
+    // Call with NULL pmChip input parameter
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmChipCheckDataStatus(NULL);
+        ok(rc == false, "pmChipCheckDataStatus() returned FALSE with NULL pmChip input parameter");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Call with acceptable input parameter
+    {
+        psMemId id = psMemGetId();
+        pmChip *chip = generateSimpleChip(NULL);
+        bool rc = pmChipCheckDataStatus(chip);
+        ok(rc == false, "pmChipCheckDataStatus() returned FALSE with NULL pmChip input parameter");
+        SetChipDataExists(chip);
+        rc = pmChipCheckDataStatus(chip);
+        ok(rc == true, "pmChipCheckDataStatus() returned TRUE with NULL pmChip input parameter");
+        psFree(chip);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ----------------------------------------------------------------------
+    // pmCellCheckDataStatus() tests
+    // bool pmCellCheckDataStatus(const pmCell *cell)
+    // Call with NULL pmCell input parameter
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmCellCheckDataStatus(NULL);
+        ok(rc == false, "pmCellCheckDataStatus() returned FALSE with NULL pmCell input parameter");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Call with acceptable input parameters
+    {
+        psMemId id = psMemGetId();
+        pmCell *cell = generateSimpleCell(NULL);
+        bool rc = pmCellCheckDataStatus(cell);
+        ok(rc == false, "pmCellCheckDataStatus() returned FALSE with acceptable input parameters");
+        SetCellDataExists(cell);
+        rc = pmCellCheckDataStatus(cell);
+        ok(rc == true, "pmCellCheckDataStatus() returned TRUE with acceptable input parameters");
+        psFree(cell);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // ----------------------------------------------------------------------
+    // pmReadoutCheckDataStatus() tests
+    // bool pmReadoutCheckDataStatus(const pmReadout *readout)
+    // Call with NULL pmReadout input parameter
+    {
+        psMemId id = psMemGetId();
+        bool rc = pmReadoutCheckDataStatus(NULL);
+        ok(rc == false, "pmReadoutCheckDataStatus() returned FALSE with NULL pmReadout input parameter");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Call with acceptable input parameters
+    {
+        psMemId id = psMemGetId();
+        pmReadout *readout = generateSimpleReadout(NULL);
+        bool rc = pmReadoutCheckDataStatus(readout);
+        ok(rc == false, "pmReadoutCheckDataStatus() returned FALSE with acceptable input parameters");
+        SetReadoutDataExists(readout);
+        rc = pmReadoutCheckDataStatus(readout);
+        ok(rc == true, "pmReadoutCheckDataStatus() returned TRUE with acceptable input parameters");
+        psFree(readout);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+}
