Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Dec 19, 2023
1 parent 8272151 commit 0919192
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
13 changes: 1 addition & 12 deletions programs/bpf_loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ mod tests {
fn test_bpf_loader_invoke_main() {
let loader_id = bpf_loader::id();
let program_id = Pubkey::new_unique();
let mut program_account =
let program_account =
load_program_account_from_elf(&loader_id, "test_elfs/out/noop_aligned.so");
let parameter_id = Pubkey::new_unique();
let parameter_account = AccountSharedData::new(1, 0, &loader_id);
Expand Down Expand Up @@ -2033,17 +2033,6 @@ mod tests {
},
|_invoke_context| {},
);

// Case: Account not a program
program_account.set_executable(false);
process_instruction(
&loader_id,
&[0],
&[],
vec![(program_id, program_account)],
Vec::new(),
Err(InstructionError::IncorrectProgramId),
);
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions programs/bpf_loader/src/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ mod tests {
assert_eq!(account.lamports(), account_info.lamports());
assert_eq!(account.data(), &account_info.data.borrow()[..]);
assert_eq!(account.owner(), account_info.owner);
assert_eq!(account.executable(), account_info.executable);
assert!(account_info.executable);
assert_eq!(account.rent_epoch(), account_info.rent_epoch);

assert_eq!(
Expand Down Expand Up @@ -1023,7 +1023,7 @@ mod tests {
assert_eq!(account.lamports(), account_info.lamports());
assert_eq!(account.data(), &account_info.data.borrow()[..]);
assert_eq!(account.owner(), account_info.owner);
assert_eq!(account.executable(), account_info.executable);
assert!(account_info.executable);
assert_eq!(account.rent_epoch(), account_info.rent_epoch);
}

Expand Down

0 comments on commit 0919192

Please sign in to comment.