GeezerVison is showing github.com — Remove the test of a heap AdaptiveByteBuf's memory address · netty/netty@bc01fbc
File tree
Expand file treeCollapse file tree
Open diff view settings
buffer/src/test/java/io/netty/buffer
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: buffer/src/test/java/io/netty/buffer/AdaptiveByteBufAllocatorTest.java -19Lines changed: 0 additions & 19 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -108,25 +108,6 @@ public void testDirectBufferMemoryAddressFollowsItsSegment() { |
108 | 108 | assertEquals(0L, unwrappedSecond._memoryAddress()); |
109 | 109 | } |
110 | 110 |
|
111 | | - @Test |
112 | | - public void testHeapBufferMemoryAddressIsZero() { |
113 | | - AdaptiveByteBufAllocator allocator = newAllocator(false); |
114 | | - // A heap buffer has no memory address. It used to return its offset in the chunk instead of 0, which the |
115 | | - // second buffer shows if it's at an offset above zero, as it likely is. |
116 | | - ByteBuf first = allocator.heapBuffer(16, 1 << 20); |
117 | | - ByteBuf second = allocator.heapBuffer(16, 1 << 20); |
118 | | - try { |
119 | | - for (ByteBuf buf : new ByteBuf[] { first, second }) { |
120 | | - assertFalse(buf.hasMemoryAddress()); |
121 | | - assertEquals(0L, buf.memoryAddress()); |
122 | | - assertEquals(0L, unwrapToAbstractByteBuf(buf)._memoryAddress()); |
123 | | - } |
124 | | - } finally { |
125 | | - first.release(); |
126 | | - second.release(); |
127 | | - } |
128 | | - } |
129 | | - |
130 | 111 | // The NIO buffer's address is computed from the chunk's buffer separately from memoryAddress(), and comparing the |
131 | 112 | // addresses avoids reading memory through a wrong one. |
132 | 113 | private static void assertMemoryAddressMatchesTheNioBuffer(ByteBuf buf) { |
|