diff --git a/src/messaging/tests/TestExchangeMgr.cpp b/src/messaging/tests/TestExchangeMgr.cpp index 31829182638aa4..4baafff5dc444b 100644 --- a/src/messaging/tests/TestExchangeMgr.cpp +++ b/src/messaging/tests/TestExchangeMgr.cpp @@ -78,19 +78,19 @@ void CheckSimpleInitTest(nlTestSuite * inSuite, void * inContext) { TestContext & ctx = *reinterpret_cast(inContext); - TransportMgr tm; - SecureSessionMgr conn; + TransportMgr transportManager; + SecureSessionMgr secureSessionManager; CHIP_ERROR err; ctx.GetInetLayer().SystemLayer()->Init(nullptr); - err = conn.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); - tm.Init(&conn, nullptr, "LOOPBACK"); + err = secureSessionManager.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); + transportManager.Init(&secureSessionManager, nullptr, "LOOPBACK"); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); ExchangeManager exchangeMgr; - err = exchangeMgr.Init(&conn); + err = exchangeMgr.Init(&secureSessionManager); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); } @@ -98,18 +98,18 @@ void CheckNewContextTest(nlTestSuite * inSuite, void * inContext) { TestContext & ctx = *reinterpret_cast(inContext); - TransportMgr tm; - SecureSessionMgr conn; + TransportMgr transportManager; + SecureSessionMgr secureSessionManager; CHIP_ERROR err; ctx.GetInetLayer().SystemLayer()->Init(nullptr); - err = conn.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); - tm.Init(&conn, nullptr, "LOOPBACK"); + err = secureSessionManager.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); + transportManager.Init(&secureSessionManager, nullptr, "LOOPBACK"); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); ExchangeManager exchangeMgr; - err = exchangeMgr.Init(&conn); + err = exchangeMgr.Init(&secureSessionManager); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); ExchangeContext * ec1 = exchangeMgr.NewContext(kSourceNodeId, (void *) 0x1234); @@ -129,19 +129,19 @@ void CheckFindContextTest(nlTestSuite * inSuite, void * inContext) { TestContext & ctx = *reinterpret_cast(inContext); - TransportMgr tm; - SecureSessionMgr conn; + TransportMgr transportManager; + SecureSessionMgr secureSessionManager; CHIP_ERROR err; ctx.GetInetLayer().SystemLayer()->Init(nullptr); - err = conn.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); + err = secureSessionManager.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = tm.Init(&conn, nullptr, "LOOPBACK"); + err = transportManager.Init(&secureSessionManager, nullptr, "LOOPBACK"); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); ExchangeManager exchangeMgr; - err = exchangeMgr.Init(&conn); + err = exchangeMgr.Init(&secureSessionManager); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); ExchangeContext * ec = exchangeMgr.NewContext(kDestinationNodeId, nullptr); @@ -158,19 +158,19 @@ void CheckUmhRegistrationTest(nlTestSuite * inSuite, void * inContext) { TestContext & ctx = *reinterpret_cast(inContext); - TransportMgr tm; - SecureSessionMgr conn; + TransportMgr transportManager; + SecureSessionMgr secureSessionManager; CHIP_ERROR err; ctx.GetInetLayer().SystemLayer()->Init(nullptr); - err = conn.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); + err = secureSessionManager.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = tm.Init(&conn, nullptr, "LOOPBACK"); + err = transportManager.Init(&secureSessionManager, nullptr, "LOOPBACK"); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); ExchangeManager exchangeMgr; - err = exchangeMgr.Init(&conn); + err = exchangeMgr.Init(&secureSessionManager); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = exchangeMgr.RegisterUnsolicitedMessageHandler(0x0001, HanldeAllUnsolicitedMessage, nullptr); diff --git a/src/transport/tests/TestSecureSessionMgr.cpp b/src/transport/tests/TestSecureSessionMgr.cpp index fc135e4cf6edba..49541e1fd152d7 100644 --- a/src/transport/tests/TestSecureSessionMgr.cpp +++ b/src/transport/tests/TestSecureSessionMgr.cpp @@ -95,15 +95,15 @@ void CheckSimpleInitTest(nlTestSuite * inSuite, void * inContext) { TestContext & ctx = *reinterpret_cast(inContext); - TransportMgr tm; - SecureSessionMgr conn; + TransportMgr transportManager; + SecureSessionMgr secureSessionManager; CHIP_ERROR err; ctx.GetInetLayer().SystemLayer()->Init(nullptr); - err = conn.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); + err = secureSessionManager.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = tm.Init(&conn, nullptr, "LOOPBACK"); + err = transportManager.Init(&secureSessionManager, nullptr, "LOOPBACK"); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); } @@ -125,32 +125,32 @@ void CheckMessageTest(nlTestSuite * inSuite, void * inContext) IPAddress::FromString("127.0.0.1", addr); CHIP_ERROR err = CHIP_NO_ERROR; - TransportMgr tm; - SecureSessionMgr conn; + TransportMgr transportManager; + SecureSessionMgr secureSessionManager; - err = conn.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); + err = secureSessionManager.Init(kSourceNodeId, ctx.GetInetLayer().SystemLayer()); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = tm.Init(&conn, nullptr, "LOOPBACK"); + err = transportManager.Init(&secureSessionManager, nullptr, "LOOPBACK"); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); callback.mSuite = inSuite; - conn.SetDelegate(&callback); + secureSessionManager.SetDelegate(&callback); SecurePairingUsingTestSecret pairing1(Optional::Value(kSourceNodeId), 1, 2); Optional peer(Transport::PeerAddress::UDP(addr, CHIP_PORT)); - err = conn.NewPairing(peer, &pairing1); + err = secureSessionManager.NewPairing(peer, &pairing1); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); SecurePairingUsingTestSecret pairing2(Optional::Value(kDestinationNodeId), 2, 1); - err = conn.NewPairing(peer, &pairing2); + err = secureSessionManager.NewPairing(peer, &pairing2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); // Should be able to send a message to itself by just calling send. callback.ReceiveHandlerCallCount = 0; - err = conn.SendMessage(kDestinationNodeId, buffer); + err = secureSessionManager.SendMessage(kDestinationNodeId, buffer); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); ctx.DriveIOUntil(1000 /* ms */, []() { return callback.ReceiveHandlerCallCount != 0; });