Skip to content

Commit

Permalink
fix: tests in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
darfink committed Jun 13, 2017
1 parent f9a24d6 commit ff4e549
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ generic-array = "0.8.2"
lazy_static = "0.2.8"
libc = "0.2"
matches = "0.1.6"
region = "0.0.6"
slice-pool = "0.3.3"

[dependencies.region]
git = "https://github.com/darfink/region-rs.git"

[dependencies.mmap]
git = "https://github.com/retep998/rust-mmap.git"

[dev-dependencies]
volatile_cell = "1.0.0"

[target]

[target."cfg(any(target_arch = \"x86\", target_arch = \"x86_64\"))".dependencies]
Expand Down
8 changes: 6 additions & 2 deletions tests/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
extern crate detour;
extern crate volatile_cell;
use std::mem;
use volatile_cell::VolatileCell;

type FnAdd = extern "C" fn(i32, i32) -> i32;

#[inline(never)]
extern "C" fn add(x: i32, y: i32) -> i32 {
x + y
VolatileCell::new(x).get() + y
}

#[inline(never)]
extern "C" fn sub_detour(x: i32, y: i32) -> i32 {
x - y
VolatileCell::new(x).get() - y
}

#[test]
Expand Down

0 comments on commit ff4e549

Please sign in to comment.