From fe34a867460c6722da1df7249e6bffa6e1e22b63 Mon Sep 17 00:00:00 2001 From: Oliver Walter Date: Tue, 6 Feb 2024 03:24:43 +0100 Subject: [PATCH] update cls --- Application/CLS | 2 +- tests/native/candata_test.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Application/CLS b/Application/CLS index 6ad5136..276ef8b 160000 --- a/Application/CLS +++ b/Application/CLS @@ -1 +1 @@ -Subproject commit 6ad513673d20c89f330f964f763fa042c6ad8013 +Subproject commit 276ef8bfd30d997bb105bcada9e186cf33eea4e7 diff --git a/tests/native/candata_test.c b/tests/native/candata_test.c index 71ceadf..b4c25c7 100644 --- a/tests/native/candata_test.c +++ b/tests/native/candata_test.c @@ -9,7 +9,7 @@ uint32_t hfdcan1 =0; // Test when you register a new canid, it should return true. void test_CanDataRegDataMsg_insert_valid() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module CanDataId canid = 1; // Test with a valid canid bool result = CanData_regDataMsg(canid); TEST_ASSERT_TRUE(result); // Check that the function returned true @@ -17,7 +17,7 @@ void test_CanDataRegDataMsg_insert_valid() { // Test when you register a canid when all slots are filled, it should return false. void test_CanDataRegDataMsg_insert_full() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module // Fill all the slots for (int i = 1; i < MAX_MESSAGE_SLOTS+1; i++) { @@ -34,7 +34,7 @@ void test_CanDataRegDataMsg_insert_full() { // Test when registering the same canid multible times there should be no error void test_CanDataRegDataMsg_insert_duplicate() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module CanDataId canid = 1; // Test with a valid canid @@ -53,7 +53,7 @@ void dummyEventCallback(CanDataId canid, uint8_t* data, uint8_t len) { // Test when you register a new event callback, it should return true. void test_CanDataRegEventMsg_insert_valid() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module CanDataId canid = 1; // Test with a valid canid bool result = CanData_regEventMsg(canid, dummyEventCallback); TEST_ASSERT_TRUE(result); // Check that the function returned true @@ -61,7 +61,7 @@ void test_CanDataRegEventMsg_insert_valid() { // Test when you register an event callback when all slots are filled, it should return false. void test_CanDataRegEventMsg_insert_full() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module // Fill all the slots for (int i = 1; i < MAX_EVENT_SLOTS+1; i++) { @@ -77,7 +77,7 @@ void test_CanDataRegEventMsg_insert_full() { // Test when you register a canid with a NULL callback, it should return false. void test_CanDataRegEventMsg_NullCallback() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module CanDataId canid = 1; // Test with a valid canid bool result = CanData_regEventMsg(canid, NULL); TEST_ASSERT_FALSE(result); // Check that the function returned false @@ -86,7 +86,7 @@ void test_CanDataRegEventMsg_NullCallback() { // Test when you register a canid that has already been registered, it should return false. void test_CanDataRegEventMsg_insert_duplicate() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module CanDataId canid = 1; // Test with a valid canid // Register the canid once @@ -101,7 +101,7 @@ void test_CanDataRegEventMsg_insert_duplicate() { // Test for CanData_canFifo0RxCallback(CanDataId canid, uint8_t* data, uint8_t len) function void test_CanData_canFifo0RxCallback_data_valid() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module CanDataId canid = 1; // Test with a valid canid uint8_t data[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // Test with valid data uint8_t len = 8; // Test with a valid length @@ -124,7 +124,7 @@ void test_CanData_canFifo0RxCallback_data_valid() { // Test for CanData_canFifo0RxCallback(CanDataId canid, uint8_t* data, uint8_t len) function // Test with an invalid canid or NULL data, the function should handle the error correctly. void test_CanData_canFifo0RxCallback_data_invalid() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module CanDataId canid = 1; // Test with a valid canid uint8_t* data = NULL; // Test with NULL data uint8_t len = 8; // Test with a valid length @@ -153,7 +153,7 @@ void test_CanData_canFifo1RxCallback_callback(CanDataId canid, uint8_t* data, ui } // Test for CanData_canFifo1RxCallback(CanDataId canid, uint8_t* data, uint8_t len) function void test_CanData_canFifo1RxCallback_data_valid() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module CanDataId canid = 1; // Test with a valid canid uint8_t data[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // Test with valid data uint8_t len = 8; // Test with a valid length @@ -181,7 +181,7 @@ void test_CanData_removeEvent_callback(CanDataId canid, uint8_t* data, uint8_t l // Test for CanData_removeEvent(CanDataId canid) function void test_CanData_removeEvent() { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module CanDataId canid = 1; // Test with a valid canid // Register the canid with the callback @@ -203,7 +203,7 @@ void test_CanData_removeEvent() { void test_CanData_regDataManualMsg(void) { - CanDataHandler_init(); // Reset the state of the module + CanDataHandler_reset(); // Reset the state of the module { CanDataId canids[] = {1, 2, 3};