Skip to content

Commit 656fadd

Browse files
committed
fix: compilation errors, deprecation warnings, and add unit tests
- Fix WeakPoint struct initializations missing `file` and `line` fields across src/kanren/core.rs, src/a2ml/mod.rs, and all test files - Migrate report/gui.rs from deprecated egui API (TopBottomPanel, SidePanel, CentralPanel::show, ScrollArea::id_source) to current Panel::top/left/show_inside and id_salt - Fix version mismatch: main.rs command version now matches Cargo.toml (2.1.0) - Fix stale repository URL in Cargo.toml (panic-attacker → panic-attack) - Add `log` crate and replace raw println!/eprintln! with structured logging in groove.rs, kanren/rules.rs, assail/analyzer.rs, notify.rs, ambush/mod.rs - Remove useless usize >= 0 comparisons in property_tests.rs - Add 11 unit tests for assail/analyzer.rs covering language detection, unsafe code detection, panic path thresholds, command injection, eval detection, empty directory handling, and excluded directory skipping - Add 13 unit tests for panll/mod.rs covering axis/category labels, export format, image/temporal diff serialization, and write_export I/O All 381 tests pass with zero warnings. https://claude.ai/code/session_01AMMKMRH8GhvCnNjrV6iWLn
1 parent 21fc3f0 commit 656fadd

16 files changed

Lines changed: 1009 additions & 32 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ rust-version = "1.85.0"
77
authors = ["Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>"]
88
license-file = "LICENSE"
99
description = "Universal static analysis, stress testing, and logic-based bug signature detection for 47 languages"
10-
repository = "https://github.com/hyperpolymath/panic-attacker"
10+
repository = "https://github.com/hyperpolymath/panic-attack"
1111

1212
[dependencies]
1313
clap = { version = "4.6", features = ["derive"] }
1414
clap_complete = "4.6"
1515
clap_complete_nushell = "4.6"
1616
colored = "3.1"
1717
anyhow = "1.0"
18+
log = "0.4"
1819
serde = { version = "1.0", features = ["derive"] }
1920
serde_json = "1.0"
2021
serde_yaml = "0.9"

src/a2ml/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,8 @@ mod tests {
827827
weak_points: vec![WeakPoint {
828828
category: WeakPointCategory::UncheckedError,
829829
location: Some("src/main.rs:10".to_string()),
830+
file: None,
831+
line: None,
830832
severity: Severity::Medium,
831833
description: "unchecked result".to_string(),
832834
recommended_attack: vec![AttackAxis::Concurrency],

src/ambush/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn execute(config: AttackConfig) -> Result<Vec<AttackResult>> {
4242

4343
for program in &config.target_programs {
4444
for axis in &config.axes {
45-
println!(
45+
log::info!(
4646
"Ambushing {:?} on axis {:?} (intensity: {:?}, duration: {:?})",
4747
program, axis, config.intensity, config.duration
4848
);

0 commit comments

Comments
 (0)