s4:torture Use (some) torture_assert() calls in RPC-DSSYNC test
authorAndrew Bartlett <abartlet@samba.org>
Thu, 12 Nov 2009 04:37:34 +0000 (15:37 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Nov 2009 05:34:23 +0000 (16:34 +1100)
source4/torture/rpc/dssync.c

index 705d060d3b086dcbe8fadf0187012eb3f808b900..907474fc5795ad7157b86a2374213e7128d447bc 100644 (file)
@@ -506,12 +506,9 @@ static bool test_analyse_objects(struct torture_context *tctx,
 
                if (ret != LDB_SUCCESS) {
                        DEBUG(0, ("Could not re-fetch object just delivered over DRS: %s", ldb_errstring(ldb)));
-                       return false;
-               }
-               if (res->count != 1) {
-                       DEBUG(0, ("Could not re-fetch object just delivered over DRS"));
-                       return false;
+                       torture_assert_int_equal(tctx, ret, LDB_SUCCESS, "Could not re-fetch object just delivered over DRS");
                }
+               torture_assert_int_equal(tctx, res->count, 1, "Could not re-fetch object just delivered over DRS");
                ldap_msg = res->msgs[0];
                for (j=0; j < ldap_msg->num_elements; j++) {
                        ldap_msg->elements[j].flags = LDB_FLAG_MOD_ADD;
@@ -562,6 +559,8 @@ static bool test_analyse_objects(struct torture_context *tctx,
                        ldif.msg = new_msg;
                        s = ldb_ldif_write_string(ldb, new_msg, &ldif);
                        DEBUG(0, ("Difference in between DRS and LDAP objects: %s\n", s));
+                       talloc_free(search_req);
+                       torture_assert_int_equal(tctx, new_msg->num_elements, 0, "Should have no objects in 'difference' message");
                }
                talloc_free(search_req);
        }