s4-torture: remove an CHECK_STATUS macro in the util code.
authorGünther Deschner <gd@samba.org>
Fri, 30 Sep 2016 03:03:17 +0000 (05:03 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 25 Jun 2018 12:56:38 +0000 (14:56 +0200)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Pair-Programmed-With: Jose A. Rivera <jarrpa@samba.org>

source4/torture/smb2/util.c

index 65090b0e8b75f9ab6c57c00e2c5d9aa7de8601ed..1108a66e39931454a5ab95f18362e63e33f61359 100644 (file)
@@ -641,14 +641,6 @@ bool smb2_util_setup_dir(struct torture_context *tctx, struct smb2_tree *tree,
        return true;
 }
 
-#define CHECK_STATUS(status, correct) do { \
-       if (!NT_STATUS_EQUAL(status, correct)) { \
-               torture_result(tctx, TORTURE_FAIL, "(%s) Incorrect status %s - should be %s\n", \
-                      __location__, nt_errstr(status), nt_errstr(correct)); \
-               ret = false; \
-               goto done; \
-       }} while (0)
-
 /*
  * Helper function to verify a security descriptor, by querying
  * and comparing against the passed in sd.
@@ -667,7 +659,7 @@ bool smb2_util_verify_sd(TALLOC_CTX *tctx, struct smb2_tree *tree,
            SECINFO_GROUP |
            SECINFO_DACL;
        status = smb2_getinfo_file(tree, tctx, &q);
-       CHECK_STATUS(status, NT_STATUS_OK);
+       torture_assert_ntstatus_ok(tctx, status, "");
 
        if (!security_acl_equal(
            q.query_secdesc.out.sd->dacl, sd->dacl)) {
@@ -681,7 +673,6 @@ bool smb2_util_verify_sd(TALLOC_CTX *tctx, struct smb2_tree *tree,
                ret = false;
        }
 
- done:
        return ret;
 }
 
@@ -699,7 +690,7 @@ bool smb2_util_verify_attrib(TALLOC_CTX *tctx, struct smb2_tree *tree,
        q.standard.level = RAW_FILEINFO_SMB2_ALL_INFORMATION;
        q.standard.in.file.handle = handle;
        status = smb2_getinfo_file(tree, tctx, &q);
-       CHECK_STATUS(status, NT_STATUS_OK);
+       torture_assert_ntstatus_ok(tctx, status, "");
 
        q.all_info2.out.attrib &= ~(FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_NONINDEXED);
 
@@ -711,7 +702,6 @@ bool smb2_util_verify_attrib(TALLOC_CTX *tctx, struct smb2_tree *tree,
                ret = false;
        }
 
- done:
        return ret;
 }