From ccfb66611f884f41f8fa6dcc08e09fdf29c83d93 Mon Sep 17 00:00:00 2001 From: lazymio Date: Tue, 23 Nov 2021 00:41:49 +0100 Subject: [PATCH] Move test to test_mem --- tests/unit/test_mem.c | 15 +++++++++++++++ tests/unit/test_x86.c | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/unit/test_mem.c b/tests/unit/test_mem.c index 57c76a48..027894b6 100644 --- a/tests/unit/test_mem.c +++ b/tests/unit/test_mem.c @@ -60,7 +60,22 @@ static void test_mem_protect() OK(uc_close(qc)); } +static void test_splitting_mem_unmap() +{ + uc_engine *uc; + + OK(uc_open(UC_ARCH_X86, UC_MODE_32, &uc)); + + OK(uc_mem_map(uc, 0x20000, 0x1000, UC_PROT_NONE)); + OK(uc_mem_map(uc, 0x21000, 0x2000, UC_PROT_NONE)); + + OK(uc_mem_unmap(uc, 0x21000, 0x1000)); + + OK(uc_close(uc)); +} + TEST_LIST = {{"test_map_correct", test_map_correct}, {"test_map_wrapping", test_map_wrapping}, {"test_mem_protect", test_mem_protect}, + {"test_splitting_mem_unmap", test_splitting_mem_unmap}, {NULL, NULL}}; diff --git a/tests/unit/test_x86.c b/tests/unit/test_x86.c index 1df61e2f..e8bb68a0 100644 --- a/tests/unit/test_x86.c +++ b/tests/unit/test_x86.c @@ -846,20 +846,6 @@ static void test_x86_nested_emu_start() OK(uc_close(uc)); } -static void test_x86_splitting_mem_unmap() -{ - uc_engine *uc; - - OK(uc_open(UC_ARCH_X86, UC_MODE_32, &uc)); - - OK(uc_mem_map(uc, 0x20000, 0x1000, UC_PROT_NONE)); - OK(uc_mem_map(uc, 0x21000, 0x2000, UC_PROT_NONE)); - - OK(uc_mem_unmap(uc, 0x21000, 0x1000)); - - OK(uc_close(uc)); -} - TEST_LIST = {{"test_x86_in", test_x86_in}, {"test_x86_out", test_x86_out}, {"test_x86_mem_hook_all", test_x86_mem_hook_all}, @@ -886,5 +872,4 @@ TEST_LIST = {{"test_x86_in", test_x86_in}, {"test_x86_hook_tcg_op", test_x86_hook_tcg_op}, {"test_x86_cmpxchg", test_x86_cmpxchg}, {"test_x86_nested_emu_start", test_x86_nested_emu_start}, - {"test_x86_splitting_mem_unmap", test_x86_splitting_mem_unmap}, {NULL, NULL}};