Skip to content

Commit 4f423b8

Browse files
committed
[Warnings] Fix implicit retain warnings in tests
Replace implicit retain of `self` when accessing ivars with explicit `self->`.
1 parent 97c6dd1 commit 4f423b8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

peertalk-tests/PTProtocolTests.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ - (void)setUp {
2424
queue_[0] = dispatch_queue_create("PTProtocolTests.queue_[0]", DISPATCH_QUEUE_SERIAL);
2525
PTAssertNotNULL(queue_[0]);
2626
channel_[0] = dispatch_io_create(DISPATCH_IO_STREAM, socket_[0], queue_[0], ^(int error) {
27-
close(socket_[0]);
27+
close(self->socket_[0]);
2828
});
2929
PTAssertNotNULL(channel_[0]);
3030

3131
queue_[1] = dispatch_queue_create("PTProtocolTests.queue_[1]", DISPATCH_QUEUE_SERIAL);
3232
PTAssertNotNULL(queue_[1]);
3333
channel_[1] = dispatch_io_create(DISPATCH_IO_STREAM, socket_[1], queue_[1], ^(int error) {
34-
close(socket_[1]);
34+
close(self->socket_[1]);
3535
});
3636
PTAssertNotNULL(channel_[1]);
3737

@@ -107,7 +107,7 @@ - (void)readFrameWithClient:(int)clientIndex
107107
XCTAssertEqual(receivedPayloadSize, expectedPayloadSize);
108108

109109
if (expectedPayloadSize != 0) {
110-
[protocol_[clientIndex] readPayloadOfSize:receivedPayloadSize overChannel:channel_[clientIndex] callback:^(NSError *error, dispatch_data_t contiguousData, const uint8_t *buffer, size_t bufferSize) {
110+
[self->protocol_[clientIndex] readPayloadOfSize:receivedPayloadSize overChannel:self->channel_[clientIndex] callback:^(NSError *error, dispatch_data_t contiguousData, const uint8_t *buffer, size_t bufferSize) {
111111
PTAssertNotNULL(contiguousData);
112112
PTAssertNotNULL(buffer);
113113
XCTAssertEqual((uint32_t)bufferSize, receivedPayloadSize);
@@ -191,7 +191,7 @@ - (void)test3_protocol_echo_frame {
191191
XCTAssertEqual(receivedPayloadSize, payloadSize);
192192

193193
// Reply on channel 1
194-
[protocol_[1] sendFrameOfType:PTFrameTypeTestPingReply tag:receivedFrameTag withPayload:nil overChannel:channel_[1] callback:^(NSError *error) {
194+
[self->protocol_[1] sendFrameOfType:PTFrameTypeTestPingReply tag:receivedFrameTag withPayload:nil overChannel:self->channel_[1] callback:^(NSError *error) {
195195
if (error) XCTFail(@"sendFrameOfType failed: %@", error);
196196
}];
197197
}];
@@ -326,7 +326,7 @@ - (void)test6_protocol_transmit_multiple_frames_with_payload {
326326
};
327327

328328
if (payloadSize) {
329-
[protocol_[1] readPayloadOfSize:payloadSize overChannel:channel_[1] callback:^(NSError *error, dispatch_data_t contiguousData, const uint8_t *buffer, size_t bufferSize) {
329+
[self->protocol_[1] readPayloadOfSize:payloadSize overChannel:self->channel_[1] callback:^(NSError *error, dispatch_data_t contiguousData, const uint8_t *buffer, size_t bufferSize) {
330330
PTAssertNotNULL(contiguousData);
331331
PTAssertNotNULL(buffer);
332332
XCTAssertEqual((uint32_t)bufferSize, payloadSize);

0 commit comments

Comments
 (0)