2 * test-mono-handle: tests for MonoHandle and MonoHandleArena
5 * Aleksey Kliger <aleksey@xamarin.com>
7 * Copyright 2015 Xamarin, Inc. (www.xamarin.com)
12 #include <mono/metadata/handle.h>
15 test2_arena_push_pop ()
17 MonoHandleArena *top = NULL;
19 MonoHandleArena *new_arena1 = g_malloc0 (mono_handle_arena_size ());
20 mono_handle_arena_stack_push (&top, new_arena1);
22 MonoHandleArena *new_arena2 = g_malloc0 (mono_handle_arena_size ());
24 mono_handle_arena_stack_push (&top, new_arena2);
26 g_assert (top == new_arena2);
28 mono_handle_arena_stack_pop (&top, new_arena2);
32 g_assert (top == new_arena1);
34 mono_handle_arena_stack_pop (&top, new_arena1);
36 g_assert (top == NULL);
44 main (int argc, const char* argv[])
46 test2_arena_push_pop ();