Index: trunk/psLib/test/image/tst_psImage.c
===================================================================
--- trunk/psLib/test/image/tst_psImage.c	(revision 720)
+++ trunk/psLib/test/image/tst_psImage.c	(revision 733)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-05-18 23:28:33 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-05-19 02:16:58 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -25,6 +25,6 @@
 
 testDescription tests[] = {
-                              {testImageAlloc,"546-testImageAlloc",0},
-                              {testImageSubset,"547-testImageSubset",0},
+                              {testImageAlloc,"546/548-testImageAlloc/Free",0},
+                              {testImageSubset,"547/549-testImageSubset",0},
                               {NULL}
                           };
@@ -44,5 +44,5 @@
 int testImageAlloc(void)
 {
-
+    int currentId = psMemGetId();
     psImage* image = NULL;
     unsigned int sizes = 6;
@@ -217,7 +217,28 @@
             }
 
+            // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with no
+            // children is freed.
             psImageFree(image);
+            psMemCheckLeaks(currentId,NULL,NULL);
+            psMemCheckCorruption(1);
+
         }
     }
+
+    // #548: Verify program execution doesn't stop, if the input psImage structure pointer is null.
+    psImageFree(NULL);
+    psMemCheckLeaks(currentId,NULL,NULL);
+    psMemCheckCorruption(1);
+
+    // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with multiple
+    // children isfreed.
+    image = psImageAlloc(100,100,PS_TYPE_F32);
+    psImageSubset(NULL,image,50,50,0,0);
+    psImageSubset(NULL,image,50,50,20,20);
+
+    psImageFree(image);
+
+    psMemCheckLeaks(currentId,NULL,NULL);
+    psMemCheckCorruption(1);
 
     return 0;
@@ -227,4 +248,5 @@
 int testImageSubset(void)
 {
+    int currentId = psMemGetId();
     psImage preSubsetStruct;
     psImage* original;
@@ -442,5 +464,21 @@
     }
 
+    psLogMsg(__func__, PS_LOG_INFO, "psImageFreeChildren shall deallocate any children images of a "
+             "psImage structure");
+
+    psImageFreeChildren(original);
+
+    // Verify the returned psImage structure member Nchildren is set to zero.
+    if (original->nChildren != 0) {
+        psError(__func__,"psImageFreeChildren
+                row+cols).");
+        return 25;
+    }
+
+
+    psImageFree(original);
+    psMemCheckLeaks(currentId,NULL,NULL);
+    psMemCheckCorruption(1);
+
     return 0;
 }
-
