Skip to content

Commit

Permalink
Fixed FlexRay tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Menne authored and Benedikt Menne committed May 24, 2024
1 parent 62bddd6 commit 4184e58
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 44 deletions.
16 changes: 8 additions & 8 deletions tests/helper/hdr/fmi_3_ls_bus_header_test_helper_flexray.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
/**
* \brief Values that cause an overflow for the tested datatype.
*/
#define WRONG_U_INT8 256
#define WRONG_U_INT16 65536
#define WRONG_U_INT32 0x100000000
#define WRONG_U_INT64 0x10000000000000000
#define FLEXRAY_WRONG_U_INT8 256
#define FLEXRAY_WRONG_U_INT16 65536
#define FLEXRAY_WRONG_U_INT32 0x100000000
#define FLEXRAY_WRONG_U_INT64 0x10000000000000000

/**
* \brief Enum of the available operations by name.
*/
enum Operation { FlexRayTransmit, BusError, ConfigurationGlobal, StartCommunication, Symbol };
enum FlexRayOperation { FlexRayTransmit, BusError, ConfigurationGlobal, StartCommunication, Symbol };

/**
* \brief Checks if the FlexRay Transmit operation is created correctly by the corresponding macro.
Expand Down Expand Up @@ -64,7 +64,7 @@ void CheckFlexRayBusErrorOperation(int errorFlags, int cycleId, int segmentIndic
* \param[in] coldStartNode The coldStartNode of the FlexRay Configuration Startup operation.
* \param[in] correctData Indicator if the method checks for a match of provided and created values or for an overflow of values.
*/
void CheckFlexRayConfigurationOperation(Operation operationType, long long int macrotickDuration,
void CheckFlexRayConfigurationOperation(FlexRayOperation operationType, long long int macrotickDuration,
int macroticksPerCycle, int maxCycleCount, int actionPointOffset, int staticSlotLength,
int numberOfStaticSlots, int staticPayloadLength, int minislotActionPointOffset,
int numberOfMinislots, int minislotLength, int symbolActionPointOffset, int symbolWindowLength,
Expand Down Expand Up @@ -93,11 +93,11 @@ void CheckFlexRaySymbolOperation(int cycleId, int channel, fmi3LsBusFlexRaySymbo
*
* \param[in] operation The type of operation to be checked.
*/
void CheckDataSizeError(Operation operation);
void CheckDataSizeError(FlexRayOperation operation);

/**
* \brief Checks if the Format Error operation is created correctly by the corresponding macro.
*
* \param[in] operationType The type of operation of the Format Error operation.
*/
void CheckFormatErrorOperation(Operation operationType);
void CheckFormatErrorOperation(FlexRayOperation operationType);
7 changes: 4 additions & 3 deletions tests/helper/src/fmi_3_ls_bus_header_test_helper_flexray.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
#include "fmi_3_ls_bus_header_test_helper_flexray.h"
#include <gtest/gtest.h>

Expand Down Expand Up @@ -90,7 +91,7 @@ void CheckFlexRayBusErrorOperation(int errorFlags, int cycleId, int segmentIndic
EXPECT_EQ(operation->channel, channel * multiplier);
}

void CheckFlexRayConfigurationOperation(Operation operationType, long long int macrotickDuration, int macroticksPerCycle, int maxCycleCount, int actionPointOffset, int staticSlotLength, int numberOfStaticSlots, int staticPayloadLength, int minislotActionPointOffset, int numberOfMinislots, int minislotLength, int symbolActionPointOffset, int symbolWindowLength, int nitLength, long long int dynamicSlotIdleTime, fmi3Boolean coldStartNode, bool correctData)
void CheckFlexRayConfigurationOperation(FlexRayOperation operationType, long long int macrotickDuration, int macroticksPerCycle, int maxCycleCount, int actionPointOffset, int staticSlotLength, int numberOfStaticSlots, int staticPayloadLength, int minislotActionPointOffset, int numberOfMinislots, int minislotLength, int symbolActionPointOffset, int symbolWindowLength, int nitLength, long long int dynamicSlotIdleTime, fmi3Boolean coldStartNode, bool correctData)
{
// Create data needed for creation.
fmi3LsBusUtilBufferInfo firstBufferInfo;
Expand Down Expand Up @@ -224,7 +225,7 @@ void CheckFlexRaySymbolOperation(int cycleId, int channel, fmi3LsBusFlexRaySymbo
EXPECT_EQ(operation->type, type);
}

void CheckDataSizeError(Operation operation)
void CheckDataSizeError(FlexRayOperation operation)
{
// Create data needed for creation.
fmi3LsBusUtilBufferInfo bufferInfo;
Expand Down Expand Up @@ -258,7 +259,7 @@ void CheckDataSizeError(Operation operation)
EXPECT_EQ(bufferInfo.status, fmi3False);
}

void CheckFormatErrorOperation(Operation operationType)
void CheckFormatErrorOperation(FlexRayOperation operationType)
{
// Create data needed for creation.
fmi3LsBusUtilBufferInfo firstBufferInfo;
Expand Down
Loading

0 comments on commit 4184e58

Please sign in to comment.