コード例 #1
0
        public void RetainResurrect2()
        {
            AbstractReferenceCountedByteBuffer referenceCounted = NewReferenceCounted();

            Assert.True(referenceCounted.Release());
            Assert.Equal(0, referenceCounted.ReferenceCount);
            Assert.Throws <IllegalReferenceCountException>(() => referenceCounted.Retain(2));
        }
コード例 #2
0
        public void ReleaseOverflow()
        {
            AbstractReferenceCountedByteBuffer referenceCounted = NewReferenceCounted();

            referenceCounted.SetReferenceCount(0);
            Assert.Equal(0, referenceCounted.ReferenceCount);
            Assert.Throws <IllegalReferenceCountException>(() => referenceCounted.Release(int.MaxValue));
        }