Fixed unit test compiler warnings

This commit is contained in:
Steve Karg
2024-08-06 16:19:08 -05:00
parent 1be0aa39b9
commit be65abe159
35 changed files with 143 additions and 231 deletions
+5
View File
@@ -51,6 +51,11 @@ static BACNET_IP_ADDRESS Test_Sent_Message_Dest;
uint16_t bip_receive(
BACNET_ADDRESS *src, uint8_t *npdu, uint16_t max_npdu, unsigned timeout)
{
(void)src;
(void)npdu;
(void)max_npdu;
(void)timeout;
return 0;
}
+5
View File
@@ -56,6 +56,11 @@ static BACNET_IP6_ADDRESS Test_Sent_Message_Dest;
uint16_t bip6_receive(
BACNET_ADDRESS *src, uint8_t *npdu, uint16_t max_npdu, unsigned timeout)
{
(void)src;
(void)npdu;
(void)max_npdu;
(void)timeout;
return 0;
}
+4 -1
View File
@@ -23,8 +23,9 @@
* @addtogroup bacnet_tests
* @{
*/
#ifdef BACNET_ADDRESS_CACHE_FILE
static const char *Address_Cache_Filename = "address_cache";
#endif
/**
* @brief Test
@@ -44,6 +45,7 @@ static void set_address(unsigned index, BACNET_ADDRESS *dest)
}
}
#ifdef BACNET_ADDRESS_CACHE_FILE
static void set_file_address(
const char *pFilename,
uint32_t device_id,
@@ -78,6 +80,7 @@ static void set_file_address(
fclose(pFile);
}
}
#endif
#ifdef BACNET_ADDRESS_CACHE_FILE
/* Validate that the address data in the file */
@@ -25,9 +25,6 @@ ZTEST(bitstring_value_object_tests, test_BitString_Value_Object)
static void test_BitString_Value_Object(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
int test_len = 0;
const int skip_fail_property_list[] = { -1 };
const uint32_t instance = 123;
uint32_t test_instance = 0;
@@ -37,9 +34,6 @@ static void test_BitString_Value_Object(void)
BACNET_WRITE_PROPERTY_DATA wpdata = { 0 };
BACNET_APPLICATION_DATA_VALUE value = { 0 };
BACNET_PROPERTY_VALUE value_list[2] = { 0 };
const int *required_property = NULL;
const int *optional_property = NULL;
const int *proprietary_property = NULL;
BitString_Value_Init();
status = BitString_Value_Create(instance);
-1
View File
@@ -175,7 +175,6 @@ static void testBinaryLightingOutputBlink(void)
BACNET_BINARY_LIGHTING_PV pv, test_pv, expect_pv;
unsigned test_priority;
BACNET_WRITE_PROPERTY_DATA wpdata = { 0 };
BACNET_APPLICATION_DATA_VALUE value = { 0 };
Binary_Lighting_Output_Init();
Binary_Lighting_Output_Create(object_instance);
+11
View File
@@ -41,11 +41,17 @@ bool datetime_local(
int16_t *utc_offset_minutes,
bool *dst_active)
{
(void)bdate;
(void)btime;
(void)utc_offset_minutes;
(void)dst_active;
return true;
}
void bip_get_my_address(BACNET_ADDRESS *my_address)
{
(void)my_address;
}
int bip_send_pdu(
@@ -54,5 +60,10 @@ int bip_send_pdu(
uint8_t *pdu,
unsigned pdu_len)
{
(void)dest;
(void)npdu_data;
(void)pdu;
(void)pdu_len;
return 0;
}
-1
View File
@@ -448,7 +448,6 @@ ZTEST(lc_tests, test_Load_Control_Read_Write_Property)
static void test_Load_Control_Read_Write_Property(void)
#endif
{
bool status = false;
unsigned count = 0;
uint32_t object_instance = BACNET_MAX_INSTANCE, test_object_instance = 0;
const int skip_fail_property_list[] = { -1 };
-1
View File
@@ -27,7 +27,6 @@ ZTEST(testsLifeSafetyZone, testLifeSafetyZone)
static void testLifeSafetyZone(void)
#endif
{
bool status = false;
unsigned count = 0;
uint32_t object_instance = 0, test_object_instance = 0;
const int skip_fail_property_list[] = { -1 };
+1 -1
View File
@@ -35,7 +35,7 @@ static void testOctetString_Value(void)
rpdata.application_data = &apdu[0];
rpdata.application_data_len = sizeof(apdu);
rpdata.object_type = OBJECT_OCTETSTRING_VALUE;
rpdata.object_instance = 1;
rpdata.object_instance = instance;
rpdata.array_index = BACNET_ARRAY_ALL;
OctetString_Value_Property_Lists(&required_property, NULL, NULL);
+1 -1
View File
@@ -36,7 +36,7 @@ static void testPositiveInteger_Value(void)
rpdata.application_data = &apdu[0];
rpdata.application_data_len = sizeof(apdu);
rpdata.object_type = OBJECT_POSITIVE_INTEGER_VALUE;
rpdata.object_instance = 1;
rpdata.object_instance = instance;
rpdata.array_index = BACNET_ARRAY_ALL;
PositiveInteger_Value_Property_Lists(&required_property, NULL, NULL);
@@ -27,8 +27,6 @@ bool bacnet_object_property_write_test(
const int *skip_fail_property_list)
{
bool status = false;
int len = 0;
int test_len = 0;
(void)skip_fail_property_list;
if (wpdata && write_property) {
@@ -82,14 +80,12 @@ int bacnet_object_property_read_test(
read_property_function read_property,
const int *skip_fail_property_list)
{
bool status = false;
int len = 0;
int test_len = 0;
int apdu_len = 0;
int read_len = 0;
uint8_t *apdu;
BACNET_ARRAY_INDEX array_index = 0;
BACNET_WRITE_PROPERTY_DATA wpdata = { 0 };
BACNET_APPLICATION_DATA_VALUE value = { 0 };
read_len = read_property(rpdata);
@@ -174,7 +170,6 @@ void bacnet_object_properties_read_write_test(
const int *pRequired = NULL;
const int *pOptional = NULL;
const int *pProprietary = NULL;
unsigned count = 0;
int len = 0;
bool status = false;
@@ -151,9 +151,6 @@ static void test_color_rgb_ascii(void)
uint8_t red, green, blue;
uint8_t test_red, test_green, test_blue;
unsigned test_index;
float x_coordinate;
float y_coordinate;
float brightness;
for (unsigned i = 0; i < count; i++) {
name = color_rgb_from_index(i, &red, &green, &blue);