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:
@@ -44,6 +44,7 @@ add_executable(${PROJECT_NAME}
|
||||
${SRC_DIR}/bacnet/bactext.c
|
||||
${SRC_DIR}/bacnet/basic/sys/bigend.c
|
||||
${SRC_DIR}/bacnet/datetime.c
|
||||
${SRC_DIR}/bacnet/basic/sys/days.c
|
||||
${SRC_DIR}/bacnet/indtext.c
|
||||
${SRC_DIR}/bacnet/lighting.c
|
||||
# Test and test library files
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
static const char *Address_Cache_Filename = "address_cache";
|
||||
|
||||
/**
|
||||
* @brief Test
|
||||
*/
|
||||
@@ -42,7 +44,6 @@ static void set_address(unsigned index, BACNET_ADDRESS *dest)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0 /* Not used */
|
||||
static void set_file_address(const char *pFilename,
|
||||
uint32_t device_id,
|
||||
BACNET_ADDRESS *dest,
|
||||
@@ -76,18 +77,18 @@ static void set_file_address(const char *pFilename,
|
||||
fclose(pFile);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BACNET_ADDRESS_CACHE_FILE
|
||||
/* Validate that the address data in the file */
|
||||
static void testAddressFile(void)
|
||||
{
|
||||
#if 0 /* Skip file as Address_Cache_Filename is an internal data structure */
|
||||
BACNET_ADDRESS src = { 0 };
|
||||
uint32_t device_id = 0;
|
||||
unsigned max_apdu = 480;
|
||||
BACNET_ADDRESS test_address = { 0 };
|
||||
unsigned test_max_apdu = 0;
|
||||
|
||||
/* Create known data */
|
||||
/* create a fake address */
|
||||
device_id = 55555;
|
||||
src.mac_len = 1;
|
||||
@@ -97,12 +98,19 @@ static void testAddressFile(void)
|
||||
max_apdu = 50;
|
||||
set_file_address(Address_Cache_Filename, device_id, &src, max_apdu);
|
||||
/* retrieve it from the file, and see if we can find it */
|
||||
address_file_init(Address_Cache_Filename);
|
||||
address_init();
|
||||
|
||||
/* Verify */
|
||||
zassert_true(
|
||||
address_get_by_device(device_id, &test_max_apdu, &test_address), NULL);
|
||||
zassert_equal(test_max_apdu, max_apdu, NULL);
|
||||
zassert_true(bacnet_address_same(&test_address, &src), NULL);
|
||||
|
||||
zassert_equal(address_count(), 1, NULL);
|
||||
address_remove_device(device_id);
|
||||
zassert_equal(address_count(), 0, NULL);
|
||||
|
||||
|
||||
/* create a fake address */
|
||||
device_id = 55555;
|
||||
src.mac_len = 6;
|
||||
@@ -118,14 +126,15 @@ static void testAddressFile(void)
|
||||
max_apdu = 50;
|
||||
set_file_address(Address_Cache_Filename, device_id, &src, max_apdu);
|
||||
/* retrieve it from the file, and see if we can find it */
|
||||
address_file_init(Address_Cache_Filename);
|
||||
address_init();
|
||||
zassert_true(
|
||||
address_get_by_device(device_id, &test_max_apdu, &test_address), NULL);
|
||||
zassert_equal(test_max_apdu, max_apdu, NULL);
|
||||
zassert_true(bacnet_address_same(&test_address, &src), NULL);
|
||||
#else
|
||||
ztest_test_skip();
|
||||
#endif
|
||||
|
||||
zassert_equal(address_count(), 1, NULL);
|
||||
address_remove_device(device_id);
|
||||
zassert_equal(address_count(), 0, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user