fix tests

This commit is contained in:
bunnie 2022-03-09 22:46:55 +08:00
parent 9942f77226
commit 1dec7e6e7d
3 changed files with 516 additions and 518 deletions

View file

@ -501,10 +501,10 @@ mod tests {
bitvalue = (keyrom[coord[0]] & (1 << coord[1])) bitvalue = (keyrom[coord[0]] & (1 << coord[1]))
if bitvalue != 0: if bitvalue != 0:
wordvalue |= (1 << bit) wordvalue |= (1 << bit)
f.write(' assert_eq!(crate::patch_frame({}'.format(frame_rec[0]) + ', ' + '{}'.format(word) + ', &ROM), (Some(' + '0x{:08x}'.format(wordvalue) + '), Some(!0x{:08x}'.format(wordvalue) + ')));\n') f.write(' assert_eq!(crate::key2bits::patch_frame({}'.format(frame_rec[0]) + ', ' + '{}'.format(word) + ', &ROM), Some((' + '0x{:08x}u32'.format(wordvalue) + ', !0x{:08x}u32'.format(wordvalue) + ')));\n')
f.write(' // also test the null case, frame 0 should typically have no mappings.\n') f.write(' // also test the null case, frame 0 should typically have no mappings.\n')
f.write(' assert_eq!(crate::patch_frame(0x0, 0, &ROM), (None, None) );\n') f.write(' assert_eq!(crate::key2bits::patch_frame(0x0, 0, &ROM), None );\n')
f.write(""" f.write("""
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -377,8 +377,6 @@ mod bcrypt;
// some short tests to just confirm we're not totally broken. // some short tests to just confirm we're not totally broken.
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*;
#[test] #[test]
fn hash_with_fixed_salt() { fn hash_with_fixed_salt() {
let salt: [u8; 16] = [ let salt: [u8; 16] = [