GeezerVison is showing github.com — Reuse stream-text variables in the concatenated FEXTRA test · netty/netty@4254ff0
File tree
Expand file treeCollapse file tree
Open diff view settings
codec-compression/src/test/java/io/netty/handler/codec/compression
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: codec-compression/src/test/java/io/netty/handler/codec/compression/JdkZlibTest.java +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -170,8 +170,10 @@ public void testConcatenatedGzipFirstStreamHasExtraField() throws Exception { |
170 | 170 | // leak its XLEN into the second stream's header parsing. The xlen state has to be reset |
171 | 171 | // between streams; otherwise the second stream (which has no extra field) would skip |
172 | 172 | // xlen bytes that are actually deflate data and fail to decode. |
173 | | - byte[] first = "first stream".getBytes(CharsetUtil.UTF_8); |
174 | | - byte[] second = "second stream".getBytes(CharsetUtil.UTF_8); |
| 173 | + String firstText = "first stream"; |
| 174 | + String secondText = "second stream"; |
| 175 | + byte[] first = firstText.getBytes(CharsetUtil.UTF_8); |
| 176 | + byte[] second = secondText.getBytes(CharsetUtil.UTF_8); |
175 | 177 | byte[] extra = { 0x42, 0x43, 0x02, 0x00, (byte) 0x99, 0x00 }; |
176 | 178 |
|
177 | 179 | byte[] firstGz = gzipWithExtraField(first, extra); // first stream HAS an extra field |
@@ -189,7 +191,7 @@ public void testConcatenatedGzipFirstStreamHasExtraField() throws Exception { |
189 | 191 | msg.readBytes(decoded, msg.readableBytes()); |
190 | 192 | msg.release(); |
191 | 193 | } |
192 | | - assertArrayEquals("first streamsecond stream".getBytes(CharsetUtil.UTF_8), |
| 194 | + assertArrayEquals((firstText + secondText).getBytes(CharsetUtil.UTF_8), |
193 | 195 | decoded.toByteArray()); |
194 | 196 | decoded.close(); |
195 | 197 | } finally { |
|