Skip to content

Commit

Permalink
add module.cpp file
Browse files Browse the repository at this point in the history
  • Loading branch information
parvathika committed Dec 5, 2024
1 parent 653675c commit da43b9c
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 60 deletions.
48 changes: 48 additions & 0 deletions Tests/unit_test/test_LegacyPlugin_WiFiManagerAPIs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <fstream>

/*#include "Tests/unittest/mocks/thunder/ServiceMock.h"
#include "Tests/unittest/mocks/thunder/FactoriesImplementation.h"
#include "Tests/unittest/mocks/thunder/DispatcherMock.h"
#include "Tests/unittest/mocks/thunder/COMLinkMock.h"
#include "Tests/unittest/mocks/thunder/WorkerPoolImplementation.h"*/



#include "LegacyPlugin_WiFiManagerAPIs.h"
#include "NetworkManagerLogger.h"
#include "NetworkManagerJsonEnum.h"

using namespace std;
using namespace WPEFramework;

using ::testing::NiceMock;
using namespace WPEFramework::Plugin;



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

NiceMock<PluginHost::IShell> mockShell;
NiceMock<PluginHost::IDispatcher> mockDispatcher;


WiFiManagerTest()
: plugin(Core::ProxyType<WiFiManager>::Create())
, handler(*(plugin))
, connection(1, 0) {
}

virtual ~WiFiManagerTest() override {

}
};


24 changes: 1 addition & 23 deletions Tests/unit_test/test_NetworkManagerConnectivity.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#include "NetworkManagerImplementation.h"
#include "NetworkManagerConnectivity.h"
#include "WiFiSignalStrengthMonitor.h"
#include <cstring>
#include <atomic>
#include <vector>
#include <thread>
#include <chrono>
#include <map>
#include <curl/curl.h>
#include <condition_variable>
#include <mutex>
#include <cerrno>
#include <cstdlib>
#include <fstream>
#include <algorithm>
#include <ctime>

#include <gtest/gtest.h>
#include <gmock/gmock.h>

Expand All @@ -25,14 +11,6 @@ class ConnectivityMonitorTest : public ::testing::Test {
protected:

WPEFramework::Plugin::ConnectivityMonitor cm;

void SetUp() override {

}

void TearDown() override {

}
};

TEST_F(ConnectivityMonitorTest, StartContinuousMonitor_Success) {
Expand Down
32 changes: 0 additions & 32 deletions Tests/unit_test/test_NetworkManagerStunClient.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
#include <assert.h>
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <net/if.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <algorithm>
#include <exception>
#include <limits>
#include <memory>
#include <random>
#include <set>
#include <sstream>
#include <thread>
#include <iostream>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "NetworkManagerStunClient.h"
Expand All @@ -28,23 +8,11 @@ using namespace stun;
class AddressTest : public ::testing::Test {
protected:
stun::attributes::address ad;
void SetUp() override {

}
void TearDown() override {

}
};

class ClientTest : public ::testing::Test {
protected:
stun::client cl;
void SetUp() override {

}
void TearDown() override {

}
};

TEST_F(ClientTest, BindSuccess) {
Expand Down
5 changes: 0 additions & 5 deletions Tests/unit_test/test_WiFiSignalStrengthMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ namespace WPEFramework
class WiFiSignalStrengthMonitorTest : public ::testing::Test {
protected:
WPEFramework::Plugin::WiFiSignalStrengthMonitor monitor;
void SetUp() override {
}
void TearDown() override {
}
};
#define BUFFER_SIZE 1024

TEST_F(WiFiSignalStrengthMonitorTest, GetSignalData_Connected) {
std::string ssid = "TestSSID";
Expand Down

0 comments on commit da43b9c

Please sign in to comment.