s4-smbtorture: use standard macros in smb2.read test
authorUri Simchoni <uri@samba.org>
Thu, 4 Aug 2016 09:59:38 +0000 (12:59 +0300)
committerKarolin Seeger <kseeger@samba.org>
Tue, 13 Sep 2016 10:27:27 +0000 (12:27 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12149

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
(cherry picked from commit 20b9a5bd74fafbca4b7cc7952c27033edcf0eeb8)

source4/torture/smb2/read.c

index 3600765c8e966199bf54e86bc0021794411de446..c1105a9d26226ad3a45fd481c32a14b3c9113d88 100644 (file)
 #include "torture/smb2/proto.h"
 
 
-#define CHECK_STATUS(status, correct) do { \
-       if (!NT_STATUS_EQUAL(status, correct)) { \
-               printf("(%s) Incorrect status %s - should be %s\n", \
-                      __location__, nt_errstr(status), nt_errstr(correct)); \
-               ret = false; \
-               goto done; \
-       }} while (0)
-
-#define CHECK_VALUE(v, correct) do { \
-       if ((v) != (correct)) { \
-               printf("(%s) Incorrect value %s=%u - should be %u\n", \
-                      __location__, #v, (unsigned)v, (unsigned)correct); \
-               ret = false; \
-               goto done; \
-       }} while (0)
+#define CHECK_STATUS(_status, _expected) \
+       torture_assert_ntstatus_equal_goto(torture, _status, _expected, \
+                ret, done, "Incorrect status")
+
+#define CHECK_VALUE(v, correct) \
+       torture_assert_int_equal_goto(torture, v, correct, \
+                ret, done, "Incorrect value")
 
 #define FNAME "smb2_readtest.dat"
 #define DNAME "smb2_readtest.dir"