From 8f857a2fcbdfc7315cd09c0a4ac372b3ec92b538 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 9 Aug 2020 20:43:42 -0700 Subject: adjust public interface: public items should all be stable `OperandCode` (obviously) wildly varies depending on how i feel on a given week, so it's now hidden to avoid people depending on numerical values of its discriminants. `RegisterBank` got a similar treatment with a new `RegisterClass` struct that's suitable for public use. --- test/protected_mode/regspec.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/protected_mode/regspec.rs') diff --git a/test/protected_mode/regspec.rs b/test/protected_mode/regspec.rs index bd996cc..eb8d018 100644 --- a/test/protected_mode/regspec.rs +++ b/test/protected_mode/regspec.rs @@ -18,3 +18,18 @@ fn test_labels() { assert_eq!(RegSpec::gs().name(), "gs"); assert_eq!(RegSpec::al().name(), "al"); } + +#[test] +fn test_bank_names() { + assert_eq!(RegSpec::al().class().name(), "byte"); + assert_eq!(RegSpec::ax().class().name(), "word"); + assert_eq!(RegSpec::eax().class().name(), "dword"); + assert_eq!(RegSpec::fs().class().name(), "segment"); + assert_eq!(RegSpec::eflags().class().name(), "eflags"); + assert_eq!(RegSpec::eip().class().name(), "eip"); + assert_eq!(RegSpec::st0().class().name(), "x87-stack"); + assert_eq!(RegSpec::mm0().class().name(), "mmx"); + assert_eq!(RegSpec::xmm0().class().name(), "xmm"); + assert_eq!(RegSpec::ymm0().class().name(), "ymm"); + assert_eq!(RegSpec::zmm0().class().name(), "zmm"); +} -- cgit v1.1