Skip to content

Commit

Permalink
improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
subotic committed Sep 18, 2024
1 parent 1a1be22 commit e740948
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/spectool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,18 +247,18 @@ fn main_generate() {

let mut found_post_check_errors = false;

for (final_value, required_value) in expected_regs.iter().zip(post.regs.iter()) {
for ((final_value, reg), required_value) in expected_regs.iter().zip(Reg::ALL).zip(post.regs.iter()) {
if let Some(required_value) = required_value {
if final_value != required_value {
eprintln!("Failed post check for final register value for {path:?}: expected {required_value}, is {final_value}");
eprintln!("{path:?}: unexpected {reg}: {final_value} (expected: {required_value})");
found_post_check_errors = true;
}
}
}

if let Some(post_gas) = post.gas {
if expected_gas != post_gas {
eprintln!("Failed post check for final gas value for {path:?}: expected {post_gas}, is {expected_gas}");
eprintln!("{path:?}: unexpected gas: {expected_gas} (expected: {post_gas})");
found_post_check_errors = true;
}
}
Expand Down

0 comments on commit e740948

Please sign in to comment.