Binary search mapped blocks

This commit is contained in:
Aurimas Blažulionis
2021-06-25 21:49:10 +01:00
parent 91451aa2f5
commit 160045a910
2 changed files with 72 additions and 23 deletions

View File

@ -1,5 +1,25 @@
#include "unicorn_test.h"
static void test_map_correct() {
uc_engine* uc;
OK(uc_open (UC_ARCH_X86, UC_MODE_64, &uc));
OK(uc_mem_map (uc, 0x40000, 0x1000 * 16, UC_PROT_ALL));
OK(uc_close(uc));
}
static void test_map_wrapping() {
uc_engine* uc;
OK(uc_open (UC_ARCH_X86, UC_MODE_64, &uc));
uc_assert_err(UC_ERR_ARG, uc_mem_map (uc, (~0ll - 0x4000) & ~0xfff, 0x8000, UC_PROT_ALL));
OK(uc_close(uc));
}
TEST_LIST = {
{ "test_map_correct", test_map_correct },
{ "test_map_wrapping", test_map_wrapping },
{ NULL, NULL }
};
};