777 sq torture3: add LOCAL-G-LOCK7 test
authorStefan Metzmacher <metze@samba.org>
Wed, 20 Dec 2017 18:46:46 +0000 (19:46 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Oct 2019 13:33:03 +0000 (14:33 +0100)
source3/torture/test_g_lock.c

index dfacef5146cc1ffe86b1ef0c9d8c20d097c58092..44afaf1be5e935c4ce5e18d0b1f62950141dccd2 100644 (file)
@@ -923,17 +923,6 @@ static void lock7_parser(const struct g_lock_rec *locks,
                return;
        }
 
-       if (state->num_locks != num_locks) {
-               fprintf(stderr, "%s: state->num_locks=%zu != num_locks=%zu\n",
-                       state->location, state->num_locks, num_locks);
-               return;
-       }
-
-       if (state->num_locks == 0) {
-               state->ok = true;
-               return;
-       }
-
        for (i = 0; i < num_locks; i++) {
                if (locks[i].lock_type != state->lock_type) {
                        fprintf(stderr, "%s:[%zu] found type %d, expected %d\n",
@@ -972,6 +961,12 @@ static void lock7_parser(const struct g_lock_rec *locks,
                return;
        }
 
+       if (state->num_locks != num_locks) {
+               fprintf(stderr, "%s: state->num_locks=%zu != num_locks=%zu\n",
+                       state->location, state->num_locks, num_locks);
+               return;
+       }
+
        state->ok = true;
 }