Unit tests for the SPIController class. More...
#include "MockSysCalls.hpp"
#include "SPIController.hpp"
#include <gtest/gtest.h>
#include <linux/spi/spidev.h>
Go to the source code of this file.
Data Structures | |
class | SPIControllerTest |
Test fixture for testing the SPIController class. More... | |
Functions | |
TEST_F (SPIControllerTest, OpenDeviceSuccess) | |
Ensures that the device opens without throwing an exception. | |
TEST_F (SPIControllerTest, OpenDeviceFailure) | |
Ensures that openDevice() throws an exception when the device fails to open. | |
TEST_F (SPIControllerTest, ConfigureSPIValidParameters) | |
Ensures that configure() does not throw an exception with valid parameters. | |
TEST_F (SPIControllerTest, WriteByteSuccess) | |
Ensures that writeByte() does not throw an exception. | |
TEST_F (SPIControllerTest, ReadByteSuccess) | |
Ensures that readByte() does not throw an exception. | |
TEST_F (SPIControllerTest, SpiTransferSuccess) | |
Ensures that spiTransfer() does not throw an exception. | |
TEST_F (SPIControllerTest, CloseDeviceSuccess) | |
Ensures that closeDevice() does not throw an exception. | |
Unit tests for the SPIController class.
This file contains unit tests for the SPIController class, using Google Test and Google Mock frameworks.
Definition in file test_SPIController.cpp.
TEST_F | ( | SPIControllerTest | , |
CloseDeviceSuccess | ) |
Ensures that closeDevice() does not throw an exception.
This test verifies that closeDevice() does not throw an exception when the device closes successfully.
Definition at line 180 of file test_SPIController.cpp.
TEST_F | ( | SPIControllerTest | , |
ConfigureSPIValidParameters | ) |
Ensures that configure() does not throw an exception with valid parameters.
This test verifies that configure() does not throw an exception when called with valid parameters.
Definition at line 97 of file test_SPIController.cpp.
TEST_F | ( | SPIControllerTest | , |
OpenDeviceFailure | ) |
Ensures that openDevice() throws an exception when the device fails to open.
This test verifies that openDevice() throws a runtime_error when the device fails to open.
Definition at line 79 of file test_SPIController.cpp.
TEST_F | ( | SPIControllerTest | , |
OpenDeviceSuccess | ) |
Ensures that the device opens without throwing an exception.
Verifies that openDevice() does not throw an exception when the device opens successfully.
Definition at line 61 of file test_SPIController.cpp.
TEST_F | ( | SPIControllerTest | , |
ReadByteSuccess | ) |
Ensures that readByte() does not throw an exception.
This test verifies that readByte() does not throw an exception when reading a byte.
Definition at line 139 of file test_SPIController.cpp.
TEST_F | ( | SPIControllerTest | , |
SpiTransferSuccess | ) |
Ensures that spiTransfer() does not throw an exception.
This test verifies that spiTransfer() does not throw an exception when performing an SPI transfer.
Definition at line 158 of file test_SPIController.cpp.
TEST_F | ( | SPIControllerTest | , |
WriteByteSuccess | ) |
Ensures that writeByte() does not throw an exception.
This test verifies that writeByte() does not throw an exception when writing a byte.
Definition at line 120 of file test_SPIController.cpp.