Exemplo n.º 1
0
        public static void DisposeOwnedMemoryAfterRetain()
        {
            int[]             a     = { 91, 92, -93, 94 };
            OwnedMemory <int> owner = new CustomMemoryForTest <int>(a);

            owner.Retain();
            Assert.Throws <InvalidOperationException>(() => owner.Dispose());
            owner.Release();
        }
Exemplo n.º 2
0
        public static void DisposeOwnedMemoryAfterRetainAndRelease()
        {
            int[]             a     = { 91, 92, -93, 94 };
            OwnedMemory <int> owner = new CustomMemoryForTest <int>(a);

            owner.Retain();
            owner.Release();
            owner.Dispose();
            Assert.True(owner.IsDisposed);
        }