mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 15:33:42 +02:00
flashrom_tester: update syntax for --wp-range
TEST=cargo test Signed-off-by: Daniel Campello <campello@chromium.org> Change-Id: If17a40fba1f7d41e09e0163b353d1602c215c8db Reviewed-on: https://review.coreboot.org/c/flashrom/+/52876 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
7367f77aa4
commit
32b8bab08c
@ -90,8 +90,7 @@ fn flashrom_decode_opts(opts: FlashromOpt) -> Vec<String> {
|
|||||||
if opts.wp_opt.range.is_some() {
|
if opts.wp_opt.range.is_some() {
|
||||||
let (x0, x1) = opts.wp_opt.range.unwrap();
|
let (x0, x1) = opts.wp_opt.range.unwrap();
|
||||||
params.push("--wp-range".to_string());
|
params.push("--wp-range".to_string());
|
||||||
params.push(hex_string(x0));
|
params.push(hex_range_string(x0, x1));
|
||||||
params.push(hex_string(x1));
|
|
||||||
}
|
}
|
||||||
if opts.wp_opt.status {
|
if opts.wp_opt.status {
|
||||||
params.push("--wp-status".to_string());
|
params.push("--wp-status".to_string());
|
||||||
@ -209,8 +208,8 @@ fn dut_ctrl(args: &[&str]) -> Result<(Vec<u8>, Vec<u8>), FlashromError> {
|
|||||||
Ok((output.stdout, output.stderr))
|
Ok((output.stdout, output.stderr))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn hex_string(v: i64) -> String {
|
fn hex_range_string(s: i64, l: i64) -> String {
|
||||||
format!("{:#08X}", v).to_string()
|
format!("{:#08X},{:#08X}", s, l).to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@ -237,7 +236,7 @@ mod tests {
|
|||||||
status: true,
|
status: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
&["--wp-range", "0x000000", "0x0004D2", "--wp-status"],
|
&["--wp-range", "0x000000,0x0004D2", "--wp-status"],
|
||||||
);
|
);
|
||||||
test_wp_opt(
|
test_wp_opt(
|
||||||
WPOpt {
|
WPOpt {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user