s3-torture: Do some code hygiene in the ldb test
authorAndreas Schneider <asn@samba.org>
Wed, 22 Jun 2016 13:15:05 +0000 (15:15 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 22 Jun 2016 17:25:20 +0000 (19:25 +0200)
Coverity is confused if in a expresion we use = and not ==.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/ldb/ldb.c

index 62104197ad59d37b8e89c806c293c458f5d203ea..7ea9726d520d56f71a19bf79d3e242caf735d265 100644 (file)
@@ -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,