public void RetainResurrect2() { AbstractReferenceCountedByteBuffer referenceCounted = NewReferenceCounted(); Assert.True(referenceCounted.Release()); Assert.Equal(0, referenceCounted.ReferenceCount); Assert.Throws <IllegalReferenceCountException>(() => referenceCounted.Retain(2)); }
public void ReleaseOverflow() { AbstractReferenceCountedByteBuffer referenceCounted = NewReferenceCounted(); referenceCounted.SetReferenceCount(0); Assert.Equal(0, referenceCounted.ReferenceCount); Assert.Throws <IllegalReferenceCountException>(() => referenceCounted.Release(int.MaxValue)); }