Merge pull request #3120 from esdrubal/syscall_details
[mono.git] / mono / unit-tests / test-mono-handle.c
index db620f1690756d6c42f677d392d09b20be38060b..95ebae349c29aa1cbd562a8642ec09a17299c5b1 100644 (file)
@@ -5,48 +5,18 @@
  *   Aleksey Kliger <aleksey@xamarin.com>
  *
  * Copyright 2015 Xamarin, Inc. (www.xamarin.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #include <config.h>
 #include <glib.h>
 #include <mono/metadata/handle.h>
-#include <mono/metadata/handle-private.h>
-
-static void
-test1_arena_size ()
-{
-       for (gsize i = 1; i < 10; ++i) {
-               gsize sz = mono_handle_arena_size(i);
-               g_assert(sz >= i*sizeof(MonoHandle));
-       }
-}
 
 static void
 test2_arena_push_pop ()
 {
-       MonoHandleArena *top = NULL;
-
-       const int n_handles = 3;
-       MonoHandleArena *new_arena1 = g_malloc0 (mono_handle_arena_size (n_handles));
-       mono_handle_arena_stack_push (&top, new_arena1, n_handles);
-
-       MonoHandleArena *new_arena2 = g_malloc0 (mono_handle_arena_size (n_handles));
-
-       mono_handle_arena_stack_push (&top, new_arena2, n_handles);
-
-       g_assert (top == new_arena2);
-
-       mono_handle_arena_stack_pop (&top, new_arena2, n_handles);
-
-       g_free (new_arena2);
-
-       g_assert (top == new_arena1);
-
-       mono_handle_arena_stack_pop (&top, new_arena1, n_handles);
-
-       g_assert (top == NULL);
-       
-       g_free (new_arena1);
+       HandleStack *h = mono_handle_stack_alloc ();
+       mono_handle_stack_free (h);
 }
 
 
@@ -54,8 +24,6 @@ test2_arena_push_pop ()
 int
 main (int argc, const char* argv[])
 {
-       test1_arena_size ();
-       
        test2_arena_push_pop ();
 
        return 0;