summaryrefslogtreecommitdiff
path: root/src/components/protocol_handler
diff options
context:
space:
mode:
authorSho Amano <samano@xevo.com>2018-06-28 14:14:59 +0900
committerSho Amano <samano@xevo.com>2018-06-28 17:36:33 +0900
commit09fab4fe47c5b06384dcfd5147186c4507ded320 (patch)
treeccaeeb82c60ebe806e82ff1c5ae253228beaceb6 /src/components/protocol_handler
parent1b949923cff8ee3a9386608a76a04c1a9bbe21cb (diff)
downloadsdl_core-09fab4fe47c5b06384dcfd5147186c4507ded320.tar.gz
Update NonConstDataAccessor to align with PR #2254
Like DataAccessor, NonConstDataAccessor uses a shared pointer of a Lock instance.
Diffstat (limited to 'src/components/protocol_handler')
-rw-r--r--src/components/protocol_handler/test/protocol_handler_tm_test.cc9
1 files changed, 6 insertions, 3 deletions
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 634512a2d2..f840a3f258 100644
--- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc
+++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
@@ -206,6 +206,9 @@ class ProtocolHandlerImplTest : public ::testing::Test {
.
// Return false to avoid call KeepConnectionAlive
WillRepeatedly(Return(false));
+
+ session_connection_map_lock_ptr_ =
+ std::make_shared<sync_primitives::Lock>();
}
void TearDown() OVERRIDE {
@@ -393,7 +396,7 @@ class ProtocolHandlerImplTest : public ::testing::Test {
// Used by OnTransportConfigUpdated() tests. The lifetime of these objects
// should be longer than that of a test case.
connection_handler::SessionConnectionMap session_connection_map_;
- sync_primitives::Lock session_connection_map_lock_;
+ std::shared_ptr<sync_primitives::Lock> session_connection_map_lock_ptr_;
};
#ifdef ENABLE_SECURITY
@@ -2418,7 +2421,7 @@ TEST_F(ProtocolHandlerImplTest,
EXPECT_CALL(connection_handler_mock, session_connection_map())
.WillOnce(Return(NonConstDataAccessor<SessionConnectionMap>(
- session_connection_map_, session_connection_map_lock_)));
+ session_connection_map_, session_connection_map_lock_ptr_)));
EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
.WillRepeatedly(
@@ -2489,7 +2492,7 @@ TEST_F(ProtocolHandlerImplTest,
EXPECT_CALL(connection_handler_mock, session_connection_map())
.WillOnce(Return(NonConstDataAccessor<SessionConnectionMap>(
- session_connection_map_, session_connection_map_lock_)));
+ session_connection_map_, session_connection_map_lock_ptr_)));
EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(_, _, _))
.WillRepeatedly(