소스 검색

Remove the use of goto from test/csync/std_tests/check_std_c_jhash.c

Hannah von Reth 5 년 전
부모
커밋
0c57bb8869
1개의 변경된 파일16개의 추가작업 그리고 14개의 파일을 삭제
  1. 16 14
      test/csync/std_tests/check_std_c_jhash.c

+ 16 - 14
test/csync/std_tests/check_std_c_jhash.c

@@ -68,15 +68,16 @@ static void check_c_jhash_trials(void **state)
                     e[0], f[0], g[0], h[0], x[0], y[0]);
                     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);
              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);
                          (uint32_t)i,(uint32_t)j,(uint32_t)m,(uint32_t)hlen);
 #endif
 #endif
           }
           }
-          if (z==MAXPAIR) goto done;
-        }
-      }
-    }
-   done:
-    if (z < MAXPAIR) {
+          if (z == MAXPAIR) {
+              if (z < MAXPAIR) {
 #if 0
 #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
 #endif
-        assert_true(z < MAXPAIR);
+                  assert_true(z < MAXPAIR);
+              }
+              return;
+          }
+        }
+      }
     }
     }
   }
   }
 }
 }