Added AlignAfterOpenBracket: AlwaysBreak and BinPackArguments: true to clang-format. Updated test/bacnet c/h files with updated format.

This commit is contained in:
Steve Karg
2024-04-24 09:38:12 -05:00
parent 1aaebe9414
commit 70c54817fd
120 changed files with 2182 additions and 1894 deletions
+22 -19
View File
@@ -29,7 +29,7 @@ static void testLightingOutput(void)
uint8_t apdu[MAX_APDU] = { 0 };
int len = 0, test_len = 0;
BACNET_READ_PROPERTY_DATA rpdata;
BACNET_APPLICATION_DATA_VALUE value = {0};
BACNET_APPLICATION_DATA_VALUE value = { 0 };
const int *pRequired = NULL;
const int *pOptional = NULL;
const int *pProprietary = NULL;
@@ -57,15 +57,18 @@ static void testLightingOutput(void)
rpdata.object_property = *pRequired;
rpdata.array_index = BACNET_ARRAY_ALL;
len = Lighting_Output_Read_Property(&rpdata);
zassert_not_equal(len, BACNET_STATUS_ERROR,
zassert_not_equal(
len, BACNET_STATUS_ERROR,
"property '%s': failed to ReadProperty!\n",
bactext_property_name(rpdata.object_property));
if (len >= 0) {
test_len = bacapp_decode_known_property(rpdata.application_data,
len, &value, rpdata.object_type, rpdata.object_property);
test_len = bacapp_decode_known_property(
rpdata.application_data, len, &value, rpdata.object_type,
rpdata.object_property);
if (rpdata.object_property != PROP_PRIORITY_ARRAY) {
zassert_equal(len, test_len, "property '%s': failed to decode!\n",
bactext_property_name(rpdata.object_property));
zassert_equal(
len, test_len, "property '%s': failed to decode!\n",
bactext_property_name(rpdata.object_property));
}
/* check WriteProperty properties */
wpdata.object_type = rpdata.object_type;
@@ -78,8 +81,8 @@ static void testLightingOutput(void)
status = Lighting_Output_Write_Property(&wpdata);
if (!status) {
/* verify WriteProperty property is known */
zassert_not_equal(wpdata.error_code,
ERROR_CODE_UNKNOWN_PROPERTY,
zassert_not_equal(
wpdata.error_code, ERROR_CODE_UNKNOWN_PROPERTY,
"property '%s': WriteProperty Unknown!\n",
bactext_property_name(rpdata.object_property));
}
@@ -90,14 +93,17 @@ static void testLightingOutput(void)
rpdata.object_property = *pOptional;
rpdata.array_index = BACNET_ARRAY_ALL;
len = Lighting_Output_Read_Property(&rpdata);
zassert_not_equal(len, BACNET_STATUS_ERROR,
zassert_not_equal(
len, BACNET_STATUS_ERROR,
"property '%s': failed to ReadProperty!\n",
bactext_property_name(rpdata.object_property));
if (len > 0) {
test_len = bacapp_decode_application_data(rpdata.application_data,
(uint8_t)rpdata.application_data_len, &value);
zassert_equal(len, test_len, "property '%s': failed to decode!\n",
bactext_property_name(rpdata.object_property));
test_len = bacapp_decode_application_data(
rpdata.application_data, (uint8_t)rpdata.application_data_len,
&value);
zassert_equal(
len, test_len, "property '%s': failed to decode!\n",
bactext_property_name(rpdata.object_property));
/* check WriteProperty properties */
wpdata.object_type = rpdata.object_type;
wpdata.object_instance = rpdata.object_instance;
@@ -109,8 +115,8 @@ static void testLightingOutput(void)
status = Lighting_Output_Write_Property(&wpdata);
if (!status) {
/* verify WriteProperty property is known */
zassert_not_equal(wpdata.error_code,
ERROR_CODE_UNKNOWN_PROPERTY,
zassert_not_equal(
wpdata.error_code, ERROR_CODE_UNKNOWN_PROPERTY,
"property '%s': WriteProperty Unknown!\n",
bactext_property_name(rpdata.object_property));
}
@@ -135,15 +141,12 @@ 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,
ztest_unit_test(testLightingOutput)
);
ztest_test_suite(lo_tests, ztest_unit_test(testLightingOutput));
ztest_run_test_suite(lo_tests);
}