From 5499cff2014e64ab9b40f038631a9b8eb847ca03 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 22 Jun 2016 15:15:05 +0200 Subject: [PATCH] s3-torture: Do some code hygiene in the ldb test Coverity is confused if in a expresion we use = and not ==. Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- source4/torture/ldb/ldb.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source4/torture/ldb/ldb.c b/source4/torture/ldb/ldb.c index 62104197ad5..7ea9726d520 100644 --- a/source4/torture/ldb/ldb.c +++ b/source4/torture/ldb/ldb.c @@ -1084,8 +1084,9 @@ static bool torture_ldb_unpack(struct torture_context *torture) const char *ldif_text = dda1d01d_ldif; struct ldb_ldif ldif; + ldb = samba_ldb_init(mem_ctx, torture->ev, NULL, NULL, NULL); torture_assert(torture, - ldb = samba_ldb_init(mem_ctx, torture->ev, NULL, NULL, NULL), + ldb != NULL, "Failed to init ldb"); torture_assert_int_equal(torture, ldb_unpack_data(ldb, &data, msg), 0, @@ -1111,12 +1112,14 @@ static bool torture_ldb_parse_ldif(struct torture_context *torture) struct ldb_val data = data_blob_const(dda1d01d_bin, sizeof(dda1d01d_bin)); struct ldb_message *msg = ldb_msg_new(mem_ctx); + ldb = samba_ldb_init(mem_ctx, torture->ev, NULL,NULL,NULL); torture_assert(torture, - ldb=samba_ldb_init(mem_ctx, torture->ev, NULL,NULL,NULL), + ldb != NULL, "Failed to init ldb"); + ldif = ldb_ldif_read_string(ldb, &ldif_text); torture_assert(torture, - ldif = ldb_ldif_read_string(ldb, &ldif_text), + ldif != NULL, "ldb_ldif_read_string failed"); torture_assert_int_equal(torture, ldif->changetype, LDB_CHANGETYPE_NONE, "changetype is incorrect"); @@ -1147,8 +1150,9 @@ static bool torture_ldb_unpack_only_attr_list(struct torture_context *torture) const char *ldif_text; struct ldb_ldif ldif; + ldb = samba_ldb_init(mem_ctx, torture->ev, NULL, NULL, NULL); torture_assert(torture, - ldb=samba_ldb_init(mem_ctx, torture->ev, NULL, NULL, NULL), + ldb != NULL, "Failed to init samba"); torture_assert_int_equal(torture,