Exemplo n.º 1
0
        public static int Main(String [] args)
        {
            Console.WriteLine("Test should return with ExitCode 100 ...");

            m_o = new int[10];
            GCHandle h = GCHandle.Alloc(m_o, GCHandleType.Pinned);

            for (int i = 0; i < 100000; i++)
            {
                m_o = new int[10];
                m_n = new NDPin(m_o);
                h.Free();
                h = GCHandle.Alloc(m_o, GCHandleType.Pinned);
            }

            GC.Collect();

            bool result = (m_o == m_n.p);

            h.Free();

            if (result)
            {
                Console.WriteLine("Test Passed");
                return(100);
            }
            Console.WriteLine("Test Failed");
            return(1);
        }
Exemplo n.º 2
0
        public static int Main(String [] args)
        {
            Console.WriteLine("Test should return with ExitCode 100 ...");

            m_o = new int[10];
            GCHandle h = GCHandle.Alloc(m_o, GCHandleType.Pinned);

            for (int i = 0; i < 100000; i++)
            {

                m_o = new int[10];
                m_n = new NDPin (m_o);
                h.Free();
                h = GCHandle.Alloc(m_o, GCHandleType.Pinned);
            }

            GC.Collect();

            bool result = (m_o == m_n.p);
            h.Free();

            if (result)
            {
                Console.WriteLine ("Test Passed");
                return 100;
            }
            Console.WriteLine ("Test Failed");
            return 1;
        }