Esempio n. 1
0
        public void TimeExpManagedTest()
        {
            GCHandle   mt;
            AprTimeExp t = AprTimeExp.Alloc(out mt);

            Assert.IsFalse(t.IsNull, "#G01");
            Assert.IsTrue(mt.IsAllocated, "#G02");

            TimeExpTest1(t, "#G");

            t.ClearPtr();
            mt.Free();
            t = AprTimeExp.Alloc(out mt);
            Assert.IsFalse(t.IsNull, "#G03");

            TimeExpTest2(t, "#G");

            t.ClearPtr();
            mt.Free();
            t = AprTimeExp.Alloc(out mt);
            Assert.IsFalse(t.IsNull, "#G04");

            TimeExpTest3(t, "#G");

            t.ClearPtr();
            mt.Free();
            t = AprTimeExp.Alloc(out mt);
            Assert.IsFalse(t.IsNull, "#G04");

            TimeExpTest4(t, "#G");

            mt.Free();
        }
Esempio n. 2
0
        public void TimeExpPoolTest()
        {
            AprPool p = AprPool.Create();

            Assert.IsFalse(p.IsNull, "#F01");

            AprTimeExp t = AprTimeExp.Alloc(p);

            Assert.IsFalse(t.IsNull, "#F02");

            TimeExpTest1(t, "#F");

            t.ClearPtr();
            t = AprTimeExp.Alloc(p);
            Assert.IsFalse(t.IsNull, "#F03");

            TimeExpTest2(t, "#F");

            t.ClearPtr();
            t = AprTimeExp.Alloc(p);
            Assert.IsFalse(t.IsNull, "#F04");

            TimeExpTest3(t, "#F");

            t.ClearPtr();
            t = AprTimeExp.Alloc(p);
            Assert.IsFalse(t.IsNull, "#F04");

            TimeExpTest4(t, "#F");

            p.Destroy();
            Assert.IsTrue(p.IsNull, "#F05");
        }