ldb tests: fix null test on incorrect variable
authorGary Lockyer <gary@catalyst.net.nz>
Fri, 23 Feb 2018 02:03:20 +0000 (15:03 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 24 Feb 2018 14:50:35 +0000 (15:50 +0100)
Fix up tests that were  performing a null check on the wrong variable
after a call to ldb_msg_new

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Feb 24 15:50:35 CET 2018 on sn-devel-144

lib/ldb/tests/ldb_mod_op_test.c

index cf2288c7bce1cb2411d003b20e3b28f84d72302e..0190936231b66664498e2735bed26c2d8ec4a5a7 100644 (file)
@@ -3226,7 +3226,7 @@ static void test_ldb_add_duplicate_value_to_unique_index(void **state)
        assert_int_equal(ret, LDB_SUCCESS);
 
        msg02 = ldb_msg_new(tmp_ctx);
-       assert_non_null(msg01);
+       assert_non_null(msg02);
 
        msg02->dn = ldb_dn_new_fmt(msg02, test_ctx->ldb, "dc=test02");
        assert_non_null(msg02->dn);
@@ -3267,7 +3267,7 @@ static void test_ldb_add_to_index_duplicates_allowed(void **state)
        assert_int_equal(ret, LDB_SUCCESS);
 
        msg02 = ldb_msg_new(tmp_ctx);
-       assert_non_null(msg01);
+       assert_non_null(msg02);
 
        msg02->dn = ldb_dn_new_fmt(msg02, test_ctx->ldb, "dc=test02");
        assert_non_null(msg02->dn);