Remove the use of goto from test/csync/std_tests/check_std_c_jhash.c
authorHannah von Reth <hannah.vonreth@owncloud.com>
Mon, 10 Aug 2020 14:22:56 +0000 (16:22 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:59:19 +0000 (10:59 +0100)
test/csync/std_tests/check_std_c_jhash.c

index 88fc0734f297de8c12293cc185fca46875c696db..38b31c49622a8c7219c7954b30455a64a3bf15e4 100644 (file)
@@ -68,15 +68,16 @@ static void check_c_jhash_trials(void **state)
                     e[0], f[0], g[0], h[0], x[0], y[0]);
              print_error("i %d j %d m %d len %d\n",i,j,m,hlen);
           }
-          if (z==MAXPAIR) goto done;
+          if (z == MAXPAIR) {
+              if (z < MAXPAIR) {
+                  assert_true(z < MAXPAIR);
+                  // print_error("%u trials needed, should be less than 40\n", z/2);
+                  return;
+              }
+          }
         }
       }
     }
-   done:
-    if (z < MAXPAIR) {
-        assert_true(z < MAXPAIR);
-        // print_error("%u trials needed, should be less than 40\n", z/2);
-    }
   }
 }
 
@@ -210,16 +211,17 @@ static void check_c_jhash64_trials(void **state)
                          (uint32_t)i,(uint32_t)j,(uint32_t)m,(uint32_t)hlen);
 #endif
           }
-          if (z==MAXPAIR) goto done;
-        }
-      }
-    }
-   done:
-    if (z < MAXPAIR) {
+          if (z == MAXPAIR) {
+              if (z < MAXPAIR) {
 #if 0
-        print_error("%lu trials needed, should be less than 40", z/2);
+                  print_error("%lu trials needed, should be less than 40", z/2);
 #endif
-        assert_true(z < MAXPAIR);
+                  assert_true(z < MAXPAIR);
+              }
+              return;
+          }
+        }
+      }
     }
   }
 }