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
+67 -34
View File
@@ -91,38 +91,52 @@ static void test_BACnetSpecialEvent_CalendarRef(void)
zassert_equal(len, apdu_len, NULL);
zassert_equal(in.periodTag, out.periodTag, NULL);
zassert_equal(in.period.calendarReference.instance,
zassert_equal(
in.period.calendarReference.instance,
out.period.calendarReference.instance, NULL);
zassert_equal(in.period.calendarReference.type,
out.period.calendarReference.type, NULL);
zassert_equal(
in.period.calendarReference.type, out.period.calendarReference.type,
NULL);
zassert_equal(in.timeValues.TV_Count, out.timeValues.TV_Count, NULL);
zassert_equal(in.timeValues.Time_Values[0].Time.hour,
zassert_equal(
in.timeValues.Time_Values[0].Time.hour,
out.timeValues.Time_Values[0].Time.hour, NULL);
zassert_equal(in.timeValues.Time_Values[0].Time.min,
zassert_equal(
in.timeValues.Time_Values[0].Time.min,
out.timeValues.Time_Values[0].Time.min, NULL);
zassert_equal(in.timeValues.Time_Values[0].Time.sec,
zassert_equal(
in.timeValues.Time_Values[0].Time.sec,
out.timeValues.Time_Values[0].Time.sec, NULL);
zassert_equal(in.timeValues.Time_Values[0].Time.hundredths,
zassert_equal(
in.timeValues.Time_Values[0].Time.hundredths,
out.timeValues.Time_Values[0].Time.hundredths, NULL);
zassert_equal(in.timeValues.Time_Values[0].Value.tag,
zassert_equal(
in.timeValues.Time_Values[0].Value.tag,
out.timeValues.Time_Values[0].Value.tag, NULL);
zassert_equal(in.timeValues.Time_Values[0].Value.type.Unsigned_Int,
zassert_equal(
in.timeValues.Time_Values[0].Value.type.Unsigned_Int,
out.timeValues.Time_Values[0].Value.type.Unsigned_Int, NULL);
zassert_equal(in.timeValues.Time_Values[1].Time.hour,
zassert_equal(
in.timeValues.Time_Values[1].Time.hour,
out.timeValues.Time_Values[1].Time.hour, NULL);
zassert_equal(in.timeValues.Time_Values[1].Time.min,
zassert_equal(
in.timeValues.Time_Values[1].Time.min,
out.timeValues.Time_Values[1].Time.min, NULL);
zassert_equal(in.timeValues.Time_Values[1].Time.sec,
zassert_equal(
in.timeValues.Time_Values[1].Time.sec,
out.timeValues.Time_Values[1].Time.sec, NULL);
zassert_equal(in.timeValues.Time_Values[1].Time.hundredths,
zassert_equal(
in.timeValues.Time_Values[1].Time.hundredths,
out.timeValues.Time_Values[1].Time.hundredths, NULL);
zassert_equal(in.timeValues.Time_Values[1].Value.tag,
zassert_equal(
in.timeValues.Time_Values[1].Value.tag,
out.timeValues.Time_Values[1].Value.tag, NULL);
zassert_equal(in.timeValues.Time_Values[1].Value.type.Unsigned_Int,
zassert_equal(
in.timeValues.Time_Values[1].Value.type.Unsigned_Int,
out.timeValues.Time_Values[1].Value.type.Unsigned_Int, NULL);
zassert_equal(in.priority, out.priority, NULL);
@@ -172,13 +186,17 @@ static void test_BACnetSpecialEvent_Date(void)
zassert_equal(in.periodTag, out.periodTag, NULL);
zassert_equal(
in.period.calendarEntry.tag, out.period.calendarEntry.tag, NULL);
zassert_equal(in.period.calendarEntry.type.Date.wday,
zassert_equal(
in.period.calendarEntry.type.Date.wday,
out.period.calendarEntry.type.Date.wday, NULL);
zassert_equal(in.period.calendarEntry.type.Date.year,
zassert_equal(
in.period.calendarEntry.type.Date.year,
out.period.calendarEntry.type.Date.year, NULL);
zassert_equal(in.period.calendarEntry.type.Date.month,
zassert_equal(
in.period.calendarEntry.type.Date.month,
out.period.calendarEntry.type.Date.month, NULL);
zassert_equal(in.period.calendarEntry.type.Date.day,
zassert_equal(
in.period.calendarEntry.type.Date.day,
out.period.calendarEntry.type.Date.day, NULL);
zassert_equal(in.timeValues.TV_Count, out.timeValues.TV_Count, NULL);
@@ -239,22 +257,30 @@ static void test_BACnetSpecialEvent_DateRange(void)
zassert_equal(
in.period.calendarEntry.tag, out.period.calendarEntry.tag, NULL);
zassert_equal(in.period.calendarEntry.type.DateRange.startdate.wday,
zassert_equal(
in.period.calendarEntry.type.DateRange.startdate.wday,
out.period.calendarEntry.type.DateRange.startdate.wday, NULL);
zassert_equal(in.period.calendarEntry.type.DateRange.startdate.year,
zassert_equal(
in.period.calendarEntry.type.DateRange.startdate.year,
out.period.calendarEntry.type.DateRange.startdate.year, NULL);
zassert_equal(in.period.calendarEntry.type.DateRange.startdate.month,
zassert_equal(
in.period.calendarEntry.type.DateRange.startdate.month,
out.period.calendarEntry.type.DateRange.startdate.month, NULL);
zassert_equal(in.period.calendarEntry.type.DateRange.startdate.day,
zassert_equal(
in.period.calendarEntry.type.DateRange.startdate.day,
out.period.calendarEntry.type.DateRange.startdate.day, NULL);
zassert_equal(in.period.calendarEntry.type.DateRange.enddate.wday,
zassert_equal(
in.period.calendarEntry.type.DateRange.enddate.wday,
out.period.calendarEntry.type.DateRange.enddate.wday, NULL);
zassert_equal(in.period.calendarEntry.type.DateRange.enddate.year,
zassert_equal(
in.period.calendarEntry.type.DateRange.enddate.year,
out.period.calendarEntry.type.DateRange.enddate.year, NULL);
zassert_equal(in.period.calendarEntry.type.DateRange.enddate.month,
zassert_equal(
in.period.calendarEntry.type.DateRange.enddate.month,
out.period.calendarEntry.type.DateRange.enddate.month, NULL);
zassert_equal(in.period.calendarEntry.type.DateRange.enddate.day,
zassert_equal(
in.period.calendarEntry.type.DateRange.enddate.day,
out.period.calendarEntry.type.DateRange.enddate.day, NULL);
zassert_equal(in.timeValues.TV_Count, out.timeValues.TV_Count, NULL);
@@ -305,11 +331,14 @@ static void test_BACnetSpecialEvent_WeekNDate(void)
zassert_equal(
in.period.calendarEntry.tag, out.period.calendarEntry.tag, NULL);
zassert_equal(in.period.calendarEntry.type.WeekNDay.month,
zassert_equal(
in.period.calendarEntry.type.WeekNDay.month,
out.period.calendarEntry.type.WeekNDay.month, NULL);
zassert_equal(in.period.calendarEntry.type.WeekNDay.dayofweek,
zassert_equal(
in.period.calendarEntry.type.WeekNDay.dayofweek,
out.period.calendarEntry.type.WeekNDay.dayofweek, NULL);
zassert_equal(in.period.calendarEntry.type.WeekNDay.weekofmonth,
zassert_equal(
in.period.calendarEntry.type.WeekNDay.weekofmonth,
out.period.calendarEntry.type.WeekNDay.weekofmonth, NULL);
zassert_equal(in.timeValues.TV_Count, out.timeValues.TV_Count, NULL);
@@ -325,8 +354,10 @@ static void test_BACnetSpecialEvent_DecodeRealAPDU(void)
{
int len, apdu_len;
BACNET_SPECIAL_EVENT out = { 0 };
uint8_t sample[18] = { 0x0e, 0x0c, 0xff, 0x0a, 0x1c, 0xff, 0x0f, 0x2e, 0xb4,
0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x2f, 0x39, 0x10 };
uint8_t sample[18] = {
0x0e, 0x0c, 0xff, 0x0a, 0x1c, 0xff, 0x0f, 0x2e, 0xb4,
0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x2f, 0x39, 0x10
};
apdu_len = bacnet_special_event_decode(sample, sizeof(sample), &out);
zassert_equal(sizeof(sample), apdu_len, NULL);
@@ -348,7 +379,8 @@ static void test_BACnetSpecialEvent_DecodeRealAPDU(void)
zassert_equal(out.timeValues.Time_Values[0].Time.sec, 0, NULL);
zassert_equal(out.timeValues.Time_Values[0].Time.hundredths, 0, NULL);
zassert_equal(out.timeValues.Time_Values[0].Value.tag,
zassert_equal(
out.timeValues.Time_Values[0].Value.tag,
BACNET_APPLICATION_TAG_ENUMERATED, NULL);
zassert_equal(
out.timeValues.Time_Values[0].Value.type.Unsigned_Int, 0, NULL);
@@ -365,7 +397,8 @@ ZTEST_SUITE(BACnetSpecialEvent_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(BACnetSpecialEvent_tests,
ztest_test_suite(
BACnetSpecialEvent_tests,
ztest_unit_test(test_BACnetSpecialEvent_CalendarRef),
ztest_unit_test(test_BACnetSpecialEvent_Date),
ztest_unit_test(test_BACnetSpecialEvent_DateRange),