2 * test-mono-handle: tests for MonoHandle and MonoHandleArena
5 * Aleksey Kliger <aleksey@xamarin.com>
7 * Copyright 2015 Xamarin, Inc. (www.xamarin.com)
8 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
13 #include <mono/metadata/handle.h>
16 test2_arena_push_pop ()
18 MonoHandleArena *top = NULL;
20 MonoHandleArena *new_arena1 = g_malloc0 (mono_handle_arena_size ());
21 mono_handle_arena_stack_push (&top, new_arena1);
23 MonoHandleArena *new_arena2 = g_malloc0 (mono_handle_arena_size ());
25 mono_handle_arena_stack_push (&top, new_arena2);
27 g_assert (top == new_arena2);
29 mono_handle_arena_stack_pop (&top, new_arena2);
33 g_assert (top == new_arena1);
35 mono_handle_arena_stack_pop (&top, new_arena1);
37 g_assert (top == NULL);
45 main (int argc, const char* argv[])
47 test2_arena_push_pop ();