Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup #19

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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