From 656d64916a73323511a989fe8423d3d153f9c03a Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Fri, 9 May 2014 22:08:29 -0700 Subject: [PATCH] Fix tests for upstream changes --- crypto/hash.rs | 4 ++-- crypto/symm.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crypto/hash.rs b/crypto/hash.rs index 57b9fdbf..e3182b1b 100644 --- a/crypto/hash.rs +++ b/crypto/hash.rs @@ -107,7 +107,7 @@ mod tests { use serialize::hex::{FromHex, ToHex}; struct HashTest { - input: ~[u8], + input: Vec, 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(); diff --git a/crypto/symm.rs b/crypto/symm.rs index 24992153..00846380 100644 --- a/crypto/symm.rs +++ b/crypto/symm.rs @@ -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());