Index: /trunk/psLib/test/dataManip/tst_psRandom.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psRandom.c	(revision 3006)
+++ /trunk/psLib/test/dataManip/tst_psRandom.c	(revision 3007)
@@ -52,5 +52,16 @@
         testStatus = false;
     }
-
+    if (myRNG->type != PS_RANDOM_TAUS) {
+        psError(PS_ERR_UNKNOWN,true,"Did not have the expected type");
+        testStatus = false;
+    }
+    psFree(myRNG);
+
+    // Valid type allocation with seed equal to zero
+    myRNG = psRandomAlloc(PS_RANDOM_TAUS, 0);
+    if (myRNG == NULL) {
+        printf("ERROR: Could not allocate psRandom structure\n");
+        testStatus = false;
+    }
     if (myRNG->type != PS_RANDOM_TAUS) {
         psError(PS_ERR_UNKNOWN,true,"Did not have the expected type");
@@ -130,4 +141,11 @@
     psFree(rans);
     psFree(stats);
+
+    psLogMsg(__func__,PS_LOG_INFO,"NULL psRandom variable, should generate error message");
+    if(psRandomUniform(NULL) != 0) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return zero for null psRandom");
+        testStatus = false;
+    }
+
     psMemCheckCorruption(1);
     memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
@@ -184,4 +202,11 @@
     psFree(rans);
     psFree(stats);
+
+    psLogMsg(__func__,PS_LOG_INFO,"NULL psRandom variable, should generate error message");
+    if(psRandomGaussian(NULL) != 0) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return zero for null psRandom");
+        testStatus = false;
+    }
+
     psMemCheckCorruption(1);
     memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
@@ -239,4 +264,11 @@
     psFree(rans);
     psFree(stats);
+
+    psLogMsg(__func__,PS_LOG_INFO,"NULL psRandom variable, should generate error message");
+    if(psRandomPoisson(NULL, POISSON_MEAN) != 0) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return zero for null psRandom");
+        testStatus = false;
+    }
+
     psMemCheckCorruption(1);
     memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
@@ -294,4 +326,13 @@
     psFree(rans01);
     psFree(rans02);
+
+    psRandom *myRNG1 = NULL;
+    myRNG1 = psRandomAlloc(PS_RANDOM_TAUS, SEED);
+    psRandomReset(myRNG1,0);
+    psFree(myRNG1);
+
+    psLogMsg(__func__,PS_LOG_INFO,"Reset a NULL psRandom variable, should generate an error message");
+    psRandomReset(NULL,SEED);
+
     psMemCheckCorruption(1);
     memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
