[PVFS2-CVS] commit by neill in pvfs2/test/io/trove: test-trove-cancel.c

CVS commit program cvs at parl.clemson.edu
Tue Feb 3 15:12:15 EST 2004


Update of /projects/cvsroot/pvfs2/test/io/trove
In directory acid:/tmp/cvs-serv15198/test/io/trove

Modified Files:
	test-trove-cancel.c 
Log Message:
- minor cleanups
- enhance test-trove-cancel test program to remove dspace if it already exists
  on startup


Index: test-trove-cancel.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/test/io/trove/test-trove-cancel.c,v
diff -p -u -r1.3 -r1.4
--- test-trove-cancel.c	3 Feb 2004 19:58:48 -0000	1.3
+++ test-trove-cancel.c	3 Feb 2004 20:12:15 -0000	1.4
@@ -119,6 +119,17 @@ int main(int argc, char **argv)	
 
     file_handle = 0;
 
+    /* first remove the file handle we're about to use if it exists */
+    ret = trove_dspace_remove(coll_id, requested_file_handle,
+                              0, NULL, trove_context, &op_id);
+
+    while (ret == 0)
+    {
+        ret = trove_dspace_test(
+            coll_id, op_id, trove_context, &count, NULL, NULL, &state,
+            TROVE_DEFAULT_TEST_TIMEOUT);
+    }
+
     cur_extent.first = cur_extent.last = requested_file_handle;
     extent_array.extent_count = 1;
     extent_array.extent_array = &cur_extent;
@@ -131,10 +142,14 @@ int main(int argc, char **argv)	
                               NULL,
                               trove_context,
                               &op_id);
-    while (ret == 0) ret = trove_dspace_test(
-        coll_id, op_id, trove_context, &count, NULL, NULL, &state,
-        TROVE_DEFAULT_TEST_TIMEOUT);
-    if (ret < 0)
+    while (ret == 0)
+    {
+        ret = trove_dspace_test(
+            coll_id, op_id, trove_context, &count, NULL, NULL, &state,
+            TROVE_DEFAULT_TEST_TIMEOUT);
+    }
+
+    if ((ret < 0) || (file_handle == TROVE_HANDLE_NULL))
     {
         fprintf(stderr, "dspace create failed.\n");
         return -1;



More information about the PVFS2-CVS mailing list