s3-torture: run_locktest2(): replace check_error() with check_both_error()
authorBjörn Baumbach <bb@sernet.de>
Mon, 11 Jul 2011 12:23:30 +0000 (14:23 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 11 Jul 2011 14:35:11 +0000 (16:35 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/torture/torture.c

index ee84afc30b8ce0cc53bfef59bfb3f83130dd761d..d40d5aa26cd86617b1653d85fa10c4eca1a294d7 100644 (file)
@@ -1692,22 +1692,26 @@ static bool run_locktest2(int dummy)
                correct = False;
        }
 
-       if (NT_STATUS_IS_OK(cli_unlock(cli, fnum1, 0, 4))) {
+       status = cli_unlock(cli, fnum1, 0, 4);
+       if (NT_STATUS_IS_OK(status)) {
                printf("unlock1 succeeded! This is a locking bug\n");
-               correct = False;
+               correct = false;
        } else {
-               if (!check_error(__LINE__, cli, 
-                                ERRDOS, ERRlock, 
-                                NT_STATUS_RANGE_NOT_LOCKED)) return False;
+               if (!check_both_error(__LINE__, status, ERRDOS, ERRlock,
+                                     NT_STATUS_RANGE_NOT_LOCKED)) {
+                       return false;
+               }
        }
 
-       if (NT_STATUS_IS_OK(cli_unlock(cli, fnum1, 0, 8))) {
+       status = cli_unlock(cli, fnum1, 0, 8);
+       if (NT_STATUS_IS_OK(status)) {
                printf("unlock2 succeeded! This is a locking bug\n");
-               correct = False;
+               correct = false;
        } else {
-               if (!check_error(__LINE__, cli, 
-                                ERRDOS, ERRlock, 
-                                NT_STATUS_RANGE_NOT_LOCKED)) return False;
+               if (!check_both_error(__LINE__, status, ERRDOS, ERRlock,
+                                     NT_STATUS_RANGE_NOT_LOCKED)) {
+                       return false;
+               }
        }
 
        status = cli_lock32(cli, fnum3, 0, 4, 0, WRITE_LOCK);