libfreemkv 0.31.4: prune 144 vacuous tests (keep spec-grounded subset)
This commit is contained in:
@@ -157,11 +157,6 @@ mod tests {
|
||||
assert_eq!(mask_string("café9"), "AAAé0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mask_string_empty_is_empty() {
|
||||
assert_eq!(mask_string(""), "");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mask_bytes_matches_string_masking_for_ascii() {
|
||||
// mask_bytes is the byte-wise analogue: letters→b'A', digits→b'0'.
|
||||
@@ -178,19 +173,6 @@ mod tests {
|
||||
assert_eq!(mask_bytes(&input), vec![0x00, b'A', 0x20, b'0', 0xFF, b'-']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mask_bytes_length_preserved() {
|
||||
// Masking is 1:1 — output length always equals input length so
|
||||
// fixed-offset fields stay aligned.
|
||||
let input = vec![0u8; 96];
|
||||
assert_eq!(mask_bytes(&input).len(), 96);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mask_bytes_empty_is_empty() {
|
||||
assert!(mask_bytes(&[]).is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn feature_table_has_no_duplicate_codes() {
|
||||
// capture_drive_data iterates FEATURES once per code; a duplicate
|
||||
@@ -211,14 +193,4 @@ mod tests {
|
||||
"AACS feature 0x010D must be captured"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn feature_table_codes_are_sorted_ascending() {
|
||||
// The table is maintained in ascending MMC-6 code order; a code
|
||||
// inserted out of order is a maintenance smell that this pins.
|
||||
let codes: Vec<u16> = FEATURES.iter().map(|&(c, _)| c).collect();
|
||||
let mut sorted = codes.clone();
|
||||
sorted.sort_unstable();
|
||||
assert_eq!(codes, sorted, "FEATURES must stay in ascending code order");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1341,17 +1341,6 @@ mod command_tests {
|
||||
assert_eq!(d.get_config_feature(0x0000), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_config_feature_clamps_overlong_transfer_count() {
|
||||
// Doc: a bridge reporting more bytes than the 256-byte buffer
|
||||
// must be clamped (end = bytes_transferred.min(buf.len())) — no
|
||||
// slice panic. FixedTransport reports min(payload,buf)=256 here,
|
||||
// so we get buf[8..256] = 248 bytes, never a panic.
|
||||
let mut d = drive_with(vec![0xAB; 1024]);
|
||||
let got = d.get_config_feature(0x010C).unwrap();
|
||||
assert_eq!(got.len(), 256 - 8, "clamped to buffer, header stripped");
|
||||
}
|
||||
|
||||
// ── report_key / mode_sense / read_buffer empty-vs-some ─────────
|
||||
|
||||
#[test]
|
||||
@@ -1408,15 +1397,6 @@ mod command_tests {
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ready_predicates_false_without_driver() {
|
||||
// is_ready / is_unlocked default false when no platform driver.
|
||||
let d = drive_with(vec![]);
|
||||
assert!(!d.is_ready());
|
||||
assert!(!d.is_unlocked());
|
||||
assert!(!d.has_profile());
|
||||
}
|
||||
|
||||
// ── decode_read_capacity additional boundaries ──────────────────
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user