Fixed WriteProperty bypass which is only for present-value property of commandable objects. (#984)
This commit is contained in:
@@ -69,6 +69,26 @@ static void testPropList(void)
|
||||
property_list_member(
|
||||
property_list.Required.pList, PROP_OBJECT_NAME),
|
||||
NULL);
|
||||
/* validate commandable object property list */
|
||||
if ((i == OBJECT_CHANNEL) ||
|
||||
(property_list_member(
|
||||
property_list.Required.pList, PROP_PRESENT_VALUE) &&
|
||||
(property_list_member(
|
||||
property_list.Required.pList, PROP_PRIORITY_ARRAY) ||
|
||||
property_list_member(
|
||||
property_list.Optional.pList, PROP_PRIORITY_ARRAY)))) {
|
||||
zassert_true(
|
||||
property_list_commandable_member(
|
||||
(BACNET_OBJECT_TYPE)i, PROP_PRESENT_VALUE),
|
||||
"Object %s present-value is not listed as commandable",
|
||||
bactext_object_type_name((BACNET_OBJECT_TYPE)i));
|
||||
} else {
|
||||
zassert_false(
|
||||
property_list_commandable_member(
|
||||
(BACNET_OBJECT_TYPE)i, PROP_PRESENT_VALUE),
|
||||
"Object %s present-value is listed as commandable",
|
||||
bactext_object_type_name((BACNET_OBJECT_TYPE)i));
|
||||
}
|
||||
}
|
||||
/* property is a BACnetARRAY */
|
||||
for (i = 0; i < OBJECT_PROPRIETARY_MIN; i++) {
|
||||
|
||||
@@ -308,7 +308,7 @@ static void testWritePropertyNull(void)
|
||||
|
||||
bypass = write_property_relinquish_bypass(NULL, NULL);
|
||||
zassert_equal(bypass, false, NULL);
|
||||
wp_data.object_type = OBJECT_ANALOG_OUTPUT;
|
||||
wp_data.object_type = OBJECT_ANALOG_VALUE;
|
||||
wp_data.object_instance = 0;
|
||||
wp_data.object_property = PROP_PRESENT_VALUE;
|
||||
wp_data.application_data_len =
|
||||
@@ -321,11 +321,16 @@ static void testWritePropertyNull(void)
|
||||
bypass = write_property_relinquish_bypass(
|
||||
&wp_data, test_write_property_member_of_object);
|
||||
zassert_equal(bypass, true, NULL);
|
||||
wp_data.object_type = OBJECT_CHANNEL;
|
||||
Is_Property_Member = false;
|
||||
bypass = write_property_relinquish_bypass(
|
||||
&wp_data, test_write_property_member_of_object);
|
||||
zassert_equal(bypass, false, NULL);
|
||||
wp_data.object_property = PROP_OUT_OF_SERVICE;
|
||||
Is_Property_Member = true;
|
||||
bypass = write_property_relinquish_bypass(
|
||||
&wp_data, test_write_property_member_of_object);
|
||||
zassert_equal(bypass, true, NULL);
|
||||
zassert_equal(bypass, false, NULL);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ZTEST_NEW_API)
|
||||
|
||||
Reference in New Issue
Block a user