Commit 656d6491 authored by Steven Fackler's avatar Steven Fackler
Browse files

Fix tests for upstream changes

parent 7bab60dd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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();

+3 −3
Original line number Diff line number Diff line
@@ -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());