Index: /trunk/psLib/test/collections/Makefile
===================================================================
--- /trunk/psLib/test/collections/Makefile	(revision 732)
+++ /trunk/psLib/test/collections/Makefile	(revision 733)
@@ -3,6 +3,6 @@
 ##  Makefile:   test/collections
 ##
-##  $Revision: 1.5 $  $Name: not supported by cvs2svn $
-##  $Date: 2004-05-18 02:34:00 $
+##  $Revision: 1.6 $  $Name: not supported by cvs2svn $
+##  $Date: 2004-05-19 02:16:58 $
 ##
 ##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -53,11 +53,15 @@
 
 %.o : %.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -I$(PSLIB_INCL_DIR) -c -o $@ $< 
+	$(CC) $(CFLAGS) $(CPPFLAGS) -I$(PSLIB_INCL_DIR) -c -o $@ $<
 
 %   : %.o
-	$(CC) $(LDFLAGS) -L$(PSLIB_LIB_DIR) -lpslib -lpstest -o $@ $< 
+	$(CC) $(LDFLAGS) -L$(PSLIB_LIB_DIR) -lpslib -lpstest -o $@ $<
 
 %.lint: %.c
 	splint +posixlib -exportlocal -realcompare $(INCLUDE_GLOBAL) $? > $@; cat $@
 
+%.d: %.c
+	$(CC) -M $(CFLAGS) $< > $@.tmp
+	sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' $@.tmp > $@
+	$(RM) -f $@.tmp
 
Index: /trunk/psLib/test/image/tst_psImage.c
===================================================================
--- /trunk/psLib/test/image/tst_psImage.c	(revision 732)
+++ /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;
 }
-
