Fixed unit test compiler warnings
This commit is contained in:
@@ -73,16 +73,28 @@ static void testBACnetDestination(void)
|
||||
{
|
||||
uint8_t apdu[MAX_APDU] = { 0 };
|
||||
BACNET_DESTINATION destination = { 0 }, test_destination = { 0 };
|
||||
int len = 0, apdu_len = 0, null_len = 0, test_len = 0;
|
||||
int apdu_len = 0, null_len = 0, test_len = 0;
|
||||
|
||||
destination.Recipient.tag = BACNET_RECIPIENT_TAG_DEVICE;
|
||||
destination.Recipient.type.device.type = OBJECT_DEVICE;
|
||||
destination.Recipient.type.device.instance = 1234;
|
||||
null_len = bacnet_destination_encode(NULL, &destination);
|
||||
apdu_len = bacnet_destination_encode(apdu, &destination);
|
||||
zassert_equal(apdu_len, null_len, NULL);
|
||||
test_len = bacnet_destination_decode(apdu, apdu_len, &test_destination);
|
||||
zassert_equal(apdu_len, test_len, NULL);
|
||||
testBACnetRecipientData(&destination.Recipient,
|
||||
&test_destination.Recipient);
|
||||
|
||||
destination.Recipient.tag = BACNET_RECIPIENT_TAG_ADDRESS;
|
||||
destination.Recipient.type.address.net = 1234;
|
||||
destination.Recipient.type.address.len = 6;
|
||||
destination.Recipient.type.address.adr[0] = 1;
|
||||
destination.Recipient.type.address.adr[1] = 2;
|
||||
destination.Recipient.type.address.adr[2] = 3;
|
||||
destination.Recipient.type.address.adr[3] = 4;
|
||||
destination.Recipient.type.address.adr[4] = 5;
|
||||
destination.Recipient.type.address.adr[5] = 6;
|
||||
null_len = bacnet_destination_encode(NULL, &destination);
|
||||
apdu_len = bacnet_destination_encode(apdu, &destination);
|
||||
zassert_equal(apdu_len, null_len, NULL);
|
||||
|
||||
Reference in New Issue
Block a user