Fixed compilation of unit tests.
This commit is contained in:
@@ -310,7 +310,7 @@ static bool Channel_Reference_List_Member_Valid(
|
||||
|
||||
if ((pMember) &&
|
||||
(pMember->objectIdentifier.instance != BACNET_MAX_INSTANCE) &&
|
||||
(pMember->deviceIndentifier.instance != BACNET_MAX_INSTANCE)) {
|
||||
(pMember->deviceIdentifier.instance != BACNET_MAX_INSTANCE)) {
|
||||
status = true;
|
||||
}
|
||||
|
||||
@@ -475,8 +475,8 @@ unsigned Channel_Reference_List_Member_Local_Add(
|
||||
member.objectIdentifier.instance = instance;
|
||||
member.propertyIdentifier = propertyIdentifier;
|
||||
member.arrayIndex = arrayIndex;
|
||||
member.deviceIndentifier.type = OBJECT_DEVICE;
|
||||
member.deviceIndentifier.instance = Device_Object_Instance_Number();
|
||||
member.deviceIdentifier.type = OBJECT_DEVICE;
|
||||
member.deviceIdentifier.instance = Device_Object_Instance_Number();
|
||||
|
||||
return Channel_Reference_List_Member_Element_Add(
|
||||
object_instance,
|
||||
@@ -1219,8 +1219,8 @@ static bool Channel_Write_Members(
|
||||
we would need to update all channels when our device ID
|
||||
changed. Instead, we'll just screen when members are
|
||||
set. */
|
||||
if ((pMember->deviceIndentifier.type == OBJECT_DEVICE) &&
|
||||
(pMember->deviceIndentifier.instance != BACNET_MAX_INSTANCE) &&
|
||||
if ((pMember->deviceIdentifier.type == OBJECT_DEVICE) &&
|
||||
(pMember->deviceIdentifier.instance != BACNET_MAX_INSTANCE) &&
|
||||
(pMember->objectIdentifier.instance != BACNET_MAX_INSTANCE)) {
|
||||
wp_data.object_type = pMember->objectIdentifier.type;
|
||||
wp_data.object_instance = pMember->objectIdentifier.instance;
|
||||
@@ -1695,9 +1695,9 @@ void Channel_Init(void)
|
||||
Channel[i].Members[m].objectIdentifier.instance = i+1;
|
||||
Channel[i].Members[m].propertyIdentifier = PROP_LIGHTING_COMMAND;
|
||||
Channel[i].Members[m].arrayIndex = BACNET_ARRAY_ALL;
|
||||
Channel[i].Members[m].deviceIndentifier.type =
|
||||
Channel[i].Members[m].deviceIdentifier.type =
|
||||
OBJECT_DEVICE;
|
||||
Channel[i].Members[m].deviceIndentifier.instance = 0;
|
||||
Channel[i].Members[m].deviceIdentifier.instance = 0;
|
||||
}
|
||||
Channel[i].Number = 0;
|
||||
for (g = 0; g < CONTROL_GROUPS_MAX; g++) {
|
||||
|
||||
@@ -229,9 +229,9 @@ void Trend_Log_Init(
|
||||
LogInfo[iLog].ulRecordCount = TL_MAX_ENTRIES;
|
||||
LogInfo[iLog].ulTotalRecordCount = 10000;
|
||||
|
||||
LogInfo[iLog].Source.deviceIndentifier.instance =
|
||||
LogInfo[iLog].Source.deviceIdentifier.instance =
|
||||
Device_Object_Instance_Number();
|
||||
LogInfo[iLog].Source.deviceIndentifier.type = OBJECT_DEVICE;
|
||||
LogInfo[iLog].Source.deviceIdentifier.type = OBJECT_DEVICE;
|
||||
LogInfo[iLog].Source.objectIdentifier.instance = iLog;
|
||||
LogInfo[iLog].Source.objectIdentifier.type = OBJECT_ANALOG_INPUT;
|
||||
LogInfo[iLog].Source.arrayIndex = BACNET_ARRAY_ALL;
|
||||
@@ -713,7 +713,7 @@ bool Trend_Log_Write_Property(
|
||||
}
|
||||
|
||||
// We only support references to objects in ourself for now
|
||||
if((TempSource.deviceIndentifier.type == OBJECT_DEVICE) && (TempSource.deviceIndentifier.instance != Device_Object_Instance_Number()))
|
||||
if((TempSource.deviceIdentifier.type == OBJECT_DEVICE) && (TempSource.deviceIdentifier.instance != Device_Object_Instance_Number()))
|
||||
{
|
||||
wp_data->error_class = ERROR_CLASS_PROPERTY;
|
||||
wp_data->error_code = ERROR_CODE_OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED;
|
||||
|
||||
@@ -34,7 +34,7 @@ typedef struct BACnetDeviceObjectPropertyReference {
|
||||
BACNET_OBJECT_ID objectIdentifier;
|
||||
BACNET_PROPERTY_ID propertyIdentifier;
|
||||
uint32_t arrayIndex;
|
||||
BACNET_OBJECT_ID deviceIndentifier;
|
||||
BACNET_OBJECT_ID deviceIdentifier;
|
||||
} BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE;
|
||||
|
||||
/** BACnetDeviceObjectReference structure.
|
||||
@@ -42,7 +42,7 @@ typedef struct BACnetDeviceObjectPropertyReference {
|
||||
* to an object inside this Device.
|
||||
*/
|
||||
typedef struct BACnetDeviceObjectReference {
|
||||
BACNET_OBJECT_ID deviceIndentifier; /**< Optional, for external device. */
|
||||
BACNET_OBJECT_ID deviceIdentifier; /**< Optional, for external device. */
|
||||
BACNET_OBJECT_ID objectIdentifier;
|
||||
} BACNET_DEVICE_OBJECT_REFERENCE;
|
||||
|
||||
|
||||
@@ -97,11 +97,11 @@ int bacapp_encode_device_obj_property_ref(
|
||||
/* Likewise, device id is optional so see if needed
|
||||
* (set type to BACNET_NO_DEV_TYPE or something other than OBJECT_DEVICE to
|
||||
* omit */
|
||||
if (value->deviceIndentifier.type == OBJECT_DEVICE) {
|
||||
if (value->deviceIdentifier.type == OBJECT_DEVICE) {
|
||||
len =
|
||||
encode_context_object_id(&apdu[apdu_len], 3,
|
||||
(int) value->deviceIndentifier.type,
|
||||
value->deviceIndentifier.instance);
|
||||
(int) value->deviceIdentifier.type,
|
||||
value->deviceIdentifier.instance);
|
||||
apdu_len += len;
|
||||
}
|
||||
return apdu_len;
|
||||
@@ -157,14 +157,14 @@ int bacapp_decode_device_obj_property_ref(
|
||||
!decode_is_closing_tag(&apdu[apdu_len])) {
|
||||
if (-1 == (len =
|
||||
decode_context_object_id(&apdu[apdu_len], 3,
|
||||
&value->deviceIndentifier.type,
|
||||
&value->deviceIndentifier.instance))) {
|
||||
&value->deviceIdentifier.type,
|
||||
&value->deviceIdentifier.instance))) {
|
||||
return -1;
|
||||
}
|
||||
apdu_len += len;
|
||||
} else {
|
||||
value->deviceIndentifier.type = BACNET_NO_DEV_TYPE;
|
||||
value->deviceIndentifier.instance = BACNET_NO_DEV_ID;
|
||||
value->deviceIdentifier.type = BACNET_NO_DEV_TYPE;
|
||||
value->deviceIdentifier.instance = BACNET_NO_DEV_ID;
|
||||
}
|
||||
|
||||
return apdu_len;
|
||||
@@ -239,11 +239,11 @@ int bacapp_encode_device_obj_ref(
|
||||
/* Device id is optional so see if needed
|
||||
* (set type to BACNET_NO_DEV_TYPE or something other than OBJECT_DEVICE to
|
||||
* omit */
|
||||
if (value->deviceIndentifier.type == OBJECT_DEVICE) {
|
||||
if (value->deviceIdentifier.type == OBJECT_DEVICE) {
|
||||
len =
|
||||
encode_context_object_id(&apdu[apdu_len], 0,
|
||||
(int) value->deviceIndentifier.type,
|
||||
value->deviceIndentifier.instance);
|
||||
(int) value->deviceIdentifier.type,
|
||||
value->deviceIdentifier.instance);
|
||||
apdu_len += len;
|
||||
}
|
||||
/* object-identifier [1] BACnetObjectIdentifier */
|
||||
@@ -271,14 +271,14 @@ int bacapp_decode_device_obj_ref(
|
||||
!decode_is_closing_tag(&apdu[apdu_len])) {
|
||||
if (-1 == (len =
|
||||
decode_context_object_id(&apdu[apdu_len], 0,
|
||||
&value->deviceIndentifier.type,
|
||||
&value->deviceIndentifier.instance))) {
|
||||
&value->deviceIdentifier.type,
|
||||
&value->deviceIdentifier.instance))) {
|
||||
return -1;
|
||||
}
|
||||
apdu_len += len;
|
||||
} else {
|
||||
value->deviceIndentifier.type = BACNET_NO_DEV_TYPE;
|
||||
value->deviceIndentifier.instance = BACNET_NO_DEV_ID;
|
||||
value->deviceIdentifier.type = BACNET_NO_DEV_TYPE;
|
||||
value->deviceIdentifier.instance = BACNET_NO_DEV_ID;
|
||||
}
|
||||
/* object-identifier [1] BACnetObjectIdentifier */
|
||||
if (-1 == (len =
|
||||
@@ -351,15 +351,15 @@ static void testDevObjPropRef(
|
||||
} else {
|
||||
ct_test(pTest, outData.arrayIndex == BACNET_ARRAY_ALL);
|
||||
}
|
||||
if (inData->deviceIndentifier.type == OBJECT_DEVICE) {
|
||||
if (inData->deviceIdentifier.type == OBJECT_DEVICE) {
|
||||
ct_test(pTest,
|
||||
inData->deviceIndentifier.instance ==
|
||||
outData.deviceIndentifier.instance);
|
||||
inData->deviceIdentifier.instance ==
|
||||
outData.deviceIdentifier.instance);
|
||||
ct_test(pTest,
|
||||
inData->deviceIndentifier.type == outData.deviceIndentifier.type);
|
||||
inData->deviceIdentifier.type == outData.deviceIdentifier.type);
|
||||
} else {
|
||||
ct_test(pTest,outData.deviceIndentifier.instance == BACNET_NO_DEV_ID);
|
||||
ct_test(pTest,outData.deviceIndentifier.type == BACNET_NO_DEV_TYPE);
|
||||
ct_test(pTest,outData.deviceIdentifier.instance == BACNET_NO_DEV_ID);
|
||||
ct_test(pTest,outData.deviceIdentifier.type == BACNET_NO_DEV_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,32 +373,32 @@ static void testDevIdPropRef(
|
||||
inData.objectIdentifier.type = 15;
|
||||
inData.propertyIdentifier = 25;
|
||||
inData.arrayIndex = 0x5678;
|
||||
inData.deviceIndentifier.instance = 0x4343;
|
||||
inData.deviceIndentifier.type = OBJECT_DEVICE;
|
||||
inData.deviceIdentifier.instance = 0x4343;
|
||||
inData.deviceIdentifier.type = OBJECT_DEVICE;
|
||||
testDevObjPropRef(pTest, &inData);
|
||||
/* optional array */
|
||||
inData.objectIdentifier.instance = 0x1234;
|
||||
inData.objectIdentifier.type = 15;
|
||||
inData.propertyIdentifier = 25;
|
||||
inData.arrayIndex = BACNET_ARRAY_ALL;
|
||||
inData.deviceIndentifier.instance = 0x4343;
|
||||
inData.deviceIndentifier.type = OBJECT_DEVICE;
|
||||
inData.deviceIdentifier.instance = 0x4343;
|
||||
inData.deviceIdentifier.type = OBJECT_DEVICE;
|
||||
testDevObjPropRef(pTest, &inData);
|
||||
/* optional device ID */
|
||||
inData.objectIdentifier.instance = 0x1234;
|
||||
inData.objectIdentifier.type = 15;
|
||||
inData.propertyIdentifier = 25;
|
||||
inData.arrayIndex = 1;
|
||||
inData.deviceIndentifier.instance = 0;
|
||||
inData.deviceIndentifier.type = BACNET_NO_DEV_TYPE;
|
||||
inData.deviceIdentifier.instance = 0;
|
||||
inData.deviceIdentifier.type = BACNET_NO_DEV_TYPE;
|
||||
testDevObjPropRef(pTest, &inData);
|
||||
/* optional array + optional device ID */
|
||||
inData.objectIdentifier.instance = 0x1234;
|
||||
inData.objectIdentifier.type = 15;
|
||||
inData.propertyIdentifier = 25;
|
||||
inData.arrayIndex = BACNET_ARRAY_ALL;
|
||||
inData.deviceIndentifier.instance = 0;
|
||||
inData.deviceIndentifier.type = BACNET_NO_DEV_TYPE;
|
||||
inData.deviceIdentifier.instance = 0;
|
||||
inData.deviceIdentifier.type = BACNET_NO_DEV_TYPE;
|
||||
testDevObjPropRef(pTest, &inData);
|
||||
}
|
||||
|
||||
@@ -411,16 +411,16 @@ static void testDevIdRef(
|
||||
int inLen;
|
||||
int outLen;
|
||||
|
||||
inData.deviceIndentifier.instance = 0x4343;
|
||||
inData.deviceIndentifier.type = OBJECT_DEVICE;
|
||||
inData.deviceIdentifier.instance = 0x4343;
|
||||
inData.deviceIdentifier.type = OBJECT_DEVICE;
|
||||
inLen = bacapp_encode_device_obj_ref(buffer, &inData);
|
||||
outLen = bacapp_decode_device_obj_ref(buffer, &outData);
|
||||
ct_test(pTest, outLen == inLen);
|
||||
ct_test(pTest,
|
||||
inData.deviceIndentifier.instance ==
|
||||
outData.deviceIndentifier.instance);
|
||||
inData.deviceIdentifier.instance ==
|
||||
outData.deviceIdentifier.instance);
|
||||
ct_test(pTest,
|
||||
inData.deviceIndentifier.type == outData.deviceIndentifier.type);
|
||||
inData.deviceIdentifier.type == outData.deviceIdentifier.type);
|
||||
}
|
||||
|
||||
void testBACnetDeviceObjectPropertyReference(
|
||||
|
||||
@@ -872,7 +872,7 @@ void testUCOVNotifyData(
|
||||
BACNET_COV_DATA test_data;
|
||||
BACNET_PROPERTY_VALUE value_list[5] = {{0}};
|
||||
|
||||
len = ucov_notify_encode_apdu(&apdu[0], data);
|
||||
len = ucov_notify_encode_apdu(&apdu[0], sizeof(apdu), data);
|
||||
ct_test(pTest, len > 0);
|
||||
apdu_len = len;
|
||||
|
||||
@@ -894,7 +894,7 @@ void testCCOVNotifyData(
|
||||
BACNET_PROPERTY_VALUE value_list[2] = {{0}};
|
||||
uint8_t test_invoke_id = 0;
|
||||
|
||||
len = ccov_notify_encode_apdu(&apdu[0], invoke_id, data);
|
||||
len = ccov_notify_encode_apdu(&apdu[0], sizeof(apdu), invoke_id, data);
|
||||
ct_test(pTest, len != 0);
|
||||
apdu_len = len;
|
||||
|
||||
@@ -995,7 +995,7 @@ void testCOVSubscribeEncoding(
|
||||
BACNET_SUBSCRIBE_COV_DATA test_data;
|
||||
uint8_t test_invoke_id = 0;
|
||||
|
||||
len = cov_subscribe_encode_apdu(&apdu[0], invoke_id, data);
|
||||
len = cov_subscribe_encode_apdu(&apdu[0], sizeof(apdu), invoke_id, data);
|
||||
ct_test(pTest, len != 0);
|
||||
apdu_len = len;
|
||||
|
||||
@@ -1018,7 +1018,8 @@ void testCOVSubscribePropertyEncoding(
|
||||
BACNET_SUBSCRIBE_COV_DATA test_data;
|
||||
uint8_t test_invoke_id = 0;
|
||||
|
||||
len = cov_subscribe_property_encode_apdu(&apdu[0], invoke_id, data);
|
||||
len = cov_subscribe_property_encode_apdu(&apdu[0], sizeof(apdu), invoke_id,
|
||||
data);
|
||||
ct_test(pTest, len != 0);
|
||||
apdu_len = len;
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ SRCS = $(SRC_DIR)/bacdcode.c \
|
||||
$(SRC_DIR)/bacdevobjpropref.c \
|
||||
$(SRC_DIR)/lighting.c \
|
||||
$(SRC_DIR)/indtext.c \
|
||||
$(SRC_DIR)/memcopy.c \
|
||||
$(SRC_DIR)/bactext.c \
|
||||
$(SRC_DIR)/cov.c \
|
||||
ctest.c
|
||||
|
||||
Reference in New Issue
Block a user