Issue 187 enable skipped ztest suites (#189)
* Fix some ztests that were skipped * Expose bacapp_same_value() * Fix bacapp, ptransfer tests * Fix bugs in Load_Control object & tests * refactor days functions from datetime module * fix legacy ctests * Add bacnet/basic/sys/days.[ch] to Zephyr build * Update ztest to match from Zephyr v2.6.0; update ringbuf, datetime to build * Fixup ztest test for object/acc * Fix bvlc_address_from_ascii; enable/fix bvlc test * Comment cleanup * test/bacnet/basic/object/lc partially enabled * Fix bacapp_decode_data_len return status on erroneous input * fix ztest include fatal error * fix ztest strsignal reference fatal error * fix zassert_mem_equal reference syntax error * fix zassert_mem_equal reference syntax error Co-authored-by: Gregory Shue <gregory.shue@legrand.us> Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
@@ -13,121 +13,6 @@
|
||||
#include <bacnet/bacdcode.h>
|
||||
#include <bacnet/rpm.h>
|
||||
|
||||
/* TODO: Refactor from bacapp.c (when TEST is defined) */
|
||||
/* generic - can be used by other unit tests
|
||||
returns true if matching or same, false if different */
|
||||
static bool bacapp_same_value(BACNET_APPLICATION_DATA_VALUE *value,
|
||||
BACNET_APPLICATION_DATA_VALUE *test_value)
|
||||
{
|
||||
bool status = false; /*return value */
|
||||
|
||||
/* does the tag match? */
|
||||
if (test_value->tag == value->tag)
|
||||
status = true;
|
||||
if (status) {
|
||||
/* second test for same-ness */
|
||||
status = false;
|
||||
/* does the value match? */
|
||||
switch (test_value->tag) {
|
||||
#if defined(BACAPP_NULL)
|
||||
case BACNET_APPLICATION_TAG_NULL:
|
||||
status = true;
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_BOOLEAN)
|
||||
case BACNET_APPLICATION_TAG_BOOLEAN:
|
||||
if (test_value->type.Boolean == value->type.Boolean)
|
||||
status = true;
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_UNSIGNED)
|
||||
case BACNET_APPLICATION_TAG_UNSIGNED_INT:
|
||||
if (test_value->type.Unsigned_Int == value->type.Unsigned_Int)
|
||||
status = true;
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_SIGNED)
|
||||
case BACNET_APPLICATION_TAG_SIGNED_INT:
|
||||
if (test_value->type.Signed_Int == value->type.Signed_Int)
|
||||
status = true;
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_REAL)
|
||||
case BACNET_APPLICATION_TAG_REAL:
|
||||
if (test_value->type.Real == value->type.Real)
|
||||
status = true;
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_DOUBLE)
|
||||
case BACNET_APPLICATION_TAG_DOUBLE:
|
||||
if (test_value->type.Double == value->type.Double)
|
||||
status = true;
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_ENUMERATED)
|
||||
case BACNET_APPLICATION_TAG_ENUMERATED:
|
||||
if (test_value->type.Enumerated == value->type.Enumerated)
|
||||
status = true;
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_DATE)
|
||||
case BACNET_APPLICATION_TAG_DATE:
|
||||
if (datetime_compare_date(
|
||||
&test_value->type.Date, &value->type.Date) == 0)
|
||||
status = true;
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_TIME)
|
||||
case BACNET_APPLICATION_TAG_TIME:
|
||||
if (datetime_compare_time(
|
||||
&test_value->type.Time, &value->type.Time) == 0)
|
||||
status = true;
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_OBJECT_ID)
|
||||
case BACNET_APPLICATION_TAG_OBJECT_ID:
|
||||
if ((test_value->type.Object_Id.type ==
|
||||
value->type.Object_Id.type) &&
|
||||
(test_value->type.Object_Id.instance ==
|
||||
value->type.Object_Id.instance)) {
|
||||
status = true;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_CHARACTER_STRING)
|
||||
case BACNET_APPLICATION_TAG_CHARACTER_STRING:
|
||||
status = characterstring_same(&value->type.Character_String,
|
||||
&test_value->type.Character_String);
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_OCTET_STRING)
|
||||
case BACNET_APPLICATION_TAG_OCTET_STRING:
|
||||
status = octetstring_value_same(
|
||||
&value->type.Octet_String, &test_value->type.Octet_String);
|
||||
break;
|
||||
#endif
|
||||
#if defined(BACAPP_BIT_STRING)
|
||||
case BACNET_APPLICATION_TAG_BIT_STRING:
|
||||
status = bitstring_same(
|
||||
&value->type.Bit_String, &test_value->type.Bit_String);
|
||||
break;
|
||||
#endif
|
||||
#if 0 /*TODO: Enable when lighting.c builds cleanly */
|
||||
#if defined(BACAPP_LIGHTING_COMMAND)
|
||||
case BACNET_APPLICATION_TAG_LIGHTING_COMMAND:
|
||||
status = lighting_command_same(&value->type.Lighting_Command,
|
||||
&test_value->type.Lighting_Command);
|
||||
break;
|
||||
#endif
|
||||
#endif /*TODO: */
|
||||
default:
|
||||
status = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @addtogroup bacnet_tests
|
||||
* @{
|
||||
|
||||
Reference in New Issue
Block a user