[test] Fix finalizer-exception test
authorVlad Brezae <brezaevlad@gmail.com>
Mon, 15 Jun 2015 19:16:49 +0000 (12:16 -0700)
committerVlad Brezae <brezaevlad@gmail.com>
Mon, 15 Jun 2015 19:16:49 +0000 (12:16 -0700)
Me might be very unlucky and still have the object pinned in random stack memory. Allocate multiple objects so we are sure that at least one of them is finalized.

mono/tests/finalizer-exception.cs

index 0e48d9081c045dc93a7260d5534bfd6e74ec3e91..71f4b4cc20933647e7fcc1df7d36407ec6261ae7 100644 (file)
@@ -18,7 +18,8 @@ public class FinalizerException {
                int* values = stackalloc int [20];
                aptr = new IntPtr (values);
                if (depth <= 0) {
-                       new FinalizerException ();
+                       for (int i = 0; i < 10; i++)
+                               new FinalizerException ();
                        return;
                }
                MakeException (depth - 1);