diff --git a/services/softbusadapter/test/unittest/src/softbus_adapter_test.cpp b/services/softbusadapter/test/unittest/src/softbus_adapter_test.cpp index 331eeecddb348f292f0dc2b340c78665d4ac8352..902c05fa0debeb58b4b9e8ca1cf77f35903ba718 100644 --- a/services/softbusadapter/test/unittest/src/softbus_adapter_test.cpp +++ b/services/softbusadapter/test/unittest/src/softbus_adapter_test.cpp @@ -14,6 +14,8 @@ */ #include "softbus_adapter_test.h" +#include "accesstoken_kit.h" +#include "nativetoken_kit.h" #include "socket.h" #include "softbus_adapter.h" #include "token_setproc.h" @@ -440,7 +442,8 @@ HWTEST_F(SoftbusAdapterTest, OnSoftbusSessionClosed_001, TestSize.Level1) { int32_t sessionId = 0; ShutdownReason reason = SHUTDOWN_REASON_UNKNOWN; - softbusAdapter_->mapSessListeners_[sessionId] = nullptr; + std::shared_ptr listener = nullptr; + softbusAdapter_->mapListeners_["hello_world"] = listener; softbusAdapter_->OnSoftbusSessionClosed(sessionId, reason); EXPECT_TRUE(softbusAdapter_->mapSessListeners_.size() > 0); }