15#include <QCoreApplication>
21#include <gtest/gtest.h>
31 static QCoreApplication *
app;
40 char *argv[] = {
nullptr};
41 app =
new QCoreApplication(argc, argv);
80 systemManager->initialize();
81 QCoreApplication::processEvents();
83 ASSERT_GT(spy.count(), 0);
84 QList<QVariant> args = spy.takeFirst();
85 EXPECT_FALSE(args.isEmpty());
99 systemManager->initialize();
100 QCoreApplication::processEvents();
102 ASSERT_GT(spy.count(), 0);
103 QList<QVariant> args = spy.takeFirst();
104 EXPECT_FALSE(args.isEmpty());
118 systemManager->initialize();
119 QCoreApplication::processEvents();
121 ASSERT_GT(spy.count(), 0);
122 QList<QVariant> args = spy.takeFirst();
123 EXPECT_FALSE(args.isEmpty());
137 systemManager->initialize();
138 QCoreApplication::processEvents();
140 ASSERT_GT(spy.count(), 0);
141 QList<QVariant> args = spy.takeFirst();
142 EXPECT_GE(args.at(0).toFloat(), 0.0f);
143 EXPECT_LE(args.at(0).toFloat(), 100.0f);
157 systemManager->initialize();
158 QCoreApplication::processEvents();
160 ASSERT_GT(spy.count(), 0);
161 QList<QVariant> args = spy.takeFirst();
162 EXPECT_FALSE(args.isEmpty());
173 systemManager->initialize();
174 systemManager->shutdown();
176 EXPECT_EQ(systemManager->getTimeTimer().isActive(),
false);
177 EXPECT_EQ(systemManager->getStatusTimer().isActive(),
false);
Definition of the BatteryController class.
Definition of the SystemCommandExecutor class.
Definition of the SystemInfoProvider class.
Definition of the SystemManager class.
Class that manages the battery of the vehicle.
Interface for managing the battery of the vehicle.
Interface for executing system commands and reading files.
Interface for providing system information to the display manager.
Class that executes system commands and reads files.
Class that provides system information to the display manager.
Class to test the integration between the SystemManager and the BatteryController,...
static void TearDownTestSuite()
static void SetUpTestSuite()
ISystemInfoProvider * systemInfoProvider
static QCoreApplication * app
Initialize static member.
ISystemCommandExecutor * systemCommandExecutor
IBatteryController * batteryController
SystemManager * systemManager
Class that manages the system time, status, and battery. QObject.
void ipAddressUpdated(const QString &ipAddress)
void batteryPercentageUpdated(float batteryPercentage)
void wifiStatusUpdated(const QString &status, const QString &wifiName)
void timeUpdated(const QString ¤tDate, const QString ¤tTime, const QString ¤tDay)
void temperatureUpdated(const QString &temperature)
TEST_F(SystemManagerTest, UpdateTimeSignal)
Ensures that the SystemManager initializes successfully.