Skip to content

Commit e9059c2

Browse files
Dominika MaziecDominika Maziec
authored andcommitted
TLSSocketWrapper::recvfrom sets SocketAddress output variable
UNITTEST added. TLSSocketWrapper unittest does not use stoip4_stub anymore.
1 parent 46a56fb commit e9059c2

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

UNITTESTS/features/netsocket/TLSSocketWrapper/test_TLSSocketWrapper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ TEST_F(TestTLSSocketWrapper, recv_from)
307307
EXPECT_EQ(wrapper->connect(a), NSAPI_ERROR_OK);
308308
SocketAddress b;
309309
EXPECT_EQ(wrapper->recvfrom(&b, dataBuf, dataSize), NSAPI_ERROR_OK);
310+
EXPECT_EQ(a, b);
310311
}
311312

312313
TEST_F(TestTLSSocketWrapper, recv_from_null)

UNITTESTS/features/netsocket/TLSSocketWrapper/unittest.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ set(unittest-test-sources
2828
stubs/mbed_shared_queues_stub.cpp
2929
stubs/nsapi_dns_stub.cpp
3030
stubs/EventFlags_stub.cpp
31-
stubs/stoip4_stub.c
32-
stubs/ip4tos_stub.c
3331
stubs/SocketStats_Stub.cpp
3432
)
3533

features/netsocket/TLSSocketWrapper.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ nsapi_size_or_error_t TLSSocketWrapper::recv(void *data, nsapi_size_t size)
398398

399399
nsapi_size_or_error_t TLSSocketWrapper::recvfrom(SocketAddress *address, void *data, nsapi_size_t size)
400400
{
401+
if (address) {
402+
getpeername(address);
403+
}
401404
return recv(data, size);
402405
}
403406

0 commit comments

Comments
 (0)