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

Unit tests for the MileageCalculator class. More...

#include <QElapsedTimer>
#include <QTest>
#include "MileageCalculator.hpp"
#include <gtest/gtest.h>

Go to the source code of this file.

Data Structures

class  MileageCalculatorTest
 Test fixture for testing the MileageCalculator class. More...
 

Functions

 TEST_F (MileageCalculatorTest, AddSpeed_DoesNotCrash)
 Ensures that the mileage calculator does not crash when adding speeds.
 
 TEST_F (MileageCalculatorTest, CalculateDistance_NoSpeeds_ReturnsZero)
 Ensures that the mileage calculator calculates the distance correctly.
 
 TEST_F (MileageCalculatorTest, CalculateDistance_ZeroSpeed_ReturnsZero)
 Ensures that the mileage calculator calculates the distance correctly.
 
 TEST_F (MileageCalculatorTest, CalculateDistance_BasicCalculation)
 Ensures that the mileage calculator calculates the distance correctly.
 
 TEST_F (MileageCalculatorTest, CalculateDistance_MultipleSpeeds)
 Ensures that the mileage calculator calculates the distance correctly.
 

Detailed Description

Unit tests for the MileageCalculator class.

Version
0.1
Date
2025-02-12

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

Function Documentation

◆ TEST_F() [1/5]

TEST_F ( MileageCalculatorTest ,
AddSpeed_DoesNotCrash  )

Ensures that the mileage calculator does not crash when adding speeds.

Test
Tests if the mileage calculator does not crash when adding speeds.

This test verifies that the mileage calculator does not crash when adding speeds.

See also
MileageCalculator::addSpeed

Definition at line 43 of file test_MileageCalculator.cpp.

◆ TEST_F() [2/5]

TEST_F ( MileageCalculatorTest ,
CalculateDistance_BasicCalculation  )

Ensures that the mileage calculator calculates the distance correctly.

Test
Tests if the mileage calculator calculates the distance correctly.

This test verifies that the mileage calculator calculates the distance correctly.

See also
MileageCalculator::calculateDistance

Definition at line 90 of file test_MileageCalculator.cpp.

◆ TEST_F() [3/5]

TEST_F ( MileageCalculatorTest ,
CalculateDistance_MultipleSpeeds  )

Ensures that the mileage calculator calculates the distance correctly.

Test
Tests if the mileage calculator calculates the distance correctly.

This test verifies that the mileage calculator calculates the distance correctly.

See also
MileageCalculator::calculateDistance

Definition at line 120 of file test_MileageCalculator.cpp.

◆ TEST_F() [4/5]

TEST_F ( MileageCalculatorTest ,
CalculateDistance_NoSpeeds_ReturnsZero  )

Ensures that the mileage calculator calculates the distance correctly.

Test
Tests if the mileage calculator calculates the distance correctly.

This test verifies that the mileage calculator calculates the distance correctly.

See also
MileageCalculator::calculateDistance

Definition at line 59 of file test_MileageCalculator.cpp.

◆ TEST_F() [5/5]

TEST_F ( MileageCalculatorTest ,
CalculateDistance_ZeroSpeed_ReturnsZero  )

Ensures that the mileage calculator calculates the distance correctly.

Test
Tests if the mileage calculator calculates the distance correctly.

This test verifies that the mileage calculator calculates the distance correctly.

See also
MileageCalculator::calculateDistance

Definition at line 73 of file test_MileageCalculator.cpp.