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

Unit tests for the BatteryController class. More...

#include "BatteryController.hpp"
#include "MockI2CController.hpp"
#include <gmock/gmock.h>
#include <gtest/gtest.h>

Go to the source code of this file.

Data Structures

class  BatteryControllerTest
 Test fixture for testing the BatteryController class. More...
 

Functions

 TEST_F (BatteryControllerTest, Initialization_CallsCalibration)
 Ensures that the battery controller initializes correctly.
 
 TEST_F (BatteryControllerTest, GetBatteryPercentage_CorrectCalculation)
 Ensures that the battery percentage is calculated correctly.
 

Detailed Description

Unit tests for the BatteryController class.

Version
0.1
Date
2025-02-12

This file contains unit tests for the BatteryController 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_BatteryController.cpp.

Function Documentation

◆ TEST_F() [1/2]

TEST_F ( BatteryControllerTest ,
GetBatteryPercentage_CorrectCalculation  )

Ensures that the battery percentage is calculated correctly.

Test
Tests if the battery percentage is calculated correctly.

This test verifies that the battery percentage is calculated correctly. The test uses known values for the bus voltage and shunt voltage to calculate the expected battery percentage.

See also
BatteryController::getBatteryPercentage

Definition at line 66 of file test_BatteryController.cpp.

◆ TEST_F() [2/2]

TEST_F ( BatteryControllerTest ,
Initialization_CallsCalibration  )

Ensures that the battery controller initializes correctly.

Test
Tests if the battery controller initializes correctly.

This test verifies that the battery controller initializes correctly.

Definition at line 49 of file test_BatteryController.cpp.