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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user