9951 clippy errors in the test suite (#10030)

automerge
This commit is contained in:
Kristofer Peterson
2020-05-15 17:35:43 +01:00
committed by GitHub
parent 1da1667920
commit 58ef02f02b
106 changed files with 713 additions and 827 deletions

View File

@ -319,7 +319,7 @@ mod tests {
Err(InstructionError::NotEnoughAccountKeys),
process_instruction(
&bpf_loader::id(),
&vec![],
&[],
&instruction_data,
&mut MockInvokeContext::default()
)
@ -385,7 +385,7 @@ mod tests {
Err(InstructionError::NotEnoughAccountKeys),
process_instruction(
&bpf_loader::id(),
&vec![],
&[],
&instruction_data,
&mut MockInvokeContext::default()
)
@ -453,8 +453,8 @@ mod tests {
Err(InstructionError::NotEnoughAccountKeys),
process_instruction(
&bpf_loader::id(),
&vec![],
&vec![],
&[],
&[],
&mut MockInvokeContext::default()
)
);
@ -465,7 +465,7 @@ mod tests {
process_instruction(
&bpf_loader::id(),
&keyed_accounts,
&vec![],
&[],
&mut MockInvokeContext::default()
)
);
@ -477,7 +477,7 @@ mod tests {
process_instruction(
&bpf_loader::id(),
&keyed_accounts,
&vec![],
&[],
&mut MockInvokeContext::default()
)
);
@ -491,7 +491,7 @@ mod tests {
process_instruction(
&bpf_loader::id(),
&keyed_accounts,
&vec![],
&[],
&mut MockInvokeContext::default()
)
);
@ -507,7 +507,7 @@ mod tests {
process_instruction(
&bpf_loader::id(),
&keyed_accounts,
&vec![],
&[],
&mut MockInvokeContext::default()
)
);
@ -568,7 +568,7 @@ mod tests {
let _result = process_instruction(
&bpf_loader::id(),
&keyed_accounts,
&vec![],
&[],
&mut MockInvokeContext::default(),
);
},

View File

@ -775,9 +775,10 @@ mod tests {
(true, START + LENGTH / 2, LENGTH / 2, addr + LENGTH / 2),
];
for (ok, start, length, value) in cases {
match ok {
true => assert_eq!(translate!(start, length, &regions).unwrap(), value),
false => assert!(translate!(start, length, &regions).is_err()),
if ok {
assert_eq!(translate!(start, length, &regions).unwrap(), value)
} else {
assert!(translate!(start, length, &regions).is_err())
}
}
}