Index: trunk/psLib/test/dataManip/tst_psRandom.c
===================================================================
--- trunk/psLib/test/dataManip/tst_psRandom.c	(revision 2780)
+++ trunk/psLib/test/dataManip/tst_psRandom.c	(revision 2995)
@@ -46,16 +46,38 @@
                             "psRandomAlloc()");
 
-    myRNG = psRandomAlloc(PS_RANDOM_TAUS, SEED);
-    if (myRNG == NULL) {
-        printf("ERROR: Could not allocate psRandom structure\n");
-        testStatus = false;
-    }
-
-    psMemCheckCorruption(1);
-    psFree(myRNG);
-    psMemCheckCorruption(1);
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if (0 != memLeaks) {
-        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
+    // Valid type allocation
+    myRNG = psRandomAlloc(PS_RANDOM_TAUS, SEED);
+    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");
+        testStatus = false;
+    }
+    psFree(myRNG);
+
+    // Invalid type allocation
+    psLogMsg(__func__,PS_LOG_INFO,"Invalid type, should generate error message");
+    myRNG = psRandomAlloc(100,SEED);
+    if (myRNG != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for invalid type");
+        testStatus = false;
+    }
+
+    // Negative seed value
+    myRNG = psRandomAlloc(PS_RANDOM_TAUS,-5);
+    if(myRNG == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return allocated psRandom");
+        testStatus = false;
+    }
+    psFree(myRNG);
+
+    psMemCheckCorruption(1);
+    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
+    if (0 != memLeaks) {
+        printf("ERROR: Memory Leaks! (%d leaks)", memLeaks);
+        testStatus = false;
     }
 
