#include "MCP2515Controller.hpp"
#include "SPIController.hpp"
#include <cassert>
#include <chrono>
#include <cstdint>
#include <gtest/gtest.h>
#include <iostream>
#include <thread>
#include <vector>
Go to the source code of this file.
Data Structures | |
struct | CANFrame |
Structure to represent a CAN frame. following fields needed to represent a CAN frame. More... | |
class | RS485CANTest |
Class to test the integration between the MCP2515 controller and the SPI controller. More... | |
Functions | |
TEST_F (RS485CANTest, DataFrameTest) | |
Ensures that the MCP2515 controller initializes successfully. | |
TEST_F (RS485CANTest, RemoteFrameTest) | |
Ensures that the MCP2515 controller initializes successfully. | |
TEST_F (RS485CANTest, ErrorFrameTest) | |
Ensures that the MCP2515 controller initializes successfully. | |
TEST_F (RS485CANTest, MaxBusSpeedTest) | |
Ensures that the MCP2515 controller initializes successfully. | |
TEST_F (RS485CANTest, MinBusSpeedTest) | |
Ensures that the MCP2515 controller initializes successfully. | |
int | main (int argc, char **argv) |
Ensures that the MCP2515 controller initializes successfully. | |
int main | ( | int | argc, |
char ** | argv ) |
Ensures that the MCP2515 controller initializes successfully.
This test verifies that the MCP2515 controller initializes successfully by calling the init() method.
Definition at line 286 of file test_MCP2515Device.cpp.
TEST_F | ( | RS485CANTest | , |
DataFrameTest | ) |
Ensures that the MCP2515 controller initializes successfully.
This test verifies that the MCP2515 controller initializes successfully by calling the init() method.
Create a data frame with an 11-bit identifier and 8 bytes of data
Send the data frame
Simulate receiving the data frame
Verify the received frame
Verify the CRC (assuming the controller calculates and verifies CRC internally)
Verify the Acknowledgement Slot (assuming the controller handles this internally)
Definition at line 79 of file test_MCP2515Device.cpp.
TEST_F | ( | RS485CANTest | , |
ErrorFrameTest | ) |
Ensures that the MCP2515 controller initializes successfully.
This test verifies that the MCP2515 controller initializes successfully by calling the init() method.
Definition at line 156 of file test_MCP2515Device.cpp.
TEST_F | ( | RS485CANTest | , |
MaxBusSpeedTest | ) |
Ensures that the MCP2515 controller initializes successfully.
This test verifies that the MCP2515 controller initializes successfully by calling the init() method.
Definition at line 200 of file test_MCP2515Device.cpp.
TEST_F | ( | RS485CANTest | , |
MinBusSpeedTest | ) |
Ensures that the MCP2515 controller initializes successfully.
This test verifies that the MCP2515 controller initializes successfully by calling the init() method.
Definition at line 243 of file test_MCP2515Device.cpp.
TEST_F | ( | RS485CANTest | , |
RemoteFrameTest | ) |
Ensures that the MCP2515 controller initializes successfully.
This test verifies that the MCP2515 controller initializes successfully by calling the init() method.
Definition at line 119 of file test_MCP2515Device.cpp.