mirror of
https://github.com/encounter/ghidra-cli.git
synced 2026-07-10 03:18:56 -07:00
fix: resolve fmt check and drop-of-reference warnings
- Fix rustfmt issue in tests/common/mod.rs (single-line .context() chain) - Remove stale drop(harness) calls that now drop &'static references - Use _harness for unused bindings that only ensure bridge initialization Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
ad01eaf930
commit
096bd2df04
+1
-2
@@ -188,8 +188,7 @@ impl DaemonTestHarness {
|
||||
.join(project);
|
||||
|
||||
// Load config to find Ghidra installation
|
||||
let config = ghidra_cli::config::Config::load()
|
||||
.context("Failed to load config")?;
|
||||
let config = ghidra_cli::config::Config::load().context("Failed to load config")?;
|
||||
let ghidra_install_dir = config
|
||||
.ghidra_install_dir
|
||||
.clone()
|
||||
|
||||
@@ -27,7 +27,7 @@ fn harness() -> &'static DaemonTestHarness {
|
||||
#[serial]
|
||||
fn test_symbol_list() {
|
||||
require_ghidra!();
|
||||
let harness = harness();
|
||||
let _harness = harness();
|
||||
|
||||
let output = Command::cargo_bin("ghidra")
|
||||
.unwrap()
|
||||
@@ -50,8 +50,6 @@ fn test_symbol_list() {
|
||||
"symbol list should contain main. Output: {}",
|
||||
stdout
|
||||
);
|
||||
|
||||
drop(harness);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -147,7 +145,7 @@ fn test_symbol_rename() {
|
||||
#[serial]
|
||||
fn test_symbol_get_nonexistent() {
|
||||
require_ghidra!();
|
||||
let harness = harness();
|
||||
let _harness = harness();
|
||||
|
||||
Command::cargo_bin("ghidra")
|
||||
.unwrap()
|
||||
@@ -160,6 +158,4 @@ fn test_symbol_get_nonexistent() {
|
||||
.arg(TEST_PROGRAM)
|
||||
.assert()
|
||||
.failure();
|
||||
|
||||
drop(harness);
|
||||
}
|
||||
|
||||
+4
-14
@@ -25,7 +25,7 @@ fn harness() -> &'static DaemonTestHarness {
|
||||
#[serial]
|
||||
fn test_type_list() {
|
||||
require_ghidra!();
|
||||
let harness = harness();
|
||||
let _harness = harness();
|
||||
|
||||
Command::cargo_bin("ghidra")
|
||||
.unwrap()
|
||||
@@ -37,15 +37,13 @@ fn test_type_list() {
|
||||
.arg(TEST_PROGRAM)
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
drop(harness);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_type_get_primitive() {
|
||||
require_ghidra!();
|
||||
let harness = harness();
|
||||
let _harness = harness();
|
||||
|
||||
Command::cargo_bin("ghidra")
|
||||
.unwrap()
|
||||
@@ -59,15 +57,13 @@ fn test_type_get_primitive() {
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("size"));
|
||||
|
||||
drop(harness);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_type_create() {
|
||||
require_ghidra!();
|
||||
let harness = harness();
|
||||
let _harness = harness();
|
||||
|
||||
Command::cargo_bin("ghidra")
|
||||
.unwrap()
|
||||
@@ -94,8 +90,6 @@ fn test_type_create() {
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("MyTestStruct"));
|
||||
|
||||
drop(harness);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -128,15 +122,13 @@ fn test_type_apply() {
|
||||
"Expected success or instruction conflict, got: {}",
|
||||
stderr
|
||||
);
|
||||
|
||||
drop(harness);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_type_get_nonexistent() {
|
||||
require_ghidra!();
|
||||
let harness = harness();
|
||||
let _harness = harness();
|
||||
|
||||
Command::cargo_bin("ghidra")
|
||||
.unwrap()
|
||||
@@ -149,6 +141,4 @@ fn test_type_get_nonexistent() {
|
||||
.arg(TEST_PROGRAM)
|
||||
.assert()
|
||||
.failure();
|
||||
|
||||
drop(harness);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user