Unit tests for the CANMessageProcessor class. More...
Go to the source code of this file.
Data Structures | |
class | CANMessageProcessorTest |
Test fixture for testing the CANMessageProcessor class. More... | |
Functions | |
TEST_F (CANMessageProcessorTest, RegisterHandlerSuccess) | |
Ensures that registerHandler() does not throw an exception. | |
TEST_F (CANMessageProcessorTest, RegisterHandlerNullThrowsException) | |
Ensures that registerHandler() throws an invalid_argument exception. | |
TEST_F (CANMessageProcessorTest, ProcessMessageWithRegisteredHandler) | |
Ensures that the registered handler is called with the correct data. | |
TEST_F (CANMessageProcessorTest, ProcessMessageWithUnregisteredHandlerThrowsException) | |
Ensures that processMessage() throws a runtime_error exception. | |
TEST_F (CANMessageProcessorTest, OverwriteHandlerForSameFrameID) | |
Ensures that the new handler is called instead of the old handler. | |
Unit tests for the CANMessageProcessor class.
This file contains unit tests for the CANMessageProcessor class, using Google Test framework.
Definition in file test_CANMessageProcessor.cpp.
TEST_F | ( | CANMessageProcessorTest | , |
OverwriteHandlerForSameFrameID | ) |
Ensures that the new handler is called instead of the old handler.
Verifies that registering a new handler for the same frame ID overwrites the old handler.
Definition at line 99 of file test_CANMessageProcessor.cpp.
TEST_F | ( | CANMessageProcessorTest | , |
ProcessMessageWithRegisteredHandler | ) |
Ensures that the registered handler is called with the correct data.
Verifies that processMessage() calls the registered handler with the correct data.
Definition at line 63 of file test_CANMessageProcessor.cpp.
TEST_F | ( | CANMessageProcessorTest | , |
ProcessMessageWithUnregisteredHandlerThrowsException | ) |
Ensures that processMessage() throws a runtime_error exception.
Verifies that processMessage() throws a runtime_error exception when no handler is registered for the given frame ID.
Definition at line 85 of file test_CANMessageProcessor.cpp.
TEST_F | ( | CANMessageProcessorTest | , |
RegisterHandlerNullThrowsException | ) |
Ensures that registerHandler() throws an invalid_argument exception.
Verifies that registerHandler() throws an invalid_argument exception when a null handler is registered.
Definition at line 51 of file test_CANMessageProcessor.cpp.
TEST_F | ( | CANMessageProcessorTest | , |
RegisterHandlerSuccess | ) |
Ensures that registerHandler() does not throw an exception.
Verifies that registerHandler() does not throw an exception when a valid handler is registered.
Definition at line 39 of file test_CANMessageProcessor.cpp.