Merge pull request #5120 from lambdageek/bug-57744
[mono.git] / mono / unit-tests / test-mono-handle.c
index 3438039a4b0cb91900fa6e057be353b38b47e04b..0d8febaa709eb56721bdc155fab4dd1fc260fb15 100644 (file)
 #include <mono/metadata/handle.h>
 
 static void
-test2_arena_push_pop ()
+test2_arena_push_pop (void)
 {
-       MonoHandleArena *top = NULL;
-
-       MonoHandleArena *new_arena1 = g_malloc0 (mono_handle_arena_size ());
-       mono_handle_arena_stack_push (&top, new_arena1);
-
-       MonoHandleArena *new_arena2 = g_malloc0 (mono_handle_arena_size ());
-
-       mono_handle_arena_stack_push (&top, new_arena2);
-
-       g_assert (top == new_arena2);
-
-       mono_handle_arena_stack_pop (&top, new_arena2);
-
-       g_free (new_arena2);
-
-       g_assert (top == new_arena1);
-
-       mono_handle_arena_stack_pop (&top, new_arena1);
-
-       g_assert (top == NULL);
-       
-       g_free (new_arena1);
+       HandleStack *h = mono_handle_stack_alloc ();
+       mono_handle_stack_free (h);
 }
 
-
-
 int
 main (int argc, const char* argv[])
 {