aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-05-03 13:38:08 -0700
committeriximeow <me@iximeow.net>2020-05-03 13:38:08 -0700
commit79388a4ff09fe21d31fe41a68e59a92263c2eea5 (patch)
treee618817ad8ae68ddb34239140a3a85029b6d259c /test
parenta68d0b05cc05ec4a390fa25a6dd199d189cd1e38 (diff)
bump yaxpeax-arch to 0.0.4, use AddressDiff, fix warnings in ffi
Diffstat (limited to 'test')
-rw-r--r--test/long_mode/mod.rs4
-rw-r--r--test/protected_mode/mod.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs
index 33de87f..ca8a557 100644
--- a/test/long_mode/mod.rs
+++ b/test/long_mode/mod.rs
@@ -2,7 +2,7 @@ mod regspec;
use std::fmt::Write;
-use yaxpeax_arch::{Decoder, LengthedInstruction};
+use yaxpeax_arch::{AddressBase, Decoder, LengthedInstruction};
use yaxpeax_x86::long_mode::{DecodeError, InstDecoder, Opcode};
fn test_invalid(data: &[u8]) {
@@ -40,7 +40,7 @@ fn test_display_under(decoder: &InstDecoder, data: &[u8], expected: &'static str
);
// while we're at it, test that the instruction is as long, and no longer, than its
// input
- assert_eq!(instr.len() as usize, data.len(), "instruction length is incorrect, wanted instruction {}", expected);
+ assert_eq!((0u64.wrapping_offset(instr.len()).to_linear()) as usize, data.len(), "instruction length is incorrect, wanted instruction {}", expected);
},
Err(e) => {
assert!(false, "decode error ({}) for {} under decoder {}:\n expected: {}\n", e, hex, decoder, expected);
diff --git a/test/protected_mode/mod.rs b/test/protected_mode/mod.rs
index e1fb281..dd07159 100644
--- a/test/protected_mode/mod.rs
+++ b/test/protected_mode/mod.rs
@@ -2,7 +2,7 @@ mod regspec;
use std::fmt::Write;
-use yaxpeax_arch::{Decoder, LengthedInstruction};
+use yaxpeax_arch::{AddressBase, Decoder, LengthedInstruction};
use yaxpeax_x86::protected_mode::{DecodeError, InstDecoder, Opcode};
fn test_invalid(data: &[u8]) {
@@ -40,7 +40,7 @@ fn test_display_under(decoder: &InstDecoder, data: &[u8], expected: &'static str
);
// while we're at it, test that the instruction is as long, and no longer, than its
// input
- assert_eq!(instr.len() as usize, data.len(), "instruction length is incorrect, wanted instruction {}", expected);
+ assert_eq!((0u32.wrapping_offset(instr.len()).to_linear()) as usize, data.len(), "instruction length is incorrect, wanted instruction {}", expected);
},
Err(e) => {
assert!(false, "decode error ({}) for {} under decoder {}:\n expected: {}\n", e, hex, decoder, expected);