mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-22 21:49:41 +00:00
agent: resolve unused variables in tests
A few tests have unused or unread variables. Let's clean these up... Fixes: #3530 Signed-off-by: Eric Ernst <eric_ernst@apple.com>
This commit is contained in:
parent
25aa2e8578
commit
9277317098
@ -1385,7 +1385,7 @@ mod tests {
|
|||||||
|
|
||||||
for (i, t) in tests.iter().enumerate() {
|
for (i, t) in tests.iter().enumerate() {
|
||||||
// Create a string containing details of the test
|
// Create a string containing details of the test
|
||||||
let msg = format!("test[{}]: {:?}", i, t);
|
let msg = format!("test[{}]: {:?}", i, t.name);
|
||||||
|
|
||||||
// if is_symlink, then should be prepare the softlink environment
|
// if is_symlink, then should be prepare the softlink environment
|
||||||
if t.symlink_path != "" {
|
if t.symlink_path != "" {
|
||||||
|
@ -90,7 +90,6 @@ mod tests {
|
|||||||
#[derive(Debug, Default, Clone)]
|
#[derive(Debug, Default, Clone)]
|
||||||
struct BufWriter {
|
struct BufWriter {
|
||||||
data: Arc<Mutex<Vec<u8>>>,
|
data: Arc<Mutex<Vec<u8>>>,
|
||||||
slow_write: bool,
|
|
||||||
write_delay: Duration,
|
write_delay: Duration,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +97,6 @@ mod tests {
|
|||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
BufWriter {
|
BufWriter {
|
||||||
data: Arc::new(Mutex::new(Vec::<u8>::new())),
|
data: Arc::new(Mutex::new(Vec::<u8>::new())),
|
||||||
slow_write: false,
|
|
||||||
write_delay: Duration::new(0, 0),
|
write_delay: Duration::new(0, 0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -179,45 +177,35 @@ mod tests {
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct TestData {
|
struct TestData {
|
||||||
reader_value: String,
|
reader_value: String,
|
||||||
result: io::Result<u64>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let tests = &[
|
let tests = &[
|
||||||
TestData {
|
TestData {
|
||||||
reader_value: "".into(),
|
reader_value: "".into(),
|
||||||
result: Ok(0),
|
|
||||||
},
|
},
|
||||||
TestData {
|
TestData {
|
||||||
reader_value: "a".into(),
|
reader_value: "a".into(),
|
||||||
result: Ok(1),
|
|
||||||
},
|
},
|
||||||
TestData {
|
TestData {
|
||||||
reader_value: "foo".into(),
|
reader_value: "foo".into(),
|
||||||
result: Ok(3),
|
|
||||||
},
|
},
|
||||||
TestData {
|
TestData {
|
||||||
reader_value: "b".repeat(BUF_SIZE - 1),
|
reader_value: "b".repeat(BUF_SIZE - 1),
|
||||||
result: Ok((BUF_SIZE - 1) as u64),
|
|
||||||
},
|
},
|
||||||
TestData {
|
TestData {
|
||||||
reader_value: "c".repeat(BUF_SIZE),
|
reader_value: "c".repeat(BUF_SIZE),
|
||||||
result: Ok((BUF_SIZE) as u64),
|
|
||||||
},
|
},
|
||||||
TestData {
|
TestData {
|
||||||
reader_value: "d".repeat(BUF_SIZE + 1),
|
reader_value: "d".repeat(BUF_SIZE + 1),
|
||||||
result: Ok((BUF_SIZE + 1) as u64),
|
|
||||||
},
|
},
|
||||||
TestData {
|
TestData {
|
||||||
reader_value: "e".repeat((2 * BUF_SIZE) - 1),
|
reader_value: "e".repeat((2 * BUF_SIZE) - 1),
|
||||||
result: Ok(((2 * BUF_SIZE) - 1) as u64),
|
|
||||||
},
|
},
|
||||||
TestData {
|
TestData {
|
||||||
reader_value: "f".repeat(2 * BUF_SIZE),
|
reader_value: "f".repeat(2 * BUF_SIZE),
|
||||||
result: Ok((2 * BUF_SIZE) as u64),
|
|
||||||
},
|
},
|
||||||
TestData {
|
TestData {
|
||||||
reader_value: "g".repeat((2 * BUF_SIZE) + 1),
|
reader_value: "g".repeat((2 * BUF_SIZE) + 1),
|
||||||
result: Ok(((2 * BUF_SIZE) + 1) as u64),
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user