Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
test_MCP2515Device.cpp File Reference
#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.
 

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Ensures that the MCP2515 controller initializes successfully.

Test
Tests the initialization of the MCP2515 controller.

This test verifies that the MCP2515 controller initializes successfully by calling the init() method.

See also
MCP2515Configurator::readCANMessage
MCP2515Configurator::sendCANMessage

Definition at line 286 of file test_MCP2515Device.cpp.

◆ TEST_F() [1/5]

TEST_F ( RS485CANTest ,
DataFrameTest  )

Ensures that the MCP2515 controller initializes successfully.

Test
Tests the initialization of the MCP2515 controller.

This test verifies that the MCP2515 controller initializes successfully by calling the init() method.

See also
MCP2515Configurator::readCANMessage
MCP2515Configurator::sendCANMessage

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() [2/5]

TEST_F ( RS485CANTest ,
ErrorFrameTest  )

Ensures that the MCP2515 controller initializes successfully.

Test
Tests the initialization of the MCP2515 controller.

This test verifies that the MCP2515 controller initializes successfully by calling the init() method.

See also
MCP2515Configurator::readCANMessage
MCP2515Configurator::sendCANMessage

Definition at line 156 of file test_MCP2515Device.cpp.

◆ TEST_F() [3/5]

TEST_F ( RS485CANTest ,
MaxBusSpeedTest  )

Ensures that the MCP2515 controller initializes successfully.

Test
Tests the initialization of the MCP2515 controller.

This test verifies that the MCP2515 controller initializes successfully by calling the init() method.

See also
MCP2515Configurator::readCANMessage
MCP2515Configurator::sendCANMessage

Definition at line 200 of file test_MCP2515Device.cpp.

◆ TEST_F() [4/5]

TEST_F ( RS485CANTest ,
MinBusSpeedTest  )

Ensures that the MCP2515 controller initializes successfully.

Test
Tests the initialization of the MCP2515 controller.

This test verifies that the MCP2515 controller initializes successfully by calling the init() method.

See also
MCP2515Configurator::readCANMessage
MCP2515Configurator::sendCANMessage

Definition at line 243 of file test_MCP2515Device.cpp.

◆ TEST_F() [5/5]

TEST_F ( RS485CANTest ,
RemoteFrameTest  )

Ensures that the MCP2515 controller initializes successfully.

Test
Tests the initialization of the MCP2515 controller.

This test verifies that the MCP2515 controller initializes successfully by calling the init() method.

See also
MCP2515Configurator::readCANMessage
MCP2515Configurator::sendCANMessage

Definition at line 119 of file test_MCP2515Device.cpp.