use crate::tests::helpers;
#[test]
pub fn hooks_system() {
helpers::setup();
let mut hooks = crate::hooks::Hooks::new();
assert!(hooks.hook_on_interrupt.is_none());
assert!(hooks.hook_on_exception.is_none());
assert!(hooks.hook_on_memory_read.is_none());
assert!(hooks.hook_on_memory_write.is_none());
assert!(hooks.hook_on_pre_instruction.is_none());
assert!(hooks.hook_on_post_instruction.is_none());
assert!(hooks.hook_on_winapi_call.is_none());
hooks.on_interrupt(|_emu, _addr, _interrupt| true);
assert!(hooks.hook_on_interrupt.is_some());
hooks.on_exception(|_emu, _addr, _ex_type| true);
assert!(hooks.hook_on_exception.is_some());
hooks.on_memory_read(|_emu, _ip, _addr, _sz| {});
assert!(hooks.hook_on_memory_read.is_some());
hooks.on_memory_write(|_emu, _ip, _addr, _sz, value| value);
assert!(hooks.hook_on_memory_write.is_some());
hooks.on_pre_instruction(|_emu, _addr, _ins, _sz| true);
assert!(hooks.hook_on_pre_instruction.is_some());
hooks.on_post_instruction(|_emu, _addr, _ins, _sz, _ok| {});
assert!(hooks.hook_on_post_instruction.is_some());
hooks.on_winapi_call(|_emu, _addr, _called_addr| true);
assert!(hooks.hook_on_winapi_call.is_some());
assert!(!hooks.hook_on_interrupt.is_none());
assert!(!hooks.hook_on_exception.is_none());
assert!(!hooks.hook_on_memory_read.is_none());
assert!(!hooks.hook_on_memory_write.is_none());
assert!(!hooks.hook_on_pre_instruction.is_none());
assert!(!hooks.hook_on_post_instruction.is_none());
assert!(!hooks.hook_on_winapi_call.is_none());
}