Index: trunk/ippdb/tests/alloc.c
===================================================================
--- trunk/ippdb/tests/alloc.c	(revision 7501)
+++ trunk/ippdb/tests/alloc.c	(revision 8007)
@@ -880,15 +880,15 @@
         detRunRow       *object;
 
-        object = detRunRowAlloc("a string", -32    );
-
-        if (!object) {
-            exit(EXIT_FAILURE);
-        }
-
+        object = detRunRowAlloc(-32, "a string"    );
+
+        if (!object) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
         if (strncmp(object->det_type, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
             psFree(object);
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/insert.c
===================================================================
--- trunk/ippdb/tests/insert.c	(revision 7501)
+++ trunk/ippdb/tests/insert.c	(revision 8007)
@@ -343,5 +343,5 @@
         }
 
-        if (!detRunInsert(dbh, "a string", -32)) {
+        if (!detRunInsert(dbh, -32, "a string")) {
             exit(EXIT_FAILURE);
         }
Index: trunk/ippdb/tests/insertobject.c
===================================================================
--- trunk/ippdb/tests/insertobject.c	(revision 7501)
+++ trunk/ippdb/tests/insertobject.c	(revision 8007)
@@ -498,5 +498,5 @@
         }
 
-        object = detRunRowAlloc("a string", -32);
+        object = detRunRowAlloc(-32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/metadatafromobject.c
===================================================================
--- trunk/ippdb/tests/metadatafromobject.c	(revision 7501)
+++ trunk/ippdb/tests/metadatafromobject.c	(revision 8007)
@@ -1059,5 +1059,5 @@
         bool            status;
 
-        object = detRunRowAlloc("a string", -32);
+        object = detRunRowAlloc(-32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -1071,9 +1071,9 @@
         psFree(object);
 
+        if (!psMetadataLookupS32(&status, md, "iteration") == -32) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
         if (strncmp(psMetadataLookupPtr(&status, md, "det_type"), "a string", MAX_STRING_LENGTH)) {
-            psFree(md);
-            exit(EXIT_FAILURE);
-        }
-        if (!psMetadataLookupS32(&status, md, "iteration") == -32) {
             psFree(md);
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/objectfrommetadata.c
===================================================================
--- trunk/ippdb/tests/objectfrommetadata.c	(revision 7501)
+++ trunk/ippdb/tests/objectfrommetadata.c	(revision 8007)
@@ -1577,12 +1577,12 @@
 
         md = psMetadataAlloc();
+        if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
         if (!psMetadataAddStr(md, PS_LIST_TAIL, "det_type", 0, NULL, "a string")) {
             psFree(md);
             exit(EXIT_FAILURE);
         }
-        if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) {
-            psFree(md);
-            exit(EXIT_FAILURE);
-        }
 
         object = detRunObjectFromMetadata(md);
@@ -1594,9 +1594,9 @@
         psFree(md);
 
+        if (!object->iteration == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
         if (strncmp(object->det_type, "a string", MAX_STRING_LENGTH)) {
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
-        if (!object->iteration == -32) {
             psFree(object);
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/pop.c
===================================================================
--- trunk/ippdb/tests/pop.c	(revision 7501)
+++ trunk/ippdb/tests/pop.c	(revision 8007)
@@ -483,13 +483,13 @@
     {
         psDB            *dbh;
+        psS32           iteration;
         char            det_type[256];
-        psS32           iteration;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!detRunPop(dbh, (char **)&det_type, &iteration)) { 
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!detRunPop(dbh, &iteration, (char **)&det_type)) { 
             exit(EXIT_FAILURE);
         }
