Skip to content

Commit

Permalink
make the shared ptr as null
Browse files Browse the repository at this point in the history
  • Loading branch information
parvathika committed Dec 27, 2024
1 parent dff6665 commit a64337d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LegacyPlugin_WiFiManagerAPIs.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace WPEFramework {

private:
PluginHost::IShell* m_service;
std::shared_ptr<WPEFramework::JSONRPC::SmartLinkType<WPEFramework::Core::JSON::IElement>> m_networkmanager;
std::shared_ptr<WPEFramework::JSONRPC::SmartLinkType<WPEFramework::Core::JSON::IElement>> m_networkmanager{};
NetworkManagerTimer m_timer;
bool m_subsWiFiStateChange;
bool m_subsAvailableSSIDs;
Expand Down
13 changes: 7 additions & 6 deletions Tests/unit_test/test_LegacyPlugin_WiFiManagerAPIs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@ using namespace std;
using namespace WPEFramework;
using namespace WPEFramework::Plugin;
using ::testing::NiceMock;
using ::testing::Return;
//using ::testing::Return;

class MockWiFiManager : public WiFiManager {
/*class MockWiFiManager : public WiFiManager {
public:
MOCK_METHOD(subscribeToEvents, void());
};
};*/

class WiFiManagerTest : public ::testing::Test {
protected:
//Core::ProxyType<Plugin::WiFiManager> plugin;
Core::ProxyType<MockWiFiManager> plugin;
Core::ProxyType<Plugin::WiFiManager> plugin;
//Core::ProxyType<MockWiFiManager> plugin;
Core::JSONRPC::Handler& handler;
DECL_CORE_JSONRPC_CONX connection;
Core::JSONRPC::Message message;
string response;
ServiceMock services;

WiFiManagerTest()
: plugin(Core::ProxyType<MockWiFiManager>::Create()) //plugin(Core::ProxyType<Plugin::WiFiManager>::Create())
//: plugin(Core::ProxyType<MockWiFiManager>::Create())
: plugin(Core::ProxyType<Plugin::WiFiManager>::Create())
, handler(*(plugin))
, INIT_CONX(1, 0)
{
Expand Down

0 comments on commit a64337d

Please sign in to comment.