Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuoguo committed Jul 9, 2024
1 parent 311cd68 commit c473f0a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 46 deletions.
35 changes: 0 additions & 35 deletions .github/rust.yml

This file was deleted.

2 changes: 0 additions & 2 deletions src/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,6 @@ pub fn compare_operator_instr_ty(
InstrumentType::NotInstrumented
}



pub fn compare_operator_for_inject<'a>(
ops: Vec<(Operator<'a>, Operator<'a>)>,
target: Operator,
Expand Down
25 changes: 16 additions & 9 deletions tests/instrumentation_test.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
use orca::ir::{Component, InstrumentType};
use wasmparser::Operator;

pub fn compare_operator(
op: &Operator,
target: &Operator,
) -> bool {
match (op, target) {
(Operator::Call {function_index: idx1}, Operator::Call {function_index:idx2}) => idx1 == idx2,
_ => false
}
pub fn compare_operator(op: &Operator, target: &Operator) -> bool {
match (op, target) {
(
Operator::Call {
function_index: idx1,
},
Operator::Call {
function_index: idx2,
},
) => idx1 == idx2,
_ => false,
}
}

#[test]
Expand Down Expand Up @@ -64,7 +68,10 @@ fn test_inject_code() {
for (orig, inject) in injections.iter() {
if compare_operator(instr, orig) {
// That means, previous instruction must be injected
assert_eq!(compare_operator(inject, &body.instructions[idx - 1].0), true);
assert_eq!(
compare_operator(inject, &body.instructions[idx - 1].0),
true
);
}
}
}
Expand Down

0 comments on commit c473f0a

Please sign in to comment.