Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
test_SystemInfoProvider.cpp File Reference

Unit tests for the SystemInfoProvider class. More...

#include "MockSystemCommandExecutor.hpp"
#include "SystemInfoProvider.hpp"
#include <gmock/gmock.h>
#include <gtest/gtest.h>

Go to the source code of this file.

Data Structures

class  SystemInfoProviderTest
 Test fixture for testing the SystemInfoProvider class. More...
 

Functions

 TEST_F (SystemInfoProviderTest, GetWifiStatus_Connected)
 Ensures that the wifi status is correctly retrieved.
 
 TEST_F (SystemInfoProviderTest, GetWifiStatus_Disconnected)
 Ensures that the wifi status is correctly retrieved when disconnected.
 
 TEST_F (SystemInfoProviderTest, GetWifiStatus_NoInterface)
 Ensures that the wifi status is correctly retrieved when no interface is detected.
 
 TEST_F (SystemInfoProviderTest, GetTemperature_ValidReading)
 Ensures that the wifi status is correctly retrieved when the wifi name is empty.
 
 TEST_F (SystemInfoProviderTest, GetTemperature_InvalidReading)
 Ensures that the temperature is correctly retrieved when the reading is invalid.
 
 TEST_F (SystemInfoProviderTest, GetIpAddress_Valid)
 Ensures that the IP address is correctly retrieved.
 
 TEST_F (SystemInfoProviderTest, GetIpAddress_NoIP)
 Ensures that the IP address is correctly retrieved when no IP address is found.
 

Detailed Description

Unit tests for the SystemInfoProvider class.

Version
0.1
Date
2025-02-12

This file contains unit tests for the SystemInfoProvider class, using Google Test and Google Mock frameworks.

Author
Félix LE BIHAN (@Fle-bihh)
Tiago Pereira (@t-pereira06)
Ricardo Melo (@reomelo)
Michel Batista (@MicchelFAB)

Definition in file test_SystemInfoProvider.cpp.

Function Documentation

◆ TEST_F() [1/7]

TEST_F ( SystemInfoProviderTest ,
GetIpAddress_NoIP  )

Ensures that the IP address is correctly retrieved when no IP address is found.

Test
Tests if the IP address is correctly retrieved when no IP address is found.

This test verifies that the IP address is correctly retrieved when no IP address is found. The IP address should be "No IP address".

See also
SystemInfoProvider::getIpAddress

Definition at line 171 of file test_SystemInfoProvider.cpp.

◆ TEST_F() [2/7]

TEST_F ( SystemInfoProviderTest ,
GetIpAddress_Valid  )

Ensures that the IP address is correctly retrieved.

Test
Tests if the IP address is correctly retrieved.

This test verifies that the IP address is correctly retrieved. The IP address should be "

See also
SystemInfoProvider::getIpAddress

Definition at line 150 of file test_SystemInfoProvider.cpp.

◆ TEST_F() [3/7]

TEST_F ( SystemInfoProviderTest ,
GetTemperature_InvalidReading  )

Ensures that the temperature is correctly retrieved when the reading is invalid.

Test
Tests if the temperature is correctly retrieved when the reading is invalid.

This test verifies that the temperature is correctly retrieved when the reading is invalid. The temperature should be "N/A".

See also
SystemInfoProvider::getTemperature

Definition at line 132 of file test_SystemInfoProvider.cpp.

◆ TEST_F() [4/7]

TEST_F ( SystemInfoProviderTest ,
GetTemperature_ValidReading  )

Ensures that the wifi status is correctly retrieved when the wifi name is empty.

Test
Tests if the wifi status is correctly retrieved when the wifi name is empty.

This test verifies that the wifi status is correctly retrieved when the wifi name is empty. The wifi status should be "Connected" and the wifi name should be empty.

See also
SystemInfoProvider::getWifiStatus

Definition at line 114 of file test_SystemInfoProvider.cpp.

◆ TEST_F() [5/7]

TEST_F ( SystemInfoProviderTest ,
GetWifiStatus_Connected  )

Ensures that the wifi status is correctly retrieved.

Test
Tests if the wifi status is correctly retrieved.

This test verifies that the wifi status is correctly retrieved. The wifi status should be "Connected" and the wifi name should be "MyWiFi".

See also
SystemInfoProvider::getWifiStatus

Definition at line 51 of file test_SystemInfoProvider.cpp.

◆ TEST_F() [6/7]

TEST_F ( SystemInfoProviderTest ,
GetWifiStatus_Disconnected  )

Ensures that the wifi status is correctly retrieved when disconnected.

Test
Tests if the wifi status is correctly retrieved when disconnected.

This test verifies that the wifi status is correctly retrieved when disconnected. The wifi status should be "Disconnected" and the wifi name should be empty.

See also
SystemInfoProvider::getWifiStatus

Definition at line 72 of file test_SystemInfoProvider.cpp.

◆ TEST_F() [7/7]

TEST_F ( SystemInfoProviderTest ,
GetWifiStatus_NoInterface  )

Ensures that the wifi status is correctly retrieved when no interface is detected.

Test
Tests if the wifi status is correctly retrieved when no interface is detected.

This test verifies that the wifi status is correctly retrieved when no interface is detected. The wifi status should be "No interface detected" and the wifi name should be empty.

See also
SystemInfoProvider::getWifiStatus

Definition at line 93 of file test_SystemInfoProvider.cpp.