Skip to content

Commit

Permalink
fix warning in new ByteBuffer test (#377)
Browse files Browse the repository at this point in the history
Motivation:

there was a new, avoidable warning in a ByteBuffer test.

Modifications:

fix the warning

Result:

fewer warnings
  • Loading branch information
weissi authored May 2, 2018
1 parent 8bf1be0 commit 2b9469b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Tests/NIOTests/ByteBufferTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1323,13 +1323,14 @@ class ByteBufferTest: XCTestCase {
XCTAssertEqual(0xaa, buffer.readInteger(as: UInt8.self))
XCTAssertEqual(0, buffer.readableBytes)

var buffer2 = buffer
let buffer2 = buffer
XCTAssertTrue(buffer.discardReadBytes())
XCTAssertEqual(0, buffer.readerIndex)
XCTAssertEqual(0, buffer.writerIndex)
// As we fully consumed the buffer we should only have adjusted the indices but not triggered a copy as result of CoW sematics.
// So we should still be able to also read the old data.
XCTAssertEqual(0xaa, buffer.getInteger(at: 0, as: UInt8.self))
XCTAssertEqual(0, buffer2.readableBytes)
}

func testDumpBytesFormat() throws {
Expand Down

0 comments on commit 2b9469b

Please sign in to comment.