                 if let password = expectedValues[algorithm]?[i] {
                     let counter = UInt64(times[i] / token.period)
                     XCTAssertEqualObjects(token.passwordForCounter(counter), password, "Incorrect result for \(algorithm) at \(times[i])")
+                    XCTAssertEqualObjects(token.passwordForCounter(counter), password, "Inconsistent result for \(algorithm) at \(times[i])")
                 }
             }
         }

            for (var i = 0; i < times.count; i++) {
                let counter = UInt64(NSTimeInterval(times[i]) / token.period)
                XCTAssertEqualObjects(values[i], token.passwordForCounter(counter),
                                      "Incorrect result for \(algorithm) at \(times[i])")
            }
        }
    }

    // https://tools.ietf.org/html/rfc4226#appendix-D
    func testHOTPRFCValues() {
        let secret = "12345678901234567890".dataUsingEncoding(NSASCIIStringEncoding)
        let expectedValues = ["755224", "287082", "359152", "969429", "338314", "254676", "287922", "162583", "399871", "520489"]

        var token = Token(type: .Counter, secret: secret, algorithm: .SHA1, digits: 6, counter: 0)

        for (var counter = 0; counter < expectedValues.count; counter++) {
            XCTAssertEqualObjects(token.passwordForCounter(UInt64(counter)), expectedValues[counter])
            XCTAssertEqualObjects(token.passwordForCounter(UInt64(counter)), expectedValues[counter],
                "Inconsistent return value from token.passwordForCounter(\(counter))")
        }

        for expectedPassword: String in expectedValues {
            XCTAssertEqualObjects(token.password(), expectedPassword)
            XCTAssertEqualObjects(token.password(), expectedPassword,
                "Inconsistent return value from token.password()")
            token = token.updatedToken()
        }
    }
