/** * for sake of speed we run only a subset of testcases, defined by {@link HashGenerator#ROUNDS} */ @Test public void testCheckPassword() { boolean onlyMatchings = true; for (String[] testVector : testVectors.get(HashGenerator.ROUNDS)) { onlyMatchings &= HashGenerator.checkPassword(testVector[PLAINTEXT_INDEX], testVector[HASH_INDEX]); } assertTrue(onlyMatchings); }
/** * for sake of speed we run only a subset of testcases, defined by {@link HashGenerator#ROUNDS} */ @Test public void testCheckPassword2() { boolean onlyMissMatchings = false; for (String[] testVector : testVectors.get(HashGenerator.ROUNDS)) { testVector[PLAINTEXT_INDEX] += "!"; onlyMissMatchings |= HashGenerator.checkPassword(testVector[PLAINTEXT_INDEX], testVector[HASH_INDEX]); } assertFalse(onlyMissMatchings); }