From: Andreas Schneider Date: Fri, 18 Nov 2016 09:51:57 +0000 (+0100) Subject: lib:torture: Make variables const X-Git-Tag: samba-4.4.9~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d55997759bb27072335253864ab2c58e51130f1;p=thirdparty%2Fsamba.git lib:torture: Make variables const BUG: https://bugzilla.samba.org/show_bug.cgi?id=12415 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison (cherry picked from commit 9c0f2576d8aa3dd95be1c5ddda2b10d891add0bc) --- diff --git a/lib/torture/torture.h b/lib/torture/torture.h index e710873fb39..05c59e68f00 100644 --- a/lib/torture/torture.h +++ b/lib/torture/torture.h @@ -503,7 +503,7 @@ void torture_result(struct torture_context *test, } while(0) #define torture_assert_guid_equal(torture_ctx,got,expected,cmt)\ - do { struct GUID __got = (got), __expected = (expected); \ + do {const struct GUID __got = (got), __expected = (expected); \ if (!GUID_equal(&__got, &__expected)) { \ torture_result(torture_ctx, TORTURE_FAIL, \ __location__": "#got" was %s, expected %s: %s", \ @@ -521,7 +521,7 @@ void torture_result(struct torture_context *test, } while(0) #define torture_assert_sid_equal(torture_ctx,got,expected,cmt)\ - do { struct dom_sid *__got = (got), *__expected = (expected); \ + do {const struct dom_sid *__got = (got), *__expected = (expected); \ if (!dom_sid_equal(__got, __expected)) { \ torture_result(torture_ctx, TORTURE_FAIL, \ __location__": "#got" was %s, expected %s: %s", \ @@ -531,7 +531,7 @@ void torture_result(struct torture_context *test, } while(0) #define torture_assert_not_null(torture_ctx,got,cmt)\ - do { void *__got = (got); \ + do {const void *__got = (got); \ if (__got == NULL) { \ torture_result(torture_ctx, TORTURE_FAIL, \ __location__": "#got" was NULL, expected != NULL: %s", \ @@ -541,7 +541,7 @@ void torture_result(struct torture_context *test, } while(0) #define torture_assert_not_null_goto(torture_ctx,got,ret,label,cmt)\ - do { void *__got = (got); \ + do {const void *__got = (got); \ if (__got == NULL) { \ torture_result(torture_ctx, TORTURE_FAIL, \ __location__": "#got" was NULL, expected != NULL: %s", \