Fix test build

This commit is contained in:
Steven Fackler 2014-11-19 12:36:32 -08:00
parent af5533d936
commit 9996f5874e
4 changed files with 12 additions and 12 deletions

View File

@ -167,7 +167,7 @@ mod tests {
"95e9a0db962095adaebe9b2d6f0dbce2d499f112f2d2b7273fa6870e".from_hex().unwrap(),
"3a854166ac5d9f023f54d517d0b39dbd946770db9c2b95c9f6f565d1".from_hex().unwrap()
];
test_sha2(SHA224, results);
test_sha2(SHA224, &results);
}
#[test]
@ -180,7 +180,7 @@ mod tests {
"60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54".from_hex().unwrap(),
"9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2".from_hex().unwrap()
];
test_sha2(SHA256, results);
test_sha2(SHA256, &results);
}
#[test]
@ -205,7 +205,7 @@ mod tests {
602420feb0b8fb9adccebb82461e99c5\
a678cc31e799176d3860e6110c46523e".from_hex().unwrap()
];
test_sha2(SHA384, results);
test_sha2(SHA384, &results);
}
#[test]
@ -236,6 +236,6 @@ mod tests {
b6022cac3c4982b10d5eeb55c3e4de15\
134676fb6de0446065c97440fa8c6a58".from_hex().unwrap()
];
test_sha2(SHA512, results);
test_sha2(SHA512, &results);
}
}

View File

@ -26,14 +26,14 @@ mod tests {
#[test]
fn test_eq() {
assert!(eq([], []));
assert!(eq([1], [1]));
assert!(!eq([1, 2, 3], [1, 2, 4]));
assert!(eq(&[], &[]));
assert!(eq(&[1], &[1]));
assert!(!eq(&[1, 2, 3], &[1, 2, 4]));
}
#[test]
#[should_fail]
fn test_diff_lens() {
eq([], [1]);
eq(&[], &[1]);
}
}

View File

@ -226,9 +226,9 @@ mod tests {
0x4a_u8, 0x2e_u8, 0xe5_u8, 0x6_u8, 0xbf_u8, 0xcf_u8, 0xf2_u8, 0xd7_u8,
0xea_u8, 0x2d_u8, 0xb1_u8, 0x85_u8, 0x6c_u8, 0x93_u8, 0x65_u8, 0x6f_u8
];
cr.init(super::Mode::Decrypt, data, iv);
cr.init(super::Mode::Decrypt, &data, iv);
cr.pad(false);
let unciphered_data_1 = cr.update(ciphered_data);
let unciphered_data_1 = cr.update(&ciphered_data);
let unciphered_data_2 = cr.finalize();
let expected_unciphered_data = b"I love turtles.\x01";

View File

@ -14,8 +14,8 @@ fn test_cert_gen() {
.set_valid_period(365*2)
.set_CN("test_me")
.set_sign_hash(SHA256)
.set_usage([DigitalSignature, KeyEncipherment])
.set_ext_usage([ClientAuth, ServerAuth]);
.set_usage(&[DigitalSignature, KeyEncipherment])
.set_ext_usage(&[ClientAuth, ServerAuth]);
let res = gen.generate();
assert!(res.is_ok());