Skip to content

Commit

Permalink
Fixed code formatting in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devttys0 committed Nov 21, 2024
1 parent bd55cfd commit 485101e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
12 changes: 10 additions & 2 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ pub fn integration_test(signature_filter: &str, file_name: &str) {
let results = run_binwalk(signature_filter, file_name);

// Assert that there was a valid signature and successful result at, and only at, file offset 0
assert_results_ok(results, expected_signature_offsets, expected_extraction_offsets);
assert_results_ok(
results,
expected_signature_offsets,
expected_extraction_offsets,
);
}

/// Assert that there was a valid signature match and corresponding extraction at, and only at, the specified file offsets
pub fn assert_results_ok(results: AnalysisResults, signature_offsets: Vec<usize>, extraction_offsets: Vec<usize>) {
pub fn assert_results_ok(
results: AnalysisResults,
signature_offsets: Vec<usize>,
extraction_offsets: Vec<usize>,
) {
// Assert that the number of signature results and extractions match the expected results
assert!(results.file_map.len() == signature_offsets.len());
assert!(results.extractions.len() == extraction_offsets.len());
Expand Down
6 changes: 5 additions & 1 deletion tests/jpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ fn integration_test() {
let expected_extraction_offsets: Vec<usize> = vec![0, 0x15BBE];

let results = common::run_binwalk(SIGNATURE_TYPE, INPUT_FILE_NAME);
common::assert_results_ok(results, expected_signature_offsets, expected_extraction_offsets);
common::assert_results_ok(
results,
expected_signature_offsets,
expected_extraction_offsets,
);
}
6 changes: 5 additions & 1 deletion tests/pdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ fn integration_test() {
let expected_extraction_offsets: Vec<usize> = vec![];

let results = common::run_binwalk(SIGNATURE_TYPE, INPUT_FILE_NAME);
common::assert_results_ok(results, expected_signature_offsets, expected_extraction_offsets);
common::assert_results_ok(
results,
expected_signature_offsets,
expected_extraction_offsets,
);
}

0 comments on commit 485101e

Please sign in to comment.