Issues/issue 461 update to zephyr v3 4 0 in ci (#463)

* [WIP] Remove unit testcases duplicated under non-unit tree

* [WIP] Update west.yml to Zephyr v3.3.0 (twister verified)

* Update CI to Zephyr v3.4.0 w/ reduced module set

- Update zephyr/module.yml to use Zephyr v3.4.0 + cmsis;
- Update tests to use ZTEST_NEW_API for zephyr builds

Verified by:

1. make clean test
2. ./zephyr/scripts/twister -p unit_testing -T bacnet/zephyr/tests/bacnet

---------

Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
This commit is contained in:
Greg Shue
2023-07-26 14:47:01 -07:00
committed by GitHub
parent 3f7a4d2e19
commit dad9e13485
169 changed files with 1299 additions and 77 deletions
+12
View File
@@ -75,7 +75,11 @@ static void testAbortAPDU(
/**
* @brief Test encode/decode API for strings
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(abort_tests, testAbortEncodeDecode)
#else
static void testAbortEncodeDecode(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -125,7 +129,11 @@ static void testAbortEncodeDecode(void)
/**
* @brief Test Abort Error
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(abort_tests, testAbortError)
#else
static void testAbortError(void)
#endif
{
int i;
BACNET_ERROR_CODE error_code;
@@ -149,6 +157,9 @@ static void testAbortError(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(abort_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(abort_tests,
@@ -158,3 +169,4 @@ void test_main(void)
ztest_run_test_suite(abort_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(alarm_ack_tests, testAlarmAck)
#else
static void testAlarmAck(void)
#endif
{
BACNET_ALARM_ACK_DATA testAlarmAckIn;
BACNET_ALARM_ACK_DATA testAlarmAckOut;
@@ -93,6 +97,9 @@ static void testAlarmAck(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(alarm_ack_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(alarm_ack_tests,
@@ -101,3 +108,4 @@ void test_main(void)
ztest_run_test_suite(alarm_ack_tests);
}
#endif
+16
View File
@@ -67,7 +67,11 @@ static void testAtomicReadFileAckAccess(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(arf_tests, testAtomicReadFileAck)
#else
static void testAtomicReadFileAck(void)
#endif
{
BACNET_ATOMIC_READ_FILE_DATA data = { 0 };
uint8_t test_octet_string[32] = "Joshua-Mary-Anna-Christopher";
@@ -127,7 +131,11 @@ static void testAtomicReadFileAccess(BACNET_ATOMIC_READ_FILE_DATA *data)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(arf_tests, testAtomicReadFile)
#else
static void testAtomicReadFile(void)
#endif
{
BACNET_ATOMIC_READ_FILE_DATA data = { 0 };
@@ -148,7 +156,11 @@ static void testAtomicReadFile(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(arf_tests, testAtomicReadFileMalformed)
#else
static void testAtomicReadFileMalformed(void)
#endif
{
uint8_t apdu[480] = { 0 };
/* payloads with malformation */
@@ -183,6 +195,9 @@ static void testAtomicReadFileMalformed(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(arf_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(arf_tests,
@@ -193,3 +208,4 @@ void test_main(void)
ztest_run_test_suite(arf_tests);
}
#endif
+16
View File
@@ -58,7 +58,11 @@ static void testAtomicWriteFileAccess(BACNET_ATOMIC_WRITE_FILE_DATA *data)
octetstring_length(&test_data.fileData[0])), 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(awf_tests, testAtomicWriteFile)
#else
static void testAtomicWriteFile(void)
#endif
{
BACNET_ATOMIC_WRITE_FILE_DATA data = { 0 };
uint8_t test_octet_string[32] = "Joshua-Mary-Anna-Christopher";
@@ -118,7 +122,11 @@ static void testAtomicWriteFileAckAccess(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(awf_tests, testAtomicWriteFileAck)
#else
static void testAtomicWriteFileAck(void)
#endif
{
BACNET_ATOMIC_WRITE_FILE_DATA data = { 0 };
@@ -133,7 +141,11 @@ static void testAtomicWriteFileAck(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(awf_tests, testAtomicWriteFileMalformed)
#else
static void testAtomicWriteFileMalformed(void)
#endif
{
uint8_t apdu[480] = { 0 };
/* payloads with malformation */
@@ -170,6 +182,9 @@ static void testAtomicWriteFileMalformed(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(awf_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(awf_tests,
@@ -180,3 +195,4 @@ void test_main(void)
ztest_run_test_suite(awf_tests);
}
#endif
+12
View File
@@ -14,7 +14,11 @@
* @{
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacnet_address_tests, test_BACNET_ADDRESS)
#else
static void test_BACNET_ADDRESS(void)
#endif
{
BACNET_ADDRESS src = { 0 }, dest = { 0 };
BACNET_ADDRESS test_src = { 0 }, test_dest = { 0 };
@@ -97,7 +101,11 @@ static void test_BACNET_ADDRESS(void)
zassert_false(status, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacnet_address_tests, test_BACNET_MAC_ADDRESS)
#else
static void test_BACNET_MAC_ADDRESS(void)
#endif
{
BACNET_MAC_ADDRESS dest = { 0 }, src = { 0 };
uint8_t adr[MAX_MAC_LEN] = { 0 };
@@ -175,6 +183,9 @@ static void test_BACNET_MAC_ADDRESS(void)
/**
* @}
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacnet_address_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacnet_address_tests,
@@ -184,3 +195,4 @@ void test_main(void)
ztest_run_test_suite(bacnet_address_tests);
}
#endif
+48
View File
@@ -64,7 +64,11 @@ static const BACNET_APPLICATION_TAG tag_list[] = {
* @{
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, test_bacapp_decode_application_data)
#else
static void test_bacapp_decode_application_data(void)
#endif
{
uint8_t apdu[128] = { 0 };
//unsigned max_apdu_len = sizeof(apdu);
@@ -76,7 +80,11 @@ static void test_bacapp_decode_application_data(void)
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, test_bacapp_decode_data_len)
#else
static void test_bacapp_decode_data_len(void)
#endif
{
uint8_t apdu[3] = { 0 };
uint32_t len_value_type = 0;
@@ -136,7 +144,11 @@ static void test_bacapp_decode_data_len(void)
zassert_equal(bacapp_decode_data_len(apdu, BACNET_APPLICATION_TAG_OBJECT_ID, len_value_type), expected_value, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, test_bacapp_copy)
#else
static void test_bacapp_copy(void)
#endif
{
int i = 0;
@@ -180,7 +192,11 @@ static void test_bacapp_copy(void)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, test_bacapp_value_list_init)
#else
static void test_bacapp_value_list_init(void)
#endif
{
BACNET_APPLICATION_DATA_VALUE value[2] = { { 0 } };
size_t max_count = 0;
@@ -208,7 +224,11 @@ static void test_bacapp_value_list_init(void)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, test_bacapp_property_value_list_init)
#else
static void test_bacapp_property_value_list_init(void)
#endif
{
BACNET_PROPERTY_VALUE value[2] = { { 0 } };
size_t max_count = 0;
@@ -237,7 +257,11 @@ static void test_bacapp_property_value_list_init(void)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, test_bacapp_same_value)
#else
static void test_bacapp_same_value(void)
#endif
{
BACNET_APPLICATION_DATA_VALUE value = { 0 };
BACNET_APPLICATION_DATA_VALUE test_value = { 0 };
@@ -448,7 +472,11 @@ static void test_bacapp_same_value(void)
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, testBACnetApplicationData_Safe)
#else
static void testBACnetApplicationData_Safe(void)
#endif
{
int i;
uint8_t apdu[MAX_APDU];
@@ -581,7 +609,11 @@ static void testBACnetApplicationData_Safe(void)
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, testBACnetApplicationDataLength)
#else
static void testBACnetApplicationDataLength(void)
#endif
{
int apdu_len = 0; /* total length of the apdu, return value */
int len = 0; /* total length of the apdu, return value */
@@ -770,7 +802,11 @@ static bool verifyBACnetComplexDataValue(
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, testBACnetApplicationData)
#else
static void testBACnetApplicationData(void)
#endif
{
BACNET_APPLICATION_DATA_VALUE value = { 0 };
bool status = false;
@@ -1026,7 +1062,11 @@ static void testBACnetApplicationData(void)
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, test_bacapp_context_data)
#else
static void test_bacapp_context_data(void)
#endif
{
const uint8_t context_tag_number = 1;
uint8_t apdu[480] = { 0 };
@@ -1052,7 +1092,11 @@ static void test_bacapp_context_data(void)
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacapp_tests, test_bacapp_sprintf_data)
#else
static void test_bacapp_sprintf_data(void)
#endif
{
BACNET_APPLICATION_DATA_VALUE value = { 0 };
BACNET_OBJECT_PROPERTY_VALUE object_value = { 0 };
@@ -1081,6 +1125,9 @@ static void test_bacapp_sprintf_data(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacapp_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacapp_tests,
@@ -1099,3 +1146,4 @@ void test_main(void)
ztest_run_test_suite(bacapp_tests);
}
#endif
+104
View File
@@ -90,7 +90,11 @@ static void print_apdu(uint8_t *pBlock, uint32_t num)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeTags)
#else
static void testBACDCodeTags(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
uint8_t tag_number = 0, test_tag_number = 0;
@@ -142,7 +146,11 @@ static void testBACDCodeTags(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeEnumerated)
#else
static void testBACDCodeEnumerated(void)
#endif
{
uint8_t array[5] = { 0 };
uint8_t encoded_array[5] = { 0 };
@@ -188,7 +196,11 @@ static void testBACDCodeEnumerated(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeReal)
#else
static void testBACDCodeReal(void)
#endif
{
uint8_t real_array[4] = { 0 };
uint8_t encoded_array[4] = { 0 };
@@ -222,7 +234,11 @@ static void testBACDCodeReal(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeDouble)
#else
static void testBACDCodeDouble(void)
#endif
{
uint8_t double_array[8] = { 0 };
uint8_t encoded_array[8] = { 0 };
@@ -289,7 +305,11 @@ static void verifyBACDCodeUnsignedValue(BACNET_UNSIGNED_INTEGER value)
zassert_false(IS_CONTEXT_SPECIFIC(apdu[0]), NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeUnsigned)
#else
static void testBACDCodeUnsigned(void)
#endif
{
#ifdef UINT64_MAX
const unsigned max_bits = 64;
@@ -309,7 +329,11 @@ static void testBACDCodeUnsigned(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACnetUnsigned)
#else
static void testBACnetUnsigned(void)
#endif
{
uint8_t apdu[32] = { 0 };
BACNET_UNSIGNED_INTEGER value = 1, test_value = 0;
@@ -378,7 +402,11 @@ static void testBACDCodeSignedValue(int32_t value)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeSigned)
#else
static void testBACDCodeSigned(void)
#endif
{
int value = 1;
int i = 0;
@@ -402,7 +430,11 @@ static void testBACDCodeSigned(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACnetSigned)
#else
static void testBACnetSigned(void)
#endif
{
uint8_t apdu[32] = { 0 };
int32_t value = 0, test_value = 0;
@@ -431,7 +463,11 @@ static void testBACnetSigned(void)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeOctetString)
#else
static void testBACDCodeOctetString(void)
#endif
{
uint8_t array[MAX_APDU] = { 0 };
uint8_t encoded_array[MAX_APDU] = { 0 };
@@ -486,7 +522,11 @@ static void testBACDCodeOctetString(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeCharacterString)
#else
static void testBACDCodeCharacterString(void)
#endif
{
uint8_t array[MAX_APDU] = { 0 };
uint8_t encoded_array[MAX_APDU] = { 0 };
@@ -541,7 +581,11 @@ static void testBACDCodeCharacterString(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeObject)
#else
static void testBACDCodeObject(void)
#endif
{
uint8_t object_array[32] = { 0 };
uint8_t encoded_array[32] = { 0 };
@@ -611,7 +655,11 @@ static void testBACDCodeObject(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeMaxSegsApdu)
#else
static void testBACDCodeMaxSegsApdu(void)
#endif
{
int max_segs[8] = { 0, 2, 4, 8, 16, 32, 64, 65 };
int max_apdu[6] = { 50, 128, 206, 480, 1024, 1476 };
@@ -629,7 +677,11 @@ static void testBACDCodeMaxSegsApdu(void)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBACDCodeBitString)
#else
static void testBACDCodeBitString(void)
#endif
{
uint8_t bit = 0;
BACNET_BIT_STRING bit_string;
@@ -680,7 +732,11 @@ static void testBACDCodeBitString(void)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testUnsignedContextDecodes)
#else
static void testUnsignedContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int inLen = 0;
@@ -791,7 +847,11 @@ static void testUnsignedContextDecodes(void)
zassert_equal(outLen2, BACNET_STATUS_ERROR, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testSignedContextDecodes)
#else
static void testSignedContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU];
int inLen;
@@ -886,7 +946,11 @@ static void testSignedContextDecodes(void)
zassert_equal(outLen2, BACNET_STATUS_ERROR, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testEnumeratedContextDecodes)
#else
static void testEnumeratedContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int inLen = 0;
@@ -980,7 +1044,11 @@ static void testEnumeratedContextDecodes(void)
zassert_equal(outLen2, BACNET_STATUS_ERROR, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testFloatContextDecodes)
#else
static void testFloatContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU];
int inLen;
@@ -1026,7 +1094,11 @@ static void testFloatContextDecodes(void)
zassert_equal(outLen2, BACNET_STATUS_ERROR, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testDoubleContextDecodes)
#else
static void testDoubleContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU];
int inLen;
@@ -1072,7 +1144,11 @@ static void testDoubleContextDecodes(void)
zassert_equal(outLen2, BACNET_STATUS_ERROR, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testObjectIDContextDecodes)
#else
static void testObjectIDContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU];
int inLen;
@@ -1111,7 +1187,11 @@ static void testObjectIDContextDecodes(void)
zassert_equal(outLen2, BACNET_STATUS_ERROR, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testCharacterStringContextDecodes)
#else
static void testCharacterStringContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU];
int inLen;
@@ -1146,7 +1226,11 @@ static void testCharacterStringContextDecodes(void)
zassert_equal(strcmp(in.value, out.value), 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testBitStringContextDecodes)
#else
static void testBitStringContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU];
int inLen;
@@ -1184,7 +1268,11 @@ static void testBitStringContextDecodes(void)
zassert_equal(memcmp(in.value, out.value, MAX_BITSTRING_BYTES), 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testOctetStringContextDecodes)
#else
static void testOctetStringContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU];
int inLen;
@@ -1218,7 +1306,11 @@ static void testOctetStringContextDecodes(void)
zassert_true(octetstring_value_same(&in, &out), NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testTimeContextDecodes)
#else
static void testTimeContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU];
int inLen;
@@ -1257,7 +1349,11 @@ static void testTimeContextDecodes(void)
zassert_equal(in.sec, out.sec, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, testDateContextDecodes)
#else
static void testDateContextDecodes(void)
#endif
{
uint8_t apdu[MAX_APDU];
int inLen;
@@ -1319,7 +1415,11 @@ static int bacnet_array_property_element_encode(
return apdu_len;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdcode_tests, test_bacnet_array_encode)
#else
static void test_bacnet_array_encode(void)
#endif
{
uint32_t object_instance = 0;
BACNET_ARRAY_INDEX array_index = 0;
@@ -1383,6 +1483,9 @@ static void test_bacnet_array_encode(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacdcode_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacdcode_tests,
@@ -1415,3 +1518,4 @@ void test_main(void)
ztest_run_test_suite(bacdcode_tests);
}
#endif
+12
View File
@@ -68,7 +68,11 @@ static void testBACnetRecipientData(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacnet_destination_tests, testBACnetDestination)
#else
static void testBACnetDestination(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
BACNET_DESTINATION destination = { 0 }, test_destination = { 0 };
@@ -115,7 +119,11 @@ static void testBACnetDestination(void)
/**
* Unit Test for ASCII conversion
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacnet_destination_tests, test_BACnetDestination_ASCII)
#else
static void test_BACnetDestination_ASCII(void)
#endif
{
BACNET_DESTINATION destination = { 0 }, test_destination = { 0 };
int len = 0, test_len = 0;
@@ -149,6 +157,9 @@ static void test_BACnetDestination_ASCII(void)
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacnet_destination_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacnet_destination_tests,
@@ -158,3 +169,4 @@ void test_main(void)
ztest_run_test_suite(bacnet_destination_tests);
}
#endif
+16
View File
@@ -58,7 +58,11 @@ static void testDevObjPropRef(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdevobjpropref_tests, testDevIdPropRef)
#else
static void testDevIdPropRef(void)
#endif
{
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE inData;
@@ -96,7 +100,11 @@ static void testDevIdPropRef(void)
testDevObjPropRef(&inData);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdevobjpropref_tests, testDevIdRef)
#else
static void testDevIdRef(void)
#endif
{
BACNET_DEVICE_OBJECT_REFERENCE inData;
BACNET_DEVICE_OBJECT_REFERENCE outData;
@@ -115,7 +123,11 @@ static void testDevIdRef(void)
inData.deviceIdentifier.type, outData.deviceIdentifier.type, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacdevobjpropref_tests, testObjPropRef)
#else
static void testObjPropRef(void)
#endif
{
BACNET_OBJECT_PROPERTY_REFERENCE inData;
BACNET_OBJECT_PROPERTY_REFERENCE outData;
@@ -167,6 +179,9 @@ static void testObjPropRef(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacdevobjpropref_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacdevobjpropref_tests,
@@ -177,3 +192,4 @@ void test_main(void)
ztest_run_test_suite(bacdevobjpropref_tests);
}
#endif
+8
View File
@@ -46,7 +46,11 @@ static int bacerror_decode_apdu(uint8_t *apdu,
/**
* @brief Test BACnet error type encode/decode
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacerror_tests, testBACError)
#else
static void testBACError(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -134,6 +138,9 @@ static void testBACError(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacerror_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacerror_tests,
@@ -142,3 +149,4 @@ void test_main(void)
ztest_run_test_suite(bacerror_tests);
}
#endif
+52
View File
@@ -19,7 +19,11 @@
/**
* @brief Test encode/decode API for unsigned 16b integers
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetUnsigned16)
#else
static void testBACnetUnsigned16(void)
#endif
{
uint8_t apdu[32] = { 0 };
uint16_t value = 0, test_value = 0;
@@ -50,7 +54,11 @@ static void testBACnetUnsigned16(void)
/**
* @brief Test encode/decode API for unsigned 24b integers
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetUnsigned24)
#else
static void testBACnetUnsigned24(void)
#endif
{
uint8_t apdu[32] = { 0 };
uint32_t value = 0, test_value = 0;
@@ -81,7 +89,11 @@ static void testBACnetUnsigned24(void)
/**
* @brief Test encode/decode API for unsigned 32b integers
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetUnsigned32)
#else
static void testBACnetUnsigned32(void)
#endif
{
uint8_t apdu[32] = { 0 };
uint32_t value = 0, test_value = 0;
@@ -112,7 +124,11 @@ static void testBACnetUnsigned32(void)
/**
* @brief Test encode/decode API for unsigned 40b integers (if 64b supported)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetUnsigned40)
#else
static void testBACnetUnsigned40(void)
#endif
{
#ifdef UINT64_MAX
uint8_t apdu[64] = { 0 };
@@ -149,7 +165,11 @@ static void testBACnetUnsigned40(void)
/**
* @brief Test encode/decode API for unsigned 48b integers (if 64b supported)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetUnsigned48)
#else
static void testBACnetUnsigned48(void)
#endif
{
#ifdef UINT64_MAX
uint8_t apdu[64] = { 0 };
@@ -186,7 +206,11 @@ static void testBACnetUnsigned48(void)
/**
* @brief Test encode/decode API for unsigned 56b integers (if 64b supported)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetUnsigned56)
#else
static void testBACnetUnsigned56(void)
#endif
{
#ifdef UINT64_MAX
uint8_t apdu[64] = { 0 };
@@ -223,7 +247,11 @@ static void testBACnetUnsigned56(void)
/**
* @brief Test encode/decode API for unsigned 64b integers (if 64b supported)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetUnsigned64)
#else
static void testBACnetUnsigned64(void)
#endif
{
#ifdef UINT64_MAX
uint8_t apdu[64] = { 0 };
@@ -260,7 +288,11 @@ static void testBACnetUnsigned64(void)
/**
* @brief Test calculation of unsigned length
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetUnsignedLength)
#else
static void testBACnetUnsignedLength(void)
#endif
{
BACNET_UNSIGNED_INTEGER value = 0;
int len = 0;
@@ -278,7 +310,11 @@ static void testBACnetUnsignedLength(void)
/**
* @brief Test encode/decode API for signed 8b integers
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetSigned8)
#else
static void testBACnetSigned8(void)
#endif
{
uint8_t apdu[32] = { 0 };
int32_t value = 0, test_value = 0;
@@ -311,7 +347,11 @@ static void testBACnetSigned8(void)
/**
* @brief Test encode/decode API for signed 16b integers
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetSigned16)
#else
static void testBACnetSigned16(void)
#endif
{
uint8_t apdu[32] = { 0 };
int32_t value = 0, test_value = 0;
@@ -344,7 +384,11 @@ static void testBACnetSigned16(void)
/**
* @brief Test encode/decode API for signed 24b integers
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetSigned24)
#else
static void testBACnetSigned24(void)
#endif
{
uint8_t apdu[32] = { 0 };
int32_t value = 0, test_value = 0;
@@ -375,7 +419,11 @@ static void testBACnetSigned24(void)
/**
* @brief Test encode/decode API for signed 32b integers
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacint_tests, testBACnetSigned32)
#else
static void testBACnetSigned32(void)
#endif
{
uint8_t apdu[32] = { 0 };
int32_t value = 0, test_value = 0;
@@ -414,6 +462,9 @@ static void testBACnetSigned32(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacint_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacint_tests,
@@ -433,3 +484,4 @@ void test_main(void)
ztest_run_test_suite(bacint_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacpropstates_tests, testPropStates)
#else
void testPropStates(void)
#endif
{
BACNET_PROPERTY_STATE inData;
BACNET_PROPERTY_STATE outData;
@@ -125,6 +129,9 @@ void testPropStates(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacpropstates_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacpropstates_tests,
@@ -133,3 +140,4 @@ void test_main(void)
ztest_run_test_suite(bacpropstates_tests);
}
#endif
+12
View File
@@ -20,7 +20,11 @@
/**
* @brief Test BACnet real data type (single precision floating point)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacreal_tests, testBACreal)
#else
static void testBACreal(void)
#endif
{
float real_value = 3.14159F, test_real_value = 0.0;
uint8_t apdu[MAX_APDU] = { 0 };
@@ -36,7 +40,11 @@ static void testBACreal(void)
/**
* @brief Test BACnet double data type (double precision floating point)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacreal_tests, testBACdouble)
#else
static void testBACdouble(void)
#endif
{
double double_value = 3.1415927, test_double_value = 0.0;
uint8_t apdu[MAX_APDU] = { 0 };
@@ -53,6 +61,9 @@ static void testBACdouble(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacreal_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacreal_tests,
@@ -62,3 +73,4 @@ void test_main(void)
ztest_run_test_suite(bacreal_tests);
}
#endif
+16
View File
@@ -19,7 +19,11 @@
/**
* @brief Test encode/decode API for strings
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacstr_tests, testBitString)
#else
static void testBitString(void)
#endif
{
uint8_t bit = 0;
int max_bit;
@@ -83,7 +87,11 @@ static void testBitString(void)
/**
* @brief Test encode/decode API for character strings
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacstr_tests, testCharacterString)
#else
static void testCharacterString(void)
#endif
{
BACNET_CHARACTER_STRING bacnet_string;
char *value = "Joshua,Mary,Anna,Christopher";
@@ -175,7 +183,11 @@ static void testCharacterString(void)
/**
* @brief Test encode/decode API for octet strings
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacstr_tests, testOctetString)
#else
static void testOctetString(void)
#endif
{
BACNET_OCTET_STRING bacnet_string;
BACNET_OCTET_STRING bacnet_string_twin;
@@ -294,6 +306,9 @@ static void testOctetString(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacstr_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacstr_tests,
@@ -304,3 +319,4 @@ void test_main(void)
ztest_run_test_suite(bacstr_tests);
}
#endif
+9
View File
@@ -66,7 +66,11 @@ static void test_BACnetTimeValue(BACNET_TIME_VALUE *value)
/**
* @brief Test encode/decode API
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(BACnetTimeValue_tests, test_BACnetTimeValues)
#else
static void test_BACnetTimeValues(void)
#endif
{
BACNET_TIME_VALUE time_value = { 0 };
@@ -83,6 +87,10 @@ static void test_BACnetTimeValues(void)
/**
* @}
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(BACnetTimeValue_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(BACnetTimeValue_tests,
@@ -91,3 +99,4 @@ void test_main(void)
ztest_run_test_suite(BACnetTimeValue_tests);
}
#endif
@@ -80,7 +80,11 @@ static void set_file_address(const char *pFilename,
#ifdef BACNET_ADDRESS_CACHE_FILE
/* Validate that the address data in the file */
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(address_tests, testAddressFile)
#else
static void testAddressFile(void)
#endif
{
BACNET_ADDRESS src = { 0 };
uint32_t device_id = 0;
@@ -138,7 +142,11 @@ static void testAddressFile(void)
}
#endif
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(address_tests, testAddress)
#else
static void testAddress(void)
#endif
{
unsigned i, count;
BACNET_ADDRESS src;
@@ -191,6 +199,9 @@ static void testAddress(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(address_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
#ifdef BACNET_ADDRESS_CACHE_FILE
@@ -209,3 +220,4 @@ void test_main(void)
#endif
}
#endif
+8
View File
@@ -20,7 +20,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(acc_tests, test_Accumulator)
#else
static void test_Accumulator(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -77,6 +81,9 @@ static void test_Accumulator(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(acc_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(acc_tests,
@@ -85,3 +92,4 @@ void test_main(void)
ztest_run_test_suite(acc_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(access_credential_tests, testAccessCredential)
#else
static void testAccessCredential(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -70,6 +74,9 @@ static void testAccessCredential(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(access_credential_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(access_credential_tests,
@@ -78,3 +85,4 @@ void test_main(void)
ztest_run_test_suite(access_credential_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(tests_object_access_door, test_object_access_door)
#else
static void test_object_access_door(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -78,6 +82,9 @@ static void test_object_access_door(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(tests_object_access_door, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(tests_object_access_door,
@@ -86,3 +93,4 @@ void test_main(void)
ztest_run_test_suite(tests_object_access_door);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(access_point_tests, testAccessPoint)
#else
static void testAccessPoint(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -51,6 +55,9 @@ static void testAccessPoint(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(access_point_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(access_point_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(access_point_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(access_rights_tests, testAccessRights)
#else
static void testAccessRights(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -51,6 +55,9 @@ static void testAccessRights(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(access_rights_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(access_rights_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(access_rights_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(access_user_tests, testAccessUser)
#else
static void testAccessUser(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -51,6 +55,9 @@ static void testAccessUser(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(access_user_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(access_user_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(access_user_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(access_zone_tests, testAccessZone)
#else
static void testAccessZone(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -51,6 +55,9 @@ static void testAccessZone(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(access_zone_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(access_zone_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(access_zone_tests);
}
#endif
+8
View File
@@ -20,7 +20,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ai_tests, testAnalogInput)
#else
static void testAnalogInput(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0, test_len = 0;
@@ -58,6 +62,9 @@ static void testAnalogInput(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(ai_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(ai_tests,
@@ -66,3 +73,4 @@ void test_main(void)
ztest_run_test_suite(ai_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ao_tests, testAnalogOutput)
#else
static void testAnalogOutput(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0, test_len = 0;
@@ -68,6 +72,9 @@ static void testAnalogOutput(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(ao_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(ao_tests,
@@ -76,3 +83,4 @@ void test_main(void)
ztest_run_test_suite(ao_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(av_tests, testAnalog_Value)
#else
static void testAnalog_Value(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0, test_len = 0;
@@ -61,6 +65,9 @@ static void testAnalog_Value(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(av_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(av_tests,
@@ -69,3 +76,4 @@ void test_main(void)
ztest_run_test_suite(av_tests);
}
#endif
@@ -20,7 +20,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bacfile_tests, test_BACnet_File_Object)
#else
static void test_BACnet_File_Object(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0, test_len = 0;
@@ -65,6 +69,9 @@ static void test_BACnet_File_Object(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bacfile_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bacfile_tests,
@@ -73,3 +80,4 @@ void test_main(void)
ztest_run_test_suite(bacfile_tests);
}
#endif
+8
View File
@@ -20,7 +20,11 @@
/**
* @brief Test Binary Input handling
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bi_tests, testBinaryInput)
#else
static void testBinaryInput(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0, test_len = 0;
@@ -58,6 +62,9 @@ static void testBinaryInput(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bi_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bi_tests,
@@ -66,3 +73,4 @@ void test_main(void)
ztest_run_test_suite(bi_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bo_tests, testBinaryOutput)
#else
static void testBinaryOutput(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0, test_len = 0;
@@ -66,6 +70,9 @@ static void testBinaryOutput(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bo_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bo_tests,
@@ -74,3 +81,4 @@ void test_main(void)
ztest_run_test_suite(bo_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bv_tests, testBinary_Value)
#else
static void testBinary_Value(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0, test_len = 0;
@@ -61,6 +65,9 @@ static void testBinary_Value(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bv_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bv_tests,
@@ -69,3 +76,4 @@ void test_main(void)
ztest_run_test_suite(bv_tests);
}
#endif
@@ -18,7 +18,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(color_object_tests, testColorObject)
#else
static void testColorObject(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -62,6 +66,9 @@ static void testColorObject(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(color_object_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(color_object_tests,
@@ -70,3 +77,4 @@ void test_main(void)
ztest_run_test_suite(color_object_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(color_temperature_tests, testColorTemperature)
#else
static void testColorTemperature(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -63,6 +67,9 @@ static void testColorTemperature(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(color_temperature_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(color_temperature_tests,
@@ -71,3 +78,4 @@ void test_main(void)
ztest_run_test_suite(color_temperature_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(tests_object_command, test_object_command)
#else
static void test_object_command(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -78,6 +82,9 @@ static void test_object_command(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(tests_object_command, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(tests_object_command,
@@ -86,3 +93,4 @@ void test_main(void)
ztest_run_test_suite(tests_object_command);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(credential_data_input_tests, testCredentialDataInput)
#else
static void testCredentialDataInput(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -51,6 +55,9 @@ static void testCredentialDataInput(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(credential_data_input_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(credential_data_input_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(credential_data_input_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(device_tests, testDevice)
#else
static void testDevice(void)
#endif
{
bool status = false;
const char *name = "Patricia";
@@ -54,6 +58,9 @@ static void testDevice(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(device_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(device_tests,
@@ -62,3 +69,4 @@ void test_main(void)
ztest_run_test_suite(device_tests);
}
#endif
+68
View File
@@ -202,7 +202,11 @@ bool bacapp_same_value(
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_Load_Control_Count)
#else
static void test_Load_Control_Count(void)
#endif
{
/* Verify the same value is returned on successive calls without init */
zassert_equal(Load_Control_Count(), MAX_LOAD_CONTROLS, NULL);
@@ -381,7 +385,11 @@ static void Load_Control_WriteProperty_Start_Time(
zassert_true(status, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, testLoadControlStateMachine)
#else
static void testLoadControlStateMachine(void)
#endif
{
//TODO: unsigned i = 0, j = 0;
uint8_t level = 0;
@@ -528,7 +536,11 @@ static void testLoadControlStateMachine(void)
#define MAX_LOAD_CONTROLS (4)
#endif
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_api_stubs)
#else
static void test_api_stubs(void)
#endif
{
BACNET_CHARACTER_STRING object_name_st = { 0 };
@@ -555,7 +567,11 @@ static void test_api_stubs(void)
zassert_true(characterstring_printable(&object_name_st), NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_Load_Control_Read_Write_Property)
#else
static void test_Load_Control_Read_Write_Property(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -640,7 +656,11 @@ static bool init_wp_data_and_value(
return status;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedInactive_gets_RcvShedRequests)
#else
static void test_ShedInactive_gets_RcvShedRequests(void)
#endif
{
BACNET_APPLICATION_DATA_VALUE value = { 0 };
BACNET_WRITE_PROPERTY_DATA wp_data = { 0 };
@@ -675,77 +695,121 @@ static void test_ShedInactive_gets_RcvShedRequests(void)
// default returns error
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedReqPending_gets_ReconfigPending)
#else
static void test_ShedReqPending_gets_ReconfigPending(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
#endif
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedReqPending_gets_CancelShed)
#else
static void test_ShedReqPending_gets_CancelShed(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
#endif
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedReqPending_gets_CannotMeetShed)
#else
static void test_ShedReqPending_gets_CannotMeetShed(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
#endif
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedReqPending_gets_PrepareToShed)
#else
static void test_ShedReqPending_gets_PrepareToShed(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
#endif
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedReqPending_gets_AbleToMeetShed)
#else
static void test_ShedReqPending_gets_AbleToMeetShed(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
#endif
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedNonCommpliant_gets_UnsuccessfulShedReconfig)
#else
static void test_ShedNonCommpliant_gets_UnsuccessfulShedReconfig(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
#endif
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedNonCommpliant_gets_FinishedUnsuccessfulShed)
#else
static void test_ShedNonCommpliant_gets_FinishedUnsuccessfulShed(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
#endif
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedNonCommpliant_gets_CanNowComplyWithShed)
#else
static void test_ShedNonCommpliant_gets_CanNowComplyWithShed(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
#endif
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedCommpliant_gets_FinishedSuccessfulShed)
#else
static void test_ShedCommpliant_gets_FinishedSuccessfulShed(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
#endif
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedCommpliant_gets_SuccessfulShedReconfig)
#else
static void test_ShedCommpliant_gets_SuccessfulShedReconfig(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
#endif
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lc_tests, test_ShedCommpliant_gets_CanNoLongerComplyWithShed)
#else
static void test_ShedCommpliant_gets_CanNoLongerComplyWithShed(void)
#endif
{
#ifndef UNIT_TESTING
ztest_test_skip();
@@ -757,6 +821,9 @@ static void test_ShedCommpliant_gets_CanNoLongerComplyWithShed(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(lc_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(lc_tests,
@@ -780,3 +847,4 @@ void test_main(void)
ztest_run_test_suite(lc_tests);
}
#endif
+8
View File
@@ -20,7 +20,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lo_tests, testLightingOutput)
#else
static void testLightingOutput(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0, test_len = 0;
@@ -64,6 +68,9 @@ static void testLightingOutput(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(lo_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(lo_tests,
@@ -72,3 +79,4 @@ void test_main(void)
ztest_run_test_suite(lo_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lsp_tests, testLifeSafetyPoint)
#else
static void testLifeSafetyPoint(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -51,6 +55,9 @@ static void testLifeSafetyPoint(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(lsp_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(lsp_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(lsp_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ms_input_tests, testMultistateInput)
#else
static void testMultistateInput(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -51,6 +55,9 @@ static void testMultistateInput(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(ms_input_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(ms_input_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(ms_input_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(mso_tests, testMultistateOutput)
#else
static void testMultistateOutput(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0, test_len = 0;
@@ -68,6 +72,9 @@ static void testMultistateOutput(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(mso_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(mso_tests,
@@ -76,3 +83,4 @@ void test_main(void)
ztest_run_test_suite(mso_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(msv_tests, testMultistateValue)
#else
static void testMultistateValue(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -51,6 +55,9 @@ static void testMultistateValue(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(msv_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(msv_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(msv_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(notification_class_tests, test_Notification_Class)
#else
static void test_Notification_Class(void)
#endif
{
BACNET_READ_PROPERTY_DATA rpdata;
uint8_t apdu[MAX_APDU] = { 0 };
@@ -51,6 +55,9 @@ static void test_Notification_Class(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(notification_class_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(notification_class_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(notification_class_tests);
}
#endif
@@ -20,7 +20,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(netport_tests, test_network_port)
#else
static void test_network_port(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0;
@@ -96,6 +100,9 @@ static void test_network_port(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(netport_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(netport_tests,
@@ -104,3 +111,4 @@ void test_main(void)
ztest_run_test_suite(netport_tests);
}
#endif
@@ -32,7 +32,11 @@ static void testBACnetObjectsCompare(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(objects_tests, testBACnetObjects)
#else
static void testBACnetObjects(void)
#endif
{
uint32_t device_id = 0;
unsigned test_point = 0;
@@ -80,6 +84,9 @@ static void testBACnetObjects(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(objects_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(objects_tests,
@@ -88,3 +95,4 @@ void test_main(void)
ztest_run_test_suite(objects_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(osv_tests, testOctetString_Value)
#else
static void testOctetString_Value(void)
#endif
{
BACNET_READ_PROPERTY_DATA rpdata;
uint8_t apdu[MAX_APDU] = { 0 };
@@ -51,6 +55,9 @@ static void testOctetString_Value(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(osv_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(osv_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(osv_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(piv_tests, testPositiveInteger_Value)
#else
static void testPositiveInteger_Value(void)
#endif
{
BACNET_READ_PROPERTY_DATA rpdata;
uint8_t apdu[MAX_APDU] = { 0 };
@@ -51,6 +55,9 @@ static void testPositiveInteger_Value(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(piv_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(piv_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(piv_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(schedule_tests, testSchedule)
#else
static void testSchedule(void)
#endif
{
BACNET_READ_PROPERTY_DATA rpdata;
uint8_t apdu[MAX_APDU] = { 0 };
@@ -51,6 +55,9 @@ static void testSchedule(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(schedule_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(schedule_tests,
@@ -59,3 +66,4 @@ void test_main(void)
ztest_run_test_suite(schedule_tests);
}
#endif
@@ -49,7 +49,11 @@ static void test_color_rgb_xy_unit(
/**
* Unit Test for sRGB to CIE xy
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(color_rgb_tests, test_color_rgb_xy)
#else
static void test_color_rgb_xy(void)
#endif
{
test_color_rgb_xy_unit(0, 0, 0, 0.0, 0.0, 0);
test_color_rgb_xy_unit(255, 255, 255, 0.323, 0.329, 255);
@@ -62,7 +66,11 @@ static void test_color_rgb_xy(void)
/**
* Unit Test for sRGB to CIE xy
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(color_rgb_tests, test_color_rgb_ascii)
#else
static void test_color_rgb_ascii(void)
#endif
{
unsigned count = color_rgb_count();
zassert_true(count > 0, NULL);
@@ -93,6 +101,9 @@ static void test_color_rgb_ascii(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(color_rgb_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(color_rgb_tests,
@@ -102,3 +113,4 @@ void test_main(void)
ztest_run_test_suite(color_rgb_tests);
}
#endif
+20
View File
@@ -42,7 +42,11 @@ static void test_epoch_conversion_date(
/**
* Unit Test for the epoch
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(days_tests, test_days_epoch_conversion)
#else
static void test_days_epoch_conversion(void)
#endif
{
const uint16_t epoch_year = 2000;
@@ -73,7 +77,11 @@ static void test_days_of_year_to_month_day_date(
/**
* Unit Test for the days and year to month date year
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(days_tests, test_days_of_year_to_md)
#else
static void test_days_of_year_to_md(void)
#endif
{
test_days_of_year_to_month_day_date(2029, 145, 5, 25);
test_days_of_year_to_month_day_date(2000, 260, 9, 16);
@@ -101,7 +109,11 @@ static void test_date_is_valid_day(
/**
* Unit Test for the days, checking the date to see if it is a valid date
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(days_tests, test_days_date_is_valid)
#else
static void test_days_date_is_valid(void)
#endif
{
/* first month */
test_date_is_valid_day(0, 1);
@@ -133,7 +145,11 @@ static void test_days_date_is_valid(void)
/**
* Unit Test for days apart, checking the dates to see how many days apart
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(days_tests, test_days_apart)
#else
static void test_days_apart(void)
#endif
{
zassert_equal(days_apart(2000, 1, 1, 2000, 1, 1), 0, NULL);
zassert_equal(days_apart(2000, 1, 1, 2000, 1, 2), 1, NULL);
@@ -148,6 +164,9 @@ static void test_days_apart(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(days_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(days_tests,
@@ -159,3 +178,4 @@ void test_main(void)
ztest_run_test_suite(days_tests);
}
#endif
+8
View File
@@ -20,7 +20,11 @@
/**
* @brief Unit Test for the FIFO buffer
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(fifo_tests, testFIFOBuffer)
#else
static void testFIFOBuffer(void)
#endif
{
/* FIFO data structure */
FIFO_BUFFER test_buffer = { 0 };
@@ -137,6 +141,9 @@ static void testFIFOBuffer(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(fifo_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(fifo_tests,
@@ -145,3 +152,4 @@ void test_main(void)
ztest_run_test_suite(fifo_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(filename_tests, testFilename)
#else
static void testFilename(void)
#endif
{
char *data1 = "c:\\Joshua\\run";
char *data2 = "/home/Anna/run";
@@ -46,6 +50,9 @@ static void testFilename(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(filename_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(filename_tests,
@@ -54,3 +61,4 @@ void test_main(void)
ztest_run_test_suite(filename_tests);
}
#endif
+28
View File
@@ -19,7 +19,11 @@
/**
* @brief Test the FIFO
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeyListFIFO)
#else
static void testKeyListFIFO(void)
#endif
{
OS_Keylist list;
KEY key;
@@ -62,7 +66,11 @@ static void testKeyListFIFO(void)
}
/* test the FILO */
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeyListFILO)
#else
static void testKeyListFILO(void)
#endif
{
OS_Keylist list;
KEY key;
@@ -108,7 +116,11 @@ static void testKeyListFILO(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeyListDataKey)
#else
static void testKeyListDataKey(void)
#endif
{
OS_Keylist list;
KEY key;
@@ -187,7 +199,11 @@ static void testKeyListDataKey(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeyListDataIndex)
#else
static void testKeyListDataIndex(void)
#endif
{
OS_Keylist list;
KEY key;
@@ -256,7 +272,11 @@ static void testKeyListDataIndex(void)
}
/* test access of a lot of entries */
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeyListLarge)
#else
static void testKeyListLarge(void)
#endif
{
int data1 = 42;
int *data;
@@ -286,7 +306,11 @@ static void testKeyListLarge(void)
}
/* test the encode and decode macros */
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeySample)
#else
static void testKeySample(void)
#endif
{
int type, id;
int type_list[] = { 0, 1, KEY_TYPE_MAX / 2, KEY_TYPE_MAX - 1, -1 };
@@ -318,6 +342,9 @@ static void testKeySample(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(keylist_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(keylist_tests,
@@ -331,3 +358,4 @@ void test_main(void)
ztest_run_test_suite(keylist_tests);
}
#endif
+24
View File
@@ -166,7 +166,11 @@ static void testRingBuf(
/**
* Unit Test for the ring buffer with 16 data elements
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ringbuf_tests, testRingBufSizeSmall)
#else
static void testRingBufSizeSmall(void)
#endif
{
uint8_t data_element[5];
uint8_t data_store[sizeof(data_element) * NEXT_POWER_OF_2(16)];
@@ -178,7 +182,11 @@ static void testRingBufSizeSmall(void)
/**
* Unit Test for the ring buffer with 32 data elements
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ringbuf_tests, testRingBufSizeLarge)
#else
static void testRingBufSizeLarge(void)
#endif
{
uint8_t data_element[16];
uint8_t data_store[sizeof(data_element) * NEXT_POWER_OF_2(99)];
@@ -190,7 +198,11 @@ static void testRingBufSizeLarge(void)
/**
* Unit Test for the ring buffer with 32 data elements
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ringbuf_tests, testRingBufSizeInvalid)
#else
static void testRingBufSizeInvalid(void)
#endif
{
RING_BUFFER test_buffer;
uint8_t data_element[16];
@@ -202,7 +214,11 @@ static void testRingBufSizeInvalid(void)
NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ringbuf_tests, testRingBufPowerOfTwo)
#else
static void testRingBufPowerOfTwo(void)
#endif
{
zassert_equal(NEXT_POWER_OF_2(3), 4, NULL);
zassert_equal(NEXT_POWER_OF_2(100), 128, NULL);
@@ -318,7 +334,11 @@ static bool testRingBufNextElement(
/**
* Unit Test for the ring buffer with 16 data elements
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ringbuf_tests, testRingBufNextElementSizeSmall)
#else
static void testRingBufNextElementSizeSmall(void)
#endif
{
bool status;
uint8_t data_element[5];
@@ -333,6 +353,9 @@ static void testRingBufNextElementSizeSmall(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(ringbuf_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(ringbuf_tests,
@@ -345,3 +368,4 @@ void test_main(void)
ztest_run_test_suite(ringbuf_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(sbuf_tests, testStaticBuffer)
#else
static void testStaticBuffer(void)
#endif
{
STATIC_BUFFER sbuffer;
char *data1 = "Joshua";
@@ -75,6 +79,9 @@ static void testStaticBuffer(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(sbuf_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(sbuf_tests,
@@ -83,3 +90,4 @@ void test_main(void)
ztest_run_test_suite(sbuf_tests);
}
#endif
+16
View File
@@ -204,7 +204,11 @@ static void testCCOVNotifyData(uint8_t invoke_id, BACNET_COV_DATA *data)
testCOVNotifyData(data, &test_data);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(cov_tests, testCOVNotify)
#else
static void testCOVNotify(void)
#endif
{
uint8_t invoke_id = 12;
BACNET_COV_DATA data;
@@ -317,7 +321,11 @@ static void testCOVSubscribePropertyEncoding(
testCOVSubscribePropertyData(data, &test_data);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(cov_tests, testCOVSubscribe)
#else
static void testCOVSubscribe(void)
#endif
{
uint8_t invoke_id = 12;
BACNET_SUBSCRIBE_COV_DATA data;
@@ -334,7 +342,11 @@ static void testCOVSubscribe(void)
testCOVSubscribeEncoding(invoke_id, &data);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(cov_tests, testCOVSubscribeProperty)
#else
static void testCOVSubscribeProperty(void)
#endif
{
uint8_t invoke_id = 12;
BACNET_SUBSCRIBE_COV_DATA data;
@@ -364,6 +376,9 @@ static void testCOVSubscribeProperty(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(cov_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(cov_tests,
@@ -374,3 +389,4 @@ void test_main(void)
ztest_run_test_suite(cov_tests);
}
#endif
+64
View File
@@ -106,7 +106,11 @@ static void test_BVLC_Result_Code(uint16_t result_code)
zassert_equal(result_code, test_result_code, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Result)
#else
static void test_BVLC_Result(void)
#endif
{
uint16_t result_code[] = { BVLC_RESULT_SUCCESSFUL_COMPLETION,
BVLC_RESULT_WRITE_BROADCAST_DISTRIBUTION_TABLE_NAK,
@@ -151,7 +155,11 @@ static void test_BVLC_Original_Unicast_NPDU_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Original_Unicast_NPDU)
#else
static void test_BVLC_Original_Unicast_NPDU(void)
#endif
{
uint8_t npdu[50] = { 0 };
uint16_t npdu_len = 0;
@@ -194,7 +202,11 @@ static void test_BVLC_Original_Broadcast_NPDU_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Original_Broadcast_NPDU)
#else
static void test_BVLC_Original_Broadcast_NPDU(void)
#endif
{
uint8_t npdu[50] = { 0 };
uint16_t npdu_len = 0;
@@ -242,7 +254,11 @@ static void test_BVLC_Forwarded_NPDU_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Forwarded_NPDU)
#else
static void test_BVLC_Forwarded_NPDU(void)
#endif
{
uint8_t npdu[50] = { 0 };
BACNET_IP_ADDRESS bip_address = { 0 };
@@ -285,7 +301,11 @@ static void test_BVLC_Register_Foreign_Device_Message(
zassert_equal(ttl_seconds, test_ttl_seconds, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Register_Foreign_Device)
#else
static void test_BVLC_Register_Foreign_Device(void)
#endif
{
uint16_t ttl_seconds = 0;
@@ -322,7 +342,11 @@ static void test_BVLC_Delete_Foreign_Device_Message(
&fdt_entry->dest_address, &test_fdt_entry.dest_address);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Delete_Foreign_Device)
#else
static void test_BVLC_Delete_Foreign_Device(void)
#endif
{
BACNET_IP_FOREIGN_DEVICE_TABLE_ENTRY fdt_entry = { 0 };
unsigned int i = 0;
@@ -368,7 +392,11 @@ static void test_BVLC_Secure_BVLL_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Secure_BVLL)
#else
static void test_BVLC_Secure_BVLL(void)
#endif
{
uint8_t sbuf[50] = { 0 };
uint16_t sbuf_len = 0;
@@ -383,7 +411,11 @@ static void test_BVLC_Secure_BVLL(void)
test_BVLC_Secure_BVLL_Message(sbuf, sbuf_len);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Read_Broadcast_Distribution_Table_Message)
#else
static void test_BVLC_Read_Broadcast_Distribution_Table_Message(void)
#endif
{
uint8_t pdu[60] = { 0 };
uint8_t message_type = 0;
@@ -428,7 +460,11 @@ static void test_BVLC_Distribute_Broadcast_To_Network_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Distribute_Broadcast_To_Network)
#else
static void test_BVLC_Distribute_Broadcast_To_Network(void)
#endif
{
uint8_t npdu[50] = { 0 };
uint16_t npdu_len = 0;
@@ -443,7 +479,11 @@ static void test_BVLC_Distribute_Broadcast_To_Network(void)
test_BVLC_Distribute_Broadcast_To_Network_Message(npdu, npdu_len);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Broadcast_Distribution_Table_Encode)
#else
static void test_BVLC_Broadcast_Distribution_Table_Encode(void)
#endif
{
uint8_t apdu[480] = { 0 };
uint16_t apdu_len = 0;
@@ -535,7 +575,11 @@ static void test_BVLC_Write_Broadcast_Distribution_Table_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Write_Broadcast_Distribution_Table)
#else
static void test_BVLC_Write_Broadcast_Distribution_Table(void)
#endif
{
uint8_t npdu[480] = { 0 };
uint16_t npdu_len = 0;
@@ -623,7 +667,11 @@ static void test_BVLC_Read_Foreign_Device_Table_Ack_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Read_Foreign_Device_Table_Ack)
#else
static void test_BVLC_Read_Foreign_Device_Table_Ack(void)
#endif
{
uint8_t npdu[480] = { 0 };
uint16_t npdu_len = 0;
@@ -677,7 +725,11 @@ static void test_BVLC_Read_Foreign_Device_Table_Ack(void)
zassert_equal(test_count, 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Address_Copy)
#else
static void test_BVLC_Address_Copy(void)
#endif
{
unsigned int i = 0;
BACNET_IP_ADDRESS src = { 0 };
@@ -712,7 +764,11 @@ static void test_BVLC_Address_Copy(void)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Address_Get_Set)
#else
static void test_BVLC_Address_Get_Set(void)
#endif
{
uint16_t i = 0;
BACNET_ADDRESS bsrc = { 0 };
@@ -817,7 +873,11 @@ static void test_BVLC_Address_Get_Set(void)
zassert_equal(octet3, test_octet3, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_BBMD_Address)
#else
static void test_BVLC_BBMD_Address(void)
#endif
{
uint8_t apdu[480] = { 0 };
int apdu_len = 0;
@@ -851,6 +911,9 @@ static void test_BVLC_BBMD_Address(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bvlc_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bvlc_tests,
@@ -873,3 +936,4 @@ void test_main(void)
ztest_run_test_suite(bvlc_tests);
}
#endif
+8
View File
@@ -21,7 +21,11 @@
/**
* @brief Test CRC8 from Annex G 1.0 of BACnet Standard
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(cobs_tests, test_COBS_Encode_Decode)
#else
static void test_COBS_Encode_Decode(void)
#endif
{
uint8_t buffer[MAX_APDU] = { 0x55, 0xff, 0 };
uint8_t encoded_buffer[COBS_ENCODED_SIZE(MAX_APDU)+
@@ -52,6 +56,9 @@ static void test_COBS_Encode_Decode(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(cobs_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(cobs_tests,
@@ -60,3 +67,4 @@ void test_main(void)
ztest_run_test_suite(cobs_tests);
}
#endif
+20
View File
@@ -20,7 +20,11 @@
/**
* @brief Test CRC8 from Annex G 1.0 of BACnet Standard
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(crc_tests, testCRC8)
#else
static void testCRC8(void)
#endif
{
uint8_t crc = 0xff; /* accumulates the crc value */
uint8_t frame_crc; /* appended to the end of the frame */
@@ -47,7 +51,11 @@ static void testCRC8(void)
/**
* @brief Test CRC8 from Annex G 2.0 of BACnet Standard
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(crc_tests, testCRC16)
#else
static void testCRC16(void)
#endif
{
uint16_t crc = 0xffff;
uint16_t data_crc;
@@ -71,7 +79,11 @@ static void testCRC16(void)
/**
* @brief "Test" to create/log generated CRC8 table
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(crc_tests, testCRC8CreateTable)
#else
static void testCRC8CreateTable(void)
#endif
{
uint8_t crc = 0xff; /* accumulates the crc value */
int i;
@@ -95,7 +107,11 @@ static void testCRC8CreateTable(void)
/**
* @brief "Test" to create/log generated CRC16 table
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(crc_tests, testCRC16CreateTable)
#else
static void testCRC16CreateTable(void)
#endif
{
uint16_t crc;
int i;
@@ -120,6 +136,9 @@ static void testCRC16CreateTable(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(crc_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(crc_tests,
@@ -131,3 +150,4 @@ void test_main(void)
ztest_run_test_suite(crc_tests);
}
#endif
+24
View File
@@ -32,7 +32,11 @@ void bvlc6_maintenance_timer(uint16_t seconds)
* @brief Test datalink
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(datalink_tests, test_datalink_arcnet)
#else
static void test_datalink_arcnet(void)
#endif
{
char *iface = "bla-bla-bla";
char *iface2 = "bla-bla-bla2";
@@ -109,7 +113,11 @@ static void test_datalink_arcnet(void)
datalink_maintenance_timer(42);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(datalink_tests, test_datalink_bip)
#else
static void test_datalink_bip(void)
#endif
{
char *iface = "bla-bla-bla";
char *iface2 = "bla-bla-bla2";
@@ -189,7 +197,11 @@ static void test_datalink_bip(void)
zassert_equal(z_cleanup_mock(), 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(datalink_tests, test_datalink_bip6)
#else
static void test_datalink_bip6(void)
#endif
{
char *iface = "bla-bla-bla";
char *iface2 = "bla-bla-bla2";
@@ -268,7 +280,11 @@ static void test_datalink_bip6(void)
zassert_equal(z_cleanup_mock(), 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(datalink_tests, test_datalink_dlmstp)
#else
static void test_datalink_dlmstp(void)
#endif
{
char *iface = "bla-bla-bla";
char *iface2 = "bla-bla-bla2";
@@ -345,7 +361,11 @@ static void test_datalink_dlmstp(void)
datalink_maintenance_timer(42);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(datalink_tests, )
#else
static void test_datalink_ethernet(void)
#endif
{
char *iface = "bla-bla-bla";
char *iface2 = "bla-bla-bla2";
@@ -427,6 +447,9 @@ static void test_datalink_ethernet(void)
* @}
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(datalink_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(datalink_tests,
@@ -439,3 +462,4 @@ void test_main(void)
ztest_run_test_suite(datalink_tests);
}
#endif
+40
View File
@@ -75,7 +75,11 @@ static void datetime_print(const char *title,
(unsigned int)bdatetime->time.hundredths);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testBACnetDateTimeWildcard)
#else
static void testBACnetDateTimeWildcard(void)
#endif
{
BACNET_DATE_TIME bdatetime;
bool status = false;
@@ -89,7 +93,11 @@ static void testBACnetDateTimeWildcard(void)
zassert_true(status, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testBACnetDateTimeAdd)
#else
static void testBACnetDateTimeAdd(void)
#endif
{
BACNET_DATE_TIME bdatetime, test_bdatetime;
uint32_t minutes = 0;
@@ -154,7 +162,11 @@ static void testBACnetDateTimeSeconds(void)
}
#endif
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testBACnetDate)
#else
static void testBACnetDate(void)
#endif
{
BACNET_DATE bdate1, bdate2;
int diff = 0;
@@ -215,7 +227,11 @@ static void testBACnetDate(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testBACnetTime)
#else
static void testBACnetTime(void)
#endif
{
BACNET_TIME btime1, btime2;
int diff = 0;
@@ -264,7 +280,11 @@ static void testBACnetTime(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testBACnetDateTime)
#else
static void testBACnetDateTime(void)
#endif
{
BACNET_DATE_TIME bdatetime1, bdatetime2;
BACNET_DATE bdate;
@@ -330,7 +350,11 @@ static void testBACnetDateTime(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testWildcardDateTime)
#else
static void testWildcardDateTime(void)
#endif
{
BACNET_DATE_TIME bdatetime1, bdatetime2;
BACNET_DATE bdate;
@@ -414,7 +438,11 @@ static void testDateEpochConversionCompare(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testDateEpochConversion)
#else
static void testDateEpochConversion(void)
#endif
{
/* min */
testDateEpochConversionCompare(
@@ -457,7 +485,11 @@ static void testDateEpoch(void)
}
#endif
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testBACnetDayOfWeek)
#else
static void testBACnetDayOfWeek(void)
#endif
{
uint8_t dow = 0;
@@ -485,7 +517,11 @@ static void testBACnetDayOfWeek(void)
zassert_equal(dow, 3, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testDatetimeCodec)
#else
static void testDatetimeCodec(void)
#endif
{
uint8_t apdu[MAX_APDU];
BACNET_DATE_TIME datetimeIn;
@@ -578,6 +614,9 @@ static void testDatetimeConvertUTC(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(wp_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
#if 0
@@ -599,3 +638,4 @@ void test_main(void)
ztest_run_test_suite(wp_tests);
}
#endif
+12
View File
@@ -76,7 +76,11 @@ static void test_DeviceCommunicationControlData(
zassert_true(characterstring_same(&test_password, password), NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(dcc_tests, test_DeviceCommunicationControl)
#else
static void test_DeviceCommunicationControl(void)
#endif
{
uint8_t invoke_id = 128;
uint16_t timeDuration = 0;
@@ -97,7 +101,11 @@ static void test_DeviceCommunicationControl(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(dcc_tests, test_DeviceCommunicationControlMalformedData)
#else
static void test_DeviceCommunicationControlMalformedData(void)
#endif
{
/* payload with enable-disable, and password with wrong characterstring
* length */
@@ -142,6 +150,9 @@ static void test_DeviceCommunicationControlMalformedData(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(dcc_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(dcc_tests,
@@ -151,3 +162,4 @@ void test_main(void)
ztest_run_test_suite(dcc_tests);
}
#endif
+8
View File
@@ -111,7 +111,11 @@ static void verifyBaseEventState(void)
/**
* @brief Test BACnet event handlers
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(event_tests, testEventEventState)
#else
static void testEventEventState(void)
#endif
{
uint8_t buffer[MAX_APDU];
int inLen;
@@ -942,6 +946,9 @@ static void testEventEventState(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(event_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(event_tests,
@@ -950,3 +957,4 @@ void test_main(void)
ztest_run_test_suite(event_tests);
}
#endif
+12
View File
@@ -86,7 +86,11 @@ static int get_alarm_summary_ack_decode_apdu(uint8_t *apdu,
return len;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(getalarm_tests, testGetAlarmSummaryAck)
#else
static void testGetAlarmSummaryAck(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -135,7 +139,11 @@ static void testGetAlarmSummaryAck(void)
zassert_equal(alarm_data.alarmState, test_alarm_data.alarmState, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(getalarm_tests, testGetAlarmSummary)
#else
static void testGetAlarmSummary(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -158,6 +166,9 @@ static void testGetAlarmSummary(void)
/**
* Main entry point for testing
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(getalarm_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(getalarm_tests,
@@ -167,3 +178,4 @@ void test_main(void)
ztest_run_test_suite(getalarm_tests);
}
#endif
+12
View File
@@ -72,7 +72,11 @@ static int getevent_ack_decode_apdu(uint8_t *apdu,
return len;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(getevent_tests, testGetEventInformationAck)
#else
static void testGetEventInformationAck(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -139,7 +143,11 @@ static void testGetEventInformationAck(void)
zassert_equal(event_data.eventState, test_event_data.eventState, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(getevent_tests, testGetEventInformation)
#else
static void testGetEventInformation(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -174,6 +182,9 @@ static void testGetEventInformation(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(getevent_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(getevent_tests,
@@ -183,3 +194,4 @@ void test_main(void)
ztest_run_test_suite(getevent_tests);
}
#endif
+8
View File
@@ -41,7 +41,11 @@ static int iam_decode_apdu(uint8_t *apdu,
return apdu_len;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(iam_tests, testIAm)
#else
static void testIAm(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -72,6 +76,9 @@ static void testIAm(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(iam_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(iam_tests,
@@ -80,3 +87,4 @@ void test_main(void)
ztest_run_test_suite(iam_tests);
}
#endif
+8
View File
@@ -40,7 +40,11 @@ static void testIHaveData(BACNET_I_HAVE_DATA *data)
characterstring_same(&test_data.object_name, &data->object_name), NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ihave_tests, testIHave)
#else
static void testIHave(void)
#endif
{
BACNET_I_HAVE_DATA data;
@@ -65,6 +69,9 @@ static void testIHave(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(ihave_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(ihave_tests,
@@ -73,3 +80,4 @@ void test_main(void)
ztest_run_test_suite(ihave_tests);
}
#endif
+8
View File
@@ -22,7 +22,11 @@
static INDTEXT_DATA data_list[] = { { 1, "Joshua" }, { 2, "Mary" },
{ 3, "Anna" }, { 4, "Christopher" }, { 5, "Patricia" }, { 0, NULL } };
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(indtext_tests, testIndexText)
#else
static void testIndexText(void)
#endif
{
unsigned i; /*counter */
const char *pString;
@@ -60,6 +64,9 @@ static void testIndexText(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(indtext_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(indtext_tests,
@@ -68,3 +75,4 @@ void test_main(void)
ztest_run_test_suite(indtext_tests);
}
#endif
+16
View File
@@ -42,7 +42,11 @@ static void testBACnetLightingCommand(BACNET_LIGHTING_COMMAND *data)
status = lighting_command_same(&test_data, data);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lighting_tests, testBACnetLightingCommandAll)
#else
static void testBACnetLightingCommandAll(void)
#endif
{
BACNET_LIGHTING_COMMAND data;
@@ -97,7 +101,11 @@ static void testBACnetColorCommand(BACNET_COLOR_COMMAND *data)
status = color_command_same(&test_data, data);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lighting_tests, testBACnetColorCommandAll)
#else
static void testBACnetColorCommandAll(void)
#endif
{
BACNET_COLOR_COMMAND data = { 0 };
@@ -111,7 +119,11 @@ static void testBACnetColorCommandAll(void)
testBACnetColorCommand(&data);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lighting_tests, testBACnetXYColor)
#else
static void testBACnetXYColor(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
BACNET_XY_COLOR value = { 0 };
@@ -141,6 +153,9 @@ static void testBACnetXYColor(void)
zassert_true(status, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(lighting_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(lighting_tests,
@@ -151,3 +166,4 @@ void test_main(void)
ztest_run_test_suite(lighting_tests);
}
#endif
+12
View File
@@ -10,7 +10,11 @@
#include <bacnet/bacdest.h>
#include <bacnet/list_element.h>
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(list_element_tests, test_ListElement)
#else
static void test_ListElement(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
BACNET_LIST_ELEMENT_DATA list_element = { 0 }, test_list_element = { 0 };
@@ -58,7 +62,11 @@ static void test_ListElement(void)
zassert_equal(test_application_data_len, 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(list_element_tests, test_ListElementError)
#else
static void test_ListElementError(void)
#endif
{
uint8_t apdu[MAX_APDU] = { 0 };
BACNET_LIST_ELEMENT_DATA list_element = { 0 }, test_list_element = { 0 };
@@ -80,6 +88,9 @@ static void test_ListElementError(void)
list_element.first_failed_element_number, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(list_element_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(list_element_tests, ztest_unit_test(test_ListElement),
@@ -87,3 +98,4 @@ void test_main(void)
ztest_run_test_suite(list_element_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(lso_tests, testLSO)
#else
static void testLSO(void)
#endif
{
uint8_t apdu[1000];
int len;
@@ -54,6 +58,9 @@ static void testLSO(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(lso_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(lso_tests,
@@ -62,3 +69,4 @@ void test_main(void)
ztest_run_test_suite(lso_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(memcopy_tests, test_memcopy)
#else
static void test_memcopy(void)
#endif
{
char *data1 = "Joshua";
char *data2 = "Anna";
@@ -41,6 +45,9 @@ static void test_memcopy(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(memcopy_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(memcopy_tests,
@@ -49,3 +56,4 @@ void test_main(void)
ztest_run_test_suite(memcopy_tests);
}
#endif
+16
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(npdu_tests, test_NPDU_Network)
#else
static void test_NPDU_Network(void)
#endif
{
uint8_t pdu[480] = { 0 };
BACNET_ADDRESS dest = { 0 };
@@ -54,7 +58,11 @@ static void test_NPDU_Network(void)
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(npdu_tests, testNPDU2)
#else
static void testNPDU2(void)
#endif
{
uint8_t pdu[480] = { 0 };
BACNET_ADDRESS dest = { 0 };
@@ -118,7 +126,11 @@ static void testNPDU2(void)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(npdu_tests, testNPDU1)
#else
static void testNPDU1(void)
#endif
{
uint8_t pdu[480] = { 0 };
BACNET_ADDRESS dest = { 0 };
@@ -177,6 +189,9 @@ static void testNPDU1(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(npdu_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(npdu_tests,
@@ -187,3 +202,4 @@ void test_main(void)
ztest_run_test_suite(npdu_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(property_tests, testPropList)
#else
void testPropList(void)
#endif
{
unsigned i = 0, j = 0;
unsigned count = 0;
@@ -67,6 +71,9 @@ void testPropList(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(property_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(property_tests,
@@ -75,3 +82,4 @@ void test_main(void)
ztest_run_test_suite(property_tests);
}
#endif
+20
View File
@@ -127,7 +127,11 @@ static int ptransfer_error_decode_apdu(uint8_t *apdu,
return len;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ptransfer_tests, test_Private_Transfer_Ack)
#else
static void test_Private_Transfer_Ack(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -172,7 +176,11 @@ static void test_Private_Transfer_Ack(void)
zassert_true(bacapp_same_value(&data_value, &test_data_value), NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ptransfer_tests, test_Private_Transfer_Error)
#else
static void test_Private_Transfer_Error(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -223,7 +231,11 @@ static void test_Private_Transfer_Error(void)
zassert_true(bacapp_same_value(&data_value, &test_data_value), NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ptransfer_tests, test_Private_Transfer_Request)
#else
static void test_Private_Transfer_Request(void)
#endif
{
uint8_t apdu[480] = { 0 };
uint8_t test_value[480] = { 0 };
@@ -267,7 +279,11 @@ static void test_Private_Transfer_Request(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ptransfer_tests, test_Unconfirmed_Private_Transfer_Request)
#else
static void test_Unconfirmed_Private_Transfer_Request(void)
#endif
{
uint8_t apdu[480] = { 0 };
uint8_t test_value[480] = { 0 };
@@ -313,6 +329,9 @@ static void test_Unconfirmed_Private_Transfer_Request(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(ptransfer_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(ptransfer_tests,
@@ -324,3 +343,4 @@ void test_main(void)
ztest_run_test_suite(ptransfer_tests);
}
#endif
+8
View File
@@ -48,7 +48,11 @@ static int rd_decode_apdu(uint8_t *apdu,
return len;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(rd_tests, test_ReinitializeDevice)
#else
static void test_ReinitializeDevice(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -80,6 +84,9 @@ static void test_ReinitializeDevice(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(rd_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(rd_tests,
@@ -88,3 +95,4 @@ void test_main(void)
ztest_run_test_suite(rd_tests);
}
#endif
+12
View File
@@ -42,7 +42,11 @@ static int reject_decode_apdu(uint8_t *apdu,
return len;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(reject_tests, testRejectEncodeDecode)
#else
static void testRejectEncodeDecode(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -92,7 +96,11 @@ static void testRejectEncodeDecode(void)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(reject_tests, testRejectErrorCode)
#else
static void testRejectErrorCode(void)
#endif
{
int i;
BACNET_ERROR_CODE error_code;
@@ -116,6 +124,9 @@ static void testRejectErrorCode(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(reject_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(reject_tests,
@@ -125,3 +136,4 @@ void test_main(void)
ztest_run_test_suite(reject_tests);
}
#endif
+12
View File
@@ -72,7 +72,11 @@ static int rp_ack_decode_apdu(uint8_t *apdu,
return len;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(rp_tests, testReadPropertyAck)
#else
static void testReadPropertyAck(void)
#endif
{
uint8_t apdu[480] = { 0 };
uint8_t apdu2[480] = { 0 };
@@ -120,7 +124,11 @@ static void testReadPropertyAck(void)
zassert_equal(object_instance, rpdata.object_instance, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(rp_tests, testReadProperty)
#else
static void testReadProperty(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -152,6 +160,9 @@ static void testReadProperty(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(rp_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(rp_tests,
@@ -161,3 +172,4 @@ void test_main(void)
ztest_run_test_suite(rp_tests);
}
#endif
+12
View File
@@ -77,7 +77,11 @@ static int rpm_decode_apdu(uint8_t *apdu,
return offset;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(rpm_tests, testReadPropertyMultiple)
#else
static void testReadPropertyMultiple(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -189,7 +193,11 @@ static void testReadPropertyMultiple(void)
zassert_equal(len, service_request_len, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(rpm_tests, testReadPropertyMultipleAck)
#else
static void testReadPropertyMultipleAck(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -399,6 +407,9 @@ static void testReadPropertyMultipleAck(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(rpm_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(rpm_tests,
@@ -408,3 +419,4 @@ void test_main(void)
ztest_run_test_suite(rpm_tests);
}
#endif
+16
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(timestamp_tests, testTimestampSequence)
#else
static void testTimestampSequence(void)
#endif
{
BACNET_TIMESTAMP testTimestampIn;
BACNET_TIMESTAMP testTimestampOut;
@@ -42,7 +46,11 @@ static void testTimestampSequence(void)
testTimestampOut.value.sequenceNum, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(timestamp_tests, testTimestampTime)
#else
static void testTimestampTime(void)
#endif
{
BACNET_TIMESTAMP testTimestampIn;
BACNET_TIMESTAMP testTimestampOut;
@@ -74,7 +82,11 @@ static void testTimestampTime(void)
testTimestampOut.value.time.hundredths, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(timestamp_tests, testTimestampTimeDate)
#else
static void testTimestampTimeDate(void)
#endif
{
BACNET_TIMESTAMP testTimestampIn;
BACNET_TIMESTAMP testTimestampOut;
@@ -131,6 +143,9 @@ static void testTimestampTimeDate(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(timestamp_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(timestamp_tests,
@@ -141,3 +156,4 @@ void test_main(void)
ztest_run_test_suite(timestamp_tests);
}
#endif
+12
View File
@@ -66,7 +66,11 @@ static void testTimeSyncRecipientData(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(timesync_tests, testTimeSyncRecipient)
#else
static void testTimeSyncRecipient(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -186,7 +190,11 @@ static void testTimeSyncData(BACNET_DATE *my_date, BACNET_TIME *my_time)
zassert_equal(datetime_compare_date(my_date, &test_date), 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(timesync_tests, testTimeSync)
#else
static void testTimeSync(void)
#endif
{
BACNET_DATE bdate;
BACNET_TIME btime;
@@ -208,6 +216,9 @@ static void testTimeSync(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(timesync_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(timesync_tests,
@@ -217,3 +228,4 @@ void test_main(void)
ztest_run_test_suite(timesync_tests);
}
#endif
+10 -1
View File
@@ -29,7 +29,11 @@
/**
* @brief Test encode/decode API
*/
static void test_BACnetWeeklySchedule()
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(BACnetWeeklySchedule_tests, test_BACnetWeeklySchedule)
#else
static void test_BACnetWeeklySchedule(void)
#endif
{
int len, apdu_len;
uint8_t apdu[MAX_APDU] = { 0 };
@@ -93,6 +97,10 @@ static void test_BACnetWeeklySchedule()
/**
* @}
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(BACnetWeeklySchedule_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(BACnetWeeklySchedule_tests,
@@ -101,3 +109,4 @@ void test_main(void)
ztest_run_test_suite(BACnetWeeklySchedule_tests);
}
#endif
+8
View File
@@ -70,7 +70,11 @@ static void testWhoHasData(BACNET_WHO_HAS_DATA *data)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(whohas_tests, testWhoHas)
#else
static void testWhoHas(void)
#endif
{
BACNET_WHO_HAS_DATA data;
@@ -106,6 +110,9 @@ static void testWhoHas(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(whohas_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(whohas_tests,
@@ -114,3 +121,4 @@ void test_main(void)
ztest_run_test_suite(whohas_tests);
}
#endif
+8
View File
@@ -45,7 +45,11 @@ static int whois_decode_apdu(
return len;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(whois_tests, testWhoIs)
#else
static void testWhoIs(void)
#endif
{
uint8_t apdu[480] = { 0 };
int len = 0;
@@ -104,6 +108,9 @@ static void testWhoIs(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(whois_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(whois_tests,
@@ -112,3 +119,4 @@ void test_main(void)
ztest_run_test_suite(whois_tests);
}
#endif
+8
View File
@@ -123,7 +123,11 @@ static void testWritePropertyTag(BACNET_APPLICATION_DATA_VALUE *value)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testWriteProperty)
#else
static void testWriteProperty(void)
#endif
{
BACNET_APPLICATION_DATA_VALUE value;
@@ -203,6 +207,9 @@ static void testWriteProperty(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(wp_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(wp_tests,
@@ -211,3 +218,4 @@ void test_main(void)
ztest_run_test_suite(wp_tests);
}
#endif
+8
View File
@@ -39,7 +39,11 @@ static int wpm_decode_apdu(uint8_t *apdu, unsigned apdu_len, uint8_t *invoke_id)
return len;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(wp_tests, testWritePropertyMultiple)
#else
static void testWritePropertyMultiple(void)
#endif
{
BACNET_WRITE_ACCESS_DATA write_access_data[3] = { 0 };
BACNET_WRITE_ACCESS_DATA test_write_access_data[3] = { 0 };
@@ -145,9 +149,13 @@ static void testWritePropertyMultiple(void)
* @}
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(wp_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(wp_tests, ztest_unit_test(testWritePropertyMultiple));
ztest_run_test_suite(wp_tests);
}
#endif