summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2020-11-13 13:07:51 -0500
committerJackLivio <jack@livio.io>2020-11-13 13:07:51 -0500
commitbd51e85a28b70f3f2dc44ed572b405b1017dfef9 (patch)
treecab373ba61447999a16e04e3a4a3d123d9e8a759
parent1b921ede4a8763b793e8e3f3e7cf4a0ca31efff1 (diff)
downloadsdl_core-bd51e85a28b70f3f2dc44ed572b405b1017dfef9.tar.gz
Fix unit tests
-rw-r--r--src/components/connection_handler/src/heartbeat_monitor.cc7
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc10
-rw-r--r--src/components/protocol_handler/test/protocol_handler_tm_test.cc10
3 files changed, 12 insertions, 15 deletions
diff --git a/src/components/connection_handler/src/heartbeat_monitor.cc b/src/components/connection_handler/src/heartbeat_monitor.cc
index be50e6c802..8e15c934b9 100644
--- a/src/components/connection_handler/src/heartbeat_monitor.cc
+++ b/src/components/connection_handler/src/heartbeat_monitor.cc
@@ -88,10 +88,9 @@ void HeartBeatMonitor::threadMain() {
void HeartBeatMonitor::AddSession(uint8_t session_id) {
if (0 == default_heartbeat_timeout_) {
- SDL_LOG_INFO(
- "Won't add session with id "
- << static_cast<uint32_t>(session_id)
- << " because Heartbeat is disabled.");
+ SDL_LOG_INFO("Won't add session with id "
+ << static_cast<uint32_t>(session_id)
+ << " because Heartbeat is disabled.");
return;
}
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index d0505a42a3..c6edc58a91 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -2057,9 +2057,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
const ProtocolPacket& packet) {
const ConnectionID connection_id = packet.connection_id();
const uint32_t session_id = packet.session_id();
- SDL_LOG_DEBUG(
- "Sending heart beat acknowledgment for connection "
- << connection_id << " session " << session_id);
+ SDL_LOG_DEBUG("Sending heart beat acknowledgment for connection "
+ << connection_id << " session " << session_id);
uint8_t protocol_version;
if (session_observer_.ProtocolVersionUsed(
connection_id, session_id, protocol_version)) {
@@ -2069,9 +2068,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
const uint32_t connection_key =
session_observer_.KeyFromPair(connection_id, session_id);
if (!connection_handler_.IsSessionHeartbeatTracked(connection_key)) {
- SDL_LOG_DEBUG(
- "Session heartbeat tracking is not started. "
- << "Starting it for session " << session_id);
+ SDL_LOG_DEBUG("Session heartbeat tracking is not started. "
+ << "Starting it for session " << session_id);
connection_handler_.StartSessionHeartBeat(connection_key);
}
return SendHeartBeatAck(connection_id, session_id, packet.message_id());
diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
index 41c16817b5..e7d241ecbb 100644
--- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc
+++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
@@ -1995,7 +1995,7 @@ void ProtocolHandlerImplTest::VerifySecondaryTransportParamsInStartSessionAck(
AddSecurityManager();
EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
- .WillOnce(Return(connection_key));
+ .WillRepeatedly(Return(connection_key));
EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
.WillOnce(ReturnNull());
@@ -2107,7 +2107,7 @@ void ProtocolHandlerImplTest::VerifyCloudAppParamsInStartSessionAck(
AddSecurityManager();
EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
- .WillOnce(Return(connection_key));
+ .WillRepeatedly(Return(connection_key));
EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
.WillOnce(ReturnNull());
@@ -2577,7 +2577,7 @@ TEST_F(ProtocolHandlerImplTest,
AddSecurityManager();
EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
- .WillOnce(Return(connection_key));
+ .WillRepeatedly(Return(connection_key));
EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
.WillOnce(ReturnNull());
@@ -2763,7 +2763,7 @@ TEST_F(ProtocolHandlerImplTest,
AddSecurityManager();
EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
- .WillOnce(Return(connection_key));
+ .WillRepeatedly(Return(connection_key));
EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
.WillOnce(ReturnNull());
@@ -2884,7 +2884,7 @@ TEST_F(ProtocolHandlerImplTest,
AddSecurityManager();
EXPECT_CALL(session_observer_mock, KeyFromPair(connection_id, session_id))
- .WillOnce(Return(connection_key));
+ .WillRepeatedly(Return(connection_key));
EXPECT_CALL(session_observer_mock, GetSSLContext(connection_key, kRpc))
.WillOnce(ReturnNull());