aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-07-04 15:59:25 -0700
committeriximeow <me@iximeow.net>2021-07-04 15:59:25 -0700
commit15311c6ce76205d0f0ec17358a242c057f84efba (patch)
tree3d9c75a79506e513f980cbccb8c901fc4c1527d9 /tests
parente7cb91d727bd9fbb332d09d8ac254b0bd6c46e88 (diff)
actually enforce DecodeError impl'ing std::error::Error in std builds
the previous test and code only tested one concrete archtecture, and it turns out never required `std::error::Error` on `DecodeError`.
Diffstat (limited to 'tests')
-rw-r--r--tests/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lib.rs b/tests/lib.rs
index 8e097de..9add6e3 100644
--- a/tests/lib.rs
+++ b/tests/lib.rs
@@ -10,6 +10,17 @@ fn test_u16() {
}
#[test]
+fn generic_error_can_bail() {
+ use yaxpeax_arch::{Arch, Decoder, Reader};
+
+ #[allow(dead_code)]
+ fn decode<A: Arch, U: Into<impl Reader<A::Address, A::Word>>>(data: U, decoder: &A::Decoder) -> anyhow::Result<()> {
+ let mut reader = data.into();
+ decoder.decode(&mut reader)?;
+ Ok(())
+ }
+}
+#[test]
fn error_can_bail() {
use yaxpeax_arch::{Arch, AddressDiff, Decoder, Reader, LengthedInstruction, Instruction, StandardDecodeError, U8Reader};
struct TestIsa {}