Index: /trunk/psLib/test/collections/tst_psList.c
===================================================================
--- /trunk/psLib/test/collections/tst_psList.c	(revision 3065)
+++ /trunk/psLib/test/collections/tst_psList.c	(revision 3066)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-20 00:30:05 $
+ *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-20 01:48:38 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -623,5 +623,7 @@
 
     // 2. which is PS_LIST_HEAD (remove first element of list)
-    data = psListGet(list,PS_LIST_HEAD);
+    psS32* data1 = (psS32 *)psListGet(list,PS_LIST_HEAD);
+    psMemIncrRefCounter(data1);
+    // Test requirement SDR-172, SDR-173
     if ( (! psListRemove(list,PS_LIST_HEAD)) ||
             (psListGet(list,PS_LIST_HEAD) == data) ) {
@@ -636,7 +638,14 @@
         return 1;
     }
+    // Test requirement SDR-176
+    if (psMemGetRefCounter(data1) != 1) {
+        psError(PS_ERR_UNKNOWN, true,"psListRemove didn't decrement the data reference count.");
+        return 20;
+    }
+    psMemDecrRefCounter(data1);
 
     // 3. which is PS_LIST_TAIL (remove last element of list)
     data = psListGet(list,PS_LIST_TAIL);
+    // Test requirement SDR-173
     if ( (! psListRemove(list,PS_LIST_TAIL)) ||
             (psListGet(list,PS_LIST_TAIL) == data) ) {
@@ -662,4 +671,5 @@
     // 7. which is PS_LIST_UNKNOWN and data=[head,tail,other list items]
     data = psListGet(list,PS_LIST_HEAD);
+    // Test requirement SDR-762
     if ( (! psListRemoveData(list,data)) ||
             (psListGet(list,PS_LIST_HEAD) == data) ) {
@@ -675,7 +685,8 @@
     }
 
-    data = psListGet(list,PS_LIST_TAIL);
-    if ( (!psListRemoveData(list,data)) ||
-            (psListGet(list,PS_LIST_TAIL) == data) ) {
+    psS32* data2 = psListGet(list,PS_LIST_TAIL);
+    psMemIncrRefCounter(data2);
+    if ( (!psListRemoveData(list,data2)) ||
+            (psListGet(list,PS_LIST_TAIL) == data2) ) {
         printListInt(list);
         psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_UNKNOWN @ PS_LIST_TAIL");
@@ -688,4 +699,10 @@
         return 1;
     }
+    // Test requirement SDR-176
+    if (psMemGetRefCounter(data2) != 1) {
+        psError(PS_ERR_UNKNOWN, true,"psListRemoveData didn't decrement the data reference count.");
+        return 20;
+    }
+    psMemDecrRefCounter(data2);
 
     data = psListGet(list,1);
@@ -705,4 +722,5 @@
     // 8. data!=NULL and data!=any element in list
     psLogMsg(__func__,PS_LOG_INFO,"Next message should be an error");
+    // Test requirement SDR-764
     if ( psListRemoveData(list,data) ) {
         printListInt(list);
@@ -735,4 +753,10 @@
         psError(PS_ERR_UNKNOWN, true,"Didn't remove all the elements.");
         return 1;
+    }
+
+    psLogMsg(__func__,PS_LOG_INFO,"NULL list in psListRemoveData should generate error message.");
+    if(psListRemoveData(NULL,data)) {
+        psError(PS_ERR_UNKNOWN,true,"psListRemoveData should have generated an error with NULL list");
+        return 2;
     }
 
Index: /trunk/psLib/test/collections/verified/tst_psList.stderr
===================================================================
--- /trunk/psLib/test/collections/verified/tst_psList.stderr	(revision 3065)
+++ /trunk/psLib/test/collections/verified/tst_psList.stderr	(revision 3066)
@@ -72,4 +72,8 @@
 <DATE><TIME>|<HOST>|E|psListRemoveData (psList.c:<LINENO>)
     Specified data item is not found in the psList.
+<DATE><TIME>|<HOST>|I|testListRemove
+    NULL list in psListRemoveData should generate error message.
+<DATE><TIME>|<HOST>|E|psListRemoveData (psList.c:<LINENO>)
+    Specified psList reference is NULL.
 
 ---> TESTPOINT PASSED (psList{psListRemove} | tst_psList.c)
