From 148b8588bc7864f4771c8dcf21cfdc150b22e701 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Fri, 16 Jul 2010 13:38:09 +0300 Subject: s4-test: Use ldb_msg_difference() in torture/rpc/dssync.c test Signed-off-by: Andrew Bartlett --- source4/torture/rpc/dssync.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c index 5e5929f734..150db42e96 100644 --- a/source4/torture/rpc/dssync.c +++ b/source4/torture/rpc/dssync.c @@ -575,8 +575,9 @@ static bool test_analyse_objects(struct torture_context *tctx, } - new_msg = ldb_msg_diff(ldb, drs_msg, ldap_msg); - talloc_steal(search_req, new_msg); + ret = ldb_msg_difference(ldb, search_req, + drs_msg, ldap_msg, &new_msg); + torture_assert(tctx, ret == LDB_SUCCESS, "ldb_msg_difference() has failed"); if (new_msg->num_elements != 0) { char *s; struct ldb_ldif ldif; @@ -585,7 +586,9 @@ static bool test_analyse_objects(struct torture_context *tctx, s = ldb_ldif_write_string(ldb, new_msg, &ldif); s = talloc_asprintf(tctx, "\n# Difference in between DRS and LDAP objects: \n%s\n", s); - ldif.msg = ldb_msg_diff(ldb, ldap_msg, drs_msg); + ret = ldb_msg_difference(ldb, search_req, + ldap_msg, drs_msg, &ldif.msg); + torture_assert(tctx, ret == LDB_SUCCESS, "ldb_msg_difference() has failed"); s = talloc_asprintf_append(s, "\n# Difference in between LDAP and DRS objects: \n%s\n", ldb_ldif_write_string(ldb, new_msg, &ldif)); -- cgit From 91d9f88d28e58157ca63caeb76ff779321d7bb53 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Fri, 16 Jul 2010 14:13:20 +0300 Subject: s4-test: Use ldb_msg_normalize() in torture/rpc/dssync.c test Signed-off-by: Andrew Bartlett --- source4/torture/rpc/dssync.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c index 150db42e96..860c3ebfcf 100644 --- a/source4/torture/rpc/dssync.c +++ b/source4/torture/rpc/dssync.c @@ -538,8 +538,10 @@ static bool test_analyse_objects(struct torture_context *tctx, } } - drs_msg = ldb_msg_canonicalize(ldb, objs->objects[i].msg); - talloc_steal(search_req, drs_msg); + ret = ldb_msg_normalize(ldb, search_req, + objs->objects[i].msg, &drs_msg); + torture_assert(tctx, ret == LDB_SUCCESS, + "ldb_msg_normalize() has failed"); for (j=0; j < drs_msg->num_elements; j++) { if (drs_msg->elements[j].num_values == 0) { -- cgit