Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Commit 8b285c2

Browse files
author
Antti Yli-Tokola
committed
Update unit tests
1 parent 5405255 commit 8b285c2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

test/mbed-client-mbed-tls/unittest/m2mconnectionsecuritypimpl_mbedtls/test_m2mconnectionsecuritypimpl_mbedtls.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class TestObserver : public M2MConnectionObserver {
4949
uint16_t,
5050
const M2MConnectionObserver::SocketAddress &){}
5151

52-
void socket_error(uint8_t error_code){}
52+
void socket_error(uint8_t error_code, bool retry = true){}
5353

5454
void address_ready(const M2MConnectionObserver::SocketAddress &,
5555
M2MConnectionObserver::ServerType,
@@ -319,6 +319,10 @@ void Test_M2MConnectionSecurityPimpl::test_continue_connecting()
319319
mbedtls_stub::expected_int = MBEDTLS_ERR_SSL_WANT_READ;
320320
CHECK( M2MConnectionHandler::CONNECTION_ERROR_WANTS_READ == impl.continue_connecting());
321321

322+
mbedtls_stub::expected_int = MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST;
323+
impl._ssl.state = MBEDTLS_SSL_CLIENT_HELLO;
324+
CHECK( MBEDTLS_ERR_SSL_TIMEOUT == impl.continue_connecting());
325+
322326
mbedtls_stub::expected_int = -6;
323327
impl._ssl.state = MBEDTLS_SSL_HANDSHAKE_OVER;
324328
CHECK( 0 == impl.continue_connecting());

test/mbed-client-mbed-tls/unittest/stub/m2mbase_stub.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,3 +308,8 @@ const String& M2MBase::uri_path() const
308308
{
309309
return *m2mbase_stub::string_value;
310310
}
311+
312+
bool M2MBase::is_under_observation() const
313+
{
314+
return m2mbase_stub::bool_value;
315+
}

0 commit comments

Comments
 (0)