Fix tests for upstream changes

This commit is contained in:
Steven Fackler 2014-05-09 22:08:29 -07:00
parent 7bab60ddbe
commit 656d64916a
2 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ mod tests {
use serialize::hex::{FromHex, ToHex};
struct HashTest {
input: ~[u8],
input: Vec<u8>,
expected_output: ~str
}
@ -117,7 +117,7 @@ mod tests {
}
fn hash_test(hashtype: super::HashType, hashtest: &HashTest) {
let calced_raw = super::hash(hashtype, hashtest.input);
let calced_raw = super::hash(hashtype, hashtest.input.as_slice());
let calced = calced_raw.as_slice().to_hex();

View File

@ -225,10 +225,10 @@ mod tests {
use serialize::hex::ToHex;
let cipher = super::Crypter::new(ciphertype);
cipher.init(super::Encrypt, key.from_hex().unwrap(), iv.from_hex().unwrap());
cipher.init(super::Encrypt, key.from_hex().unwrap().as_slice(), iv.from_hex().unwrap().as_slice());
let expected = Vec::from_slice(ct.from_hex().unwrap());
let computed = cipher.update(pt.from_hex().unwrap()).append(cipher.final().as_slice());
let expected = Vec::from_slice(ct.from_hex().unwrap().as_slice());
let computed = cipher.update(pt.from_hex().unwrap().as_slice()).append(cipher.final().as_slice());
if computed != expected {
println!("Computed: {}", computed.as_slice().to_hex());