Skip to content

Instantly share code, notes, and snippets.

@normanmaurer
Created September 10, 2014 09:06
Show Gist options
  • Select an option

  • Save normanmaurer/1a85423c3eab5e295c77 to your computer and use it in GitHub Desktop.

Select an option

Save normanmaurer/1a85423c3eab5e295c77 to your computer and use it in GitHub Desktop.
@Test
public void testRefCnt() {
CompositeByteBuf comp = compositeBuffer();
ByteBuf buf1 = directBuffer(2, 2);
ByteBuf buf2 = directBuffer(2, 2);
comp.addComponent(buf1);
comp.addComponent(buf2);
//comp.writeInt(1);
//assertEquals(1, comp.getInt(0));
assertTrue(comp.release());
assertEquals(0, comp.refCnt());
assertEquals(0, buf1.refCnt());
assertEquals(0, buf2.refCnt());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment