Index: /trunk/psLib/test/image/tst_psImageStats01.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageStats01.c	(revision 1943)
+++ /trunk/psLib/test/image/tst_psImageStats01.c	(revision 1944)
@@ -89,6 +89,10 @@
                                  "psImageStats functions",
                                  "Calculate Sample Mean, no mask %d" );
-
+        psStats* tmpStats = myStats;
         myStats = psImageStats( myStats, tmpImage, NULL, 0 );
+        if ( myStats != tmpStats ) {
+            printf("ERROR: input psStats not equal to return psStats\n");
+            psAbort(__func__,"Failed input psStats equal to returned psStats");
+        }
         printf( "The sample mean was %.2f\n", myStats->sampleMean );
 
@@ -172,4 +176,20 @@
     }
 
+    tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32);
+    tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U32);
+    myStats = psStatsAlloc( PS_STAT_SAMPLE_MEAN );
+    myStats2 = psImageStats( myStats, tmpImage, tmpMask, 0 );
+    if ( myStats2 != NULL ) {
+        printf( "ERROR: psImageStats did not return null when mask is invalid type.\n");
+    }
+    psFree(tmpImage);
+    psFree(tmpMask);
+    psFree(myStats);
+    psMemCheckCorruption(1);
+    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
+    if( memLeaks != 0 ) {
+        psAbort(__func__, "Memory Leaks! (%d leaks)", memLeaks);
+    }
+
     printFooter( stdout,
                  "psImageStats functions",
Index: /trunk/psLib/test/image/verified/tst_psImageStats01.stderr
===================================================================
--- /trunk/psLib/test/image/verified/tst_psImageStats01.stderr	(revision 1943)
+++ /trunk/psLib/test/image/verified/tst_psImageStats01.stderr	(revision 1944)
@@ -5,2 +5,4 @@
 <DATE><TIME>|<HOST>|E|psLib.image.psImageStats
     Specified statistic option did not indicate any operation to perform.
+<DATE><TIME>|<HOST>|E|psLib.image.psImageStats
+    Input psImage mask type, psU32, is not the supported mask datatype of psU8.
