File containing integration tests for the MCP2515 controller. More...
#include "MCP2515Controller.hpp"
#include "MockSPIController.hpp"
#include <QObject>
#include <QSignalSpy>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <thread>
Go to the source code of this file.
Data Structures | |
class | MCP2515ControllerTest |
Test fixture for testing the MCP2515Controller class. More... | |
Functions | |
TEST_F (MCP2515ControllerTest, InitializationSuccess) | |
Ensures that init() does not throw an exception. | |
TEST_F (MCP2515ControllerTest, InitializationFailure) | |
Ensures that init() throws an exception when the initialization fails. | |
TEST_F (MCP2515ControllerTest, SetupHandlersTest) | |
Ensures that registerHandler() does not throw an exception. | |
TEST_F (MCP2515ControllerTest, SpeedUpdatedSignal) | |
Ensures that the speed signal is emitted with the correct value. | |
TEST_F (MCP2515ControllerTest, RpmUpdatedSignal) | |
Ensures that the RPM signal emits the correct value. | |
TEST_F (MCP2515ControllerTest, ProcessReadingCallsHandlers) | |
Ensures that processReading() calls the registered handlers. | |
TEST_F (MCP2515ControllerTest, StopReadingStopsProcessing) | |
Ensures that stopReading() sets the stop flag. | |
File containing integration tests for the MCP2515 controller.
Unit tests for the MCP2515Controller class.
This file contains unit tests for the MCP2515Controller class, using Google Test and Google Mock frameworks.
Definition in file test_MCP2515Controller.cpp.
TEST_F | ( | MCP2515ControllerTest | , |
InitializationFailure | ) |
Ensures that init() throws an exception when the initialization fails.
Verifies that init() throws a runtime_error when the initialization fails.
Definition at line 71 of file test_MCP2515Controller.cpp.
TEST_F | ( | MCP2515ControllerTest | , |
InitializationSuccess | ) |
Ensures that init() does not throw an exception.
Verifies that init() does not throw an exception when the initialization is successful.
Definition at line 53 of file test_MCP2515Controller.cpp.
TEST_F | ( | MCP2515ControllerTest | , |
ProcessReadingCallsHandlers | ) |
Ensures that processReading() calls the registered handlers.
Verifies that processReading() calls the registered handlers when data is available.
Definition at line 149 of file test_MCP2515Controller.cpp.
TEST_F | ( | MCP2515ControllerTest | , |
RpmUpdatedSignal | ) |
Ensures that the RPM signal emits the correct value.
Uses QSignalSpy to verify that rpmUpdated emits the expected RPM value.
Definition at line 126 of file test_MCP2515Controller.cpp.
TEST_F | ( | MCP2515ControllerTest | , |
SetupHandlersTest | ) |
Ensures that registerHandler() does not throw an exception.
Verifies that registerHandler() does not throw an exception when setting up handlers.
Definition at line 84 of file test_MCP2515Controller.cpp.
TEST_F | ( | MCP2515ControllerTest | , |
SpeedUpdatedSignal | ) |
Ensures that the speed signal is emitted with the correct value.
Uses QSignalSpy to verify that speedUpdated emits the expected speed value.
Definition at line 103 of file test_MCP2515Controller.cpp.
TEST_F | ( | MCP2515ControllerTest | , |
StopReadingStopsProcessing | ) |
Ensures that stopReading() sets the stop flag.
Verifies that stopReading() sets the stop flag to true.
Definition at line 182 of file test_MCP2515Controller.cpp.