This is an automated email from the ASF dual-hosted git repository.
sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new be7daab87 nimble/ll: Format tests coding style
be7daab87 is described below
commit be7daab87ee9cb5b2e3d801802273459d699869d
Author: Szymon Janc <[email protected]>
AuthorDate: Thu Oct 8 13:56:28 2026 +0200
nimble/ll: Format tests coding style
Format it with clang-format so that CI is not complaining when
test are modified.
No functional changes in tests.
---
nimble/controller/test/src/ble_ll_crypto_test.c | 101 ++++-------
nimble/controller/test/src/ble_ll_csa2_test.c | 90 +++++----
nimble/controller/test/src/ble_ll_iso.c | 26 +--
nimble/controller/test/src/ble_ll_isoal.c | 232 ++++++++++++++----------
4 files changed, 248 insertions(+), 201 deletions(-)
diff --git a/nimble/controller/test/src/ble_ll_crypto_test.c
b/nimble/controller/test/src/ble_ll_crypto_test.c
index a2e727a07..154375d3d 100644
--- a/nimble/controller/test/src/ble_ll_crypto_test.c
+++ b/nimble/controller/test/src/ble_ll_crypto_test.c
@@ -21,16 +21,13 @@
#include <controller/ble_ll_crypto.h>
#include <testutil/testutil.h>
-TEST_CASE_SELF(ble_ll_crypto_test_h6) {
- const uint8_t w[] = {
- 0xec, 0x02, 0x34, 0xa3, 0x57, 0xc8, 0xad, 0x05,
- 0x34, 0x10, 0x10, 0xa6, 0x0a, 0x39, 0x7d, 0x9b
- };
+TEST_CASE_SELF(ble_ll_crypto_test_h6)
+{
+ const uint8_t w[] = { 0xec, 0x02, 0x34, 0xa3, 0x57, 0xc8, 0xad, 0x05,
+ 0x34, 0x10, 0x10, 0xa6, 0x0a, 0x39, 0x7d, 0x9b };
const uint8_t key_id[] = { 0x6c, 0x65, 0x62, 0x72 };
- const uint8_t ok[] = {
- 0x2d, 0x9a, 0xe1, 0x02, 0xe7, 0x6d, 0xc9, 0x1c,
- 0xe8, 0xd3, 0xa9, 0xe2, 0x80, 0xb1, 0x63, 0x99
- };
+ const uint8_t ok[] = { 0x2d, 0x9a, 0xe1, 0x02, 0xe7, 0x6d, 0xc9, 0x1c,
+ 0xe8, 0xd3, 0xa9, 0xe2, 0x80, 0xb1, 0x63, 0x99 };
uint8_t out[16];
int rc;
@@ -41,19 +38,14 @@ TEST_CASE_SELF(ble_ll_crypto_test_h6) {
TEST_ASSERT(rc == 0);
}
-TEST_CASE_SELF(ble_ll_crypto_test_h7) {
- const uint8_t salt[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x74, 0x6D, 0x70, 0x31
- };
- const uint8_t w[] = {
- 0xec, 0x02, 0x34, 0xa3, 0x57, 0xc8, 0xad, 0x05,
- 0x34, 0x10, 0x10, 0xa6, 0x0a, 0x39, 0x7d, 0x9b
- };
- const uint8_t ok[] = {
- 0xfb, 0x17, 0x35, 0x97, 0xc6, 0xa3, 0xc0, 0xec,
- 0xd2, 0x99, 0x8c, 0x2a, 0x75, 0xa5, 0x70, 0x11
- };
+TEST_CASE_SELF(ble_ll_crypto_test_h7)
+{
+ const uint8_t salt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x74, 0x6D, 0x70, 0x31 };
+ const uint8_t w[] = { 0xec, 0x02, 0x34, 0xa3, 0x57, 0xc8, 0xad, 0x05,
+ 0x34, 0x10, 0x10, 0xa6, 0x0a, 0x39, 0x7d, 0x9b };
+ const uint8_t ok[] = { 0xfb, 0x17, 0x35, 0x97, 0xc6, 0xa3, 0xc0, 0xec,
+ 0xd2, 0x99, 0x8c, 0x2a, 0x75, 0xa5, 0x70, 0x11 };
uint8_t out[16];
int rc;
@@ -64,20 +56,15 @@ TEST_CASE_SELF(ble_ll_crypto_test_h7) {
TEST_ASSERT(rc == 0);
}
-TEST_CASE_SELF(ble_ll_crypto_test_h8) {
- const uint8_t k[] = {
- 0xec, 0x02, 0x34, 0xa3, 0x57, 0xc8, 0xad, 0x05,
- 0x34, 0x10, 0x10, 0xa6, 0x0a, 0x39, 0x7d, 0x9b
- };
- const uint8_t s[] = {
- 0x15, 0x36, 0xd1, 0x8d, 0xe3, 0xd2, 0x0d, 0xf9,
- 0x9b, 0x70, 0x44, 0xc1, 0x2f, 0x9e, 0xd5, 0xba
- };
+TEST_CASE_SELF(ble_ll_crypto_test_h8)
+{
+ const uint8_t k[] = { 0xec, 0x02, 0x34, 0xa3, 0x57, 0xc8, 0xad, 0x05,
+ 0x34, 0x10, 0x10, 0xa6, 0x0a, 0x39, 0x7d, 0x9b };
+ const uint8_t s[] = { 0x15, 0x36, 0xd1, 0x8d, 0xe3, 0xd2, 0x0d, 0xf9,
+ 0x9b, 0x70, 0x44, 0xc1, 0x2f, 0x9e, 0xd5, 0xba };
const uint8_t key_id[] = { 0xcc, 0x03, 0x01, 0x48 };
- const uint8_t ok[] = {
- 0xe5, 0xe5, 0xbe, 0xba, 0xae, 0x72, 0x28, 0xe7,
- 0x22, 0xa3, 0x89, 0x04, 0xed, 0x35, 0x0f, 0x6d
- };
+ const uint8_t ok[] = { 0xe5, 0xe5, 0xbe, 0xba, 0xae, 0x72, 0x28, 0xe7,
+ 0x22, 0xa3, 0x89, 0x04, 0xed, 0x35, 0x0f, 0x6d };
uint8_t out[16];
int rc;
@@ -88,33 +75,24 @@ TEST_CASE_SELF(ble_ll_crypto_test_h8) {
TEST_ASSERT(rc == 0);
}
-TEST_CASE_SELF(ble_ll_crypto_test_gskd) {
- const uint8_t broadcast_code[] = {
- 0x00, 0x00, 0x00, 0x00, 0x65, 0x73, 0x75, 0x6f,
- 0x48, 0x20, 0x65, 0x6e, 0x72, 0xb8, 0xc3, 0x42
- };
- const uint8_t gskd[] = {
- 0x55, 0x18, 0x8b, 0x3d, 0x32, 0xf6, 0xbb, 0x9a,
- 0x90, 0x0a, 0xfc, 0xfb, 0xee, 0xd4, 0xe7, 0x2a
- };
- const uint8_t big1[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x42, 0x49, 0x47, 0x31
- };
+TEST_CASE_SELF(ble_ll_crypto_test_gskd)
+{
+ const uint8_t broadcast_code[] = { 0x00, 0x00, 0x00, 0x00, 0x65, 0x73,
+ 0x75, 0x6f, 0x48, 0x20, 0x65, 0x6e,
+ 0x72, 0xb8, 0xc3, 0x42 };
+ const uint8_t gskd[] = { 0x55, 0x18, 0x8b, 0x3d, 0x32, 0xf6, 0xbb, 0x9a,
+ 0x90, 0x0a, 0xfc, 0xfb, 0xee, 0xd4, 0xe7, 0x2a };
+ const uint8_t big1[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x42, 0x49, 0x47, 0x31 };
const uint8_t big2[] = { 0x42, 0x49, 0x47, 0x32 };
const uint8_t big3[] = { 0x42, 0x49, 0x47, 0x33 };
- const uint8_t ok_igltk[] = {
- 0x4c, 0x0d, 0xd7, 0x4c, 0x2b, 0x19, 0xaa, 0x95,
- 0xd8, 0x98, 0x23, 0x85, 0x5f, 0x10, 0x01, 0xb8
- };
- const uint8_t ok_gltk[] = {
- 0xc4, 0xcd, 0x4b, 0x83, 0x49, 0xb5, 0xa1, 0x8a,
- 0x02, 0xde, 0x66, 0x20, 0x90, 0x17, 0xae, 0xd3
- };
- const uint8_t ok_gsk[] = {
- 0xbe, 0x2a, 0x16, 0xfc, 0x7a, 0xc4, 0x64, 0xe7,
- 0x52, 0x30, 0x1b, 0xcc, 0xc8, 0x18, 0x81, 0x2c
- };
+ const uint8_t ok_igltk[] = { 0x4c, 0x0d, 0xd7, 0x4c, 0x2b, 0x19,
+ 0xaa, 0x95, 0xd8, 0x98, 0x23, 0x85,
+ 0x5f, 0x10, 0x01, 0xb8 };
+ const uint8_t ok_gltk[] = { 0xc4, 0xcd, 0x4b, 0x83, 0x49, 0xb5, 0xa1, 0x8a,
+ 0x02, 0xde, 0x66, 0x20, 0x90, 0x17, 0xae, 0xd3
};
+ const uint8_t ok_gsk[] = { 0xbe, 0x2a, 0x16, 0xfc, 0x7a, 0xc4, 0x64, 0xe7,
+ 0x52, 0x30, 0x1b, 0xcc, 0xc8, 0x18, 0x81, 0x2c
};
uint8_t igltk[16];
uint8_t gltk[16];
uint8_t gsk[16];
@@ -139,7 +117,8 @@ TEST_CASE_SELF(ble_ll_crypto_test_gskd) {
TEST_ASSERT(rc == 0);
}
-TEST_SUITE(ble_ll_crypto_test_suite) {
+TEST_SUITE(ble_ll_crypto_test_suite)
+{
ble_ll_crypto_test_h6();
ble_ll_crypto_test_h7();
ble_ll_crypto_test_h8();
diff --git a/nimble/controller/test/src/ble_ll_csa2_test.c
b/nimble/controller/test/src/ble_ll_csa2_test.c
index 7939367e5..386675d14 100644
--- a/nimble/controller/test/src/ble_ll_csa2_test.c
+++ b/nimble/controller/test/src/ble_ll_csa2_test.c
@@ -40,8 +40,7 @@ TEST_CASE_SELF(ble_ll_csa2_test_1)
* based on sample data from CoreSpec 5.0 Vol 6 Part C 3.1
* (all channels used)
*/
- conn.channel_id = ((0x8e89bed6 & 0xffff0000) >> 16) ^
- (0x8e89bed6 & 0x0000ffff);
+ conn.channel_id = ((0x8e89bed6 & 0xffff0000) >> 16) ^ (0x8e89bed6 &
0x0000ffff);
conn.chan_map_used = 37;
conn.chan_map[0] = 0xff;
@@ -81,8 +80,7 @@ TEST_CASE_SELF(ble_ll_csa2_test_2)
* based on sample data from CoreSpec 5.0 Vol 6 Part C 3.2
* (9 channels used)
*/
- conn.channel_id = ((0x8e89bed6 & 0xffff0000) >> 16) ^
- (0x8e89bed6 & 0x0000ffff);
+ conn.channel_id = ((0x8e89bed6 & 0xffff0000) >> 16) ^ (0x8e89bed6 &
0x0000ffff);
conn.chan_map_used = 9;
conn.chan_map[0] = 0x00;
@@ -123,82 +121,98 @@ TEST_CASE_SELF(ble_ll_csa2_test_3)
TEST_ASSERT(chan_map_used == 37);
chan_id = 0x305f;
- chan_idx = ble_ll_utils_dci_iso_event(0, chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_event(0, chan_id, &prn_sub_lu,
+ chan_map_used, chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 56857);
TEST_ASSERT(chan_idx == 25);
TEST_ASSERT(remap_idx == 25);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 11710);
TEST_ASSERT(chan_idx == 1);
TEST_ASSERT(remap_idx == 1);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 16649);
TEST_ASSERT(chan_idx == 16);
TEST_ASSERT(remap_idx == 16);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 38198);
TEST_ASSERT(chan_idx == 36);
TEST_ASSERT(remap_idx == 36);
- chan_idx = ble_ll_utils_dci_iso_event(1, chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_event(1, chan_id, &prn_sub_lu,
+ chan_map_used, chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 1685);
TEST_ASSERT(chan_idx == 20);
TEST_ASSERT(remap_idx == 20);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 20925);
TEST_ASSERT(chan_idx == 36);
TEST_ASSERT(remap_idx == 36);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 11081);
TEST_ASSERT(chan_idx == 12);
TEST_ASSERT(remap_idx == 12);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 48920);
TEST_ASSERT(chan_idx == 34);
TEST_ASSERT(remap_idx == 34);
- chan_idx = ble_ll_utils_dci_iso_event(2, chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_event(2, chan_id, &prn_sub_lu,
+ chan_map_used, chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 38301);
TEST_ASSERT(chan_idx == 6);
TEST_ASSERT(remap_idx == 6);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 6541);
TEST_ASSERT(chan_idx == 18);
TEST_ASSERT(remap_idx == 18);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 14597);
TEST_ASSERT(chan_idx == 32);
TEST_ASSERT(remap_idx == 32);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 62982);
TEST_ASSERT(chan_idx == 21);
TEST_ASSERT(remap_idx == 21);
- chan_idx = ble_ll_utils_dci_iso_event(3, chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_event(3, chan_id, &prn_sub_lu,
+ chan_map_used, chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 27475);
TEST_ASSERT(chan_idx == 21);
TEST_ASSERT(remap_idx == 21);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 40400);
TEST_ASSERT(chan_idx == 4);
TEST_ASSERT(remap_idx == 4);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 30015);
TEST_ASSERT(chan_idx == 22);
TEST_ASSERT(remap_idx == 22);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 49818);
TEST_ASSERT(chan_idx == 8);
TEST_ASSERT(remap_idx == 8);
@@ -213,62 +227,74 @@ TEST_CASE_SELF(ble_ll_csa2_test_3)
TEST_ASSERT(chan_map_used == 9);
chan_id = 0x305f;
- chan_idx = ble_ll_utils_dci_iso_event(6, chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_event(6, chan_id, &prn_sub_lu,
+ chan_map_used, chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 10975);
TEST_ASSERT(chan_idx == 23);
TEST_ASSERT(remap_idx == 4);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 14383);
TEST_ASSERT(chan_idx == 35);
TEST_ASSERT(remap_idx == 7);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 28946);
TEST_ASSERT(chan_idx == 21);
TEST_ASSERT(remap_idx == 2);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 61038);
TEST_ASSERT(chan_idx == 36);
TEST_ASSERT(remap_idx == 8);
- chan_idx = ble_ll_utils_dci_iso_event(7, chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_event(7, chan_id, &prn_sub_lu,
+ chan_map_used, chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 5490);
TEST_ASSERT(chan_idx == 9);
TEST_ASSERT(remap_idx == 0);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 4108);
TEST_ASSERT(chan_idx == 22);
TEST_ASSERT(remap_idx == 3);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 45462);
TEST_ASSERT(chan_idx == 36);
TEST_ASSERT(remap_idx == 8);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 64381);
TEST_ASSERT(chan_idx == 33);
TEST_ASSERT(remap_idx == 5);
- chan_idx = ble_ll_utils_dci_iso_event(8, chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_event(8, chan_id, &prn_sub_lu,
+ chan_map_used, chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 46970);
TEST_ASSERT(chan_idx == 34);
TEST_ASSERT(remap_idx == 6);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 7196);
TEST_ASSERT(chan_idx == 9);
TEST_ASSERT(remap_idx == 0);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 33054);
TEST_ASSERT(chan_idx == 33);
TEST_ASSERT(remap_idx == 5);
- chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used, chan_map, &remap_idx);
+ chan_idx = ble_ll_utils_dci_iso_subevent(chan_id, &prn_sub_lu,
chan_map_used,
+ chan_map, &remap_idx);
TEST_ASSERT((prn_sub_lu ^ chan_id) == 42590);
TEST_ASSERT(chan_idx == 10);
TEST_ASSERT(remap_idx == 1);
diff --git a/nimble/controller/test/src/ble_ll_iso.c
b/nimble/controller/test/src/ble_ll_iso.c
index 3b2dc6800..93e511d3c 100644
--- a/nimble/controller/test/src/ble_ll_iso.c
+++ b/nimble/controller/test/src/ble_ll_iso.c
@@ -32,8 +32,8 @@
#define max(a, b) ((a) > (b) ? (a) : (b))
#endif
-#define TSPX_max_tx_nse 3
-#define TSPX_max_tx_payload 32
+#define TSPX_max_tx_nse 3
+#define TSPX_max_tx_payload 32
/* LL.TS.p24 4.11.2 Common Parameters */
struct test_ll_common_params {
@@ -115,12 +115,11 @@ test_ll_iso_teardown(struct test_ll_iso_fixture *fixture)
ble_ll_iso_conn_free(conn);
}
-TEST_CASE_SELF(test_ll_ist_brd_bv_01_c) {
- const uint8_t payload_types[] = {
- BLE_HCI_PAYLOAD_TYPE_ZERO_LENGTH,
- BLE_HCI_PAYLOAD_TYPE_VARIABLE_LENGTH,
- BLE_HCI_PAYLOAD_TYPE_MAXIMUM_LENGTH
- };
+TEST_CASE_SELF(test_ll_ist_brd_bv_01_c)
+{
+ const uint8_t payload_types[] = { BLE_HCI_PAYLOAD_TYPE_ZERO_LENGTH,
+ BLE_HCI_PAYLOAD_TYPE_VARIABLE_LENGTH,
+ BLE_HCI_PAYLOAD_TYPE_MAXIMUM_LENGTH };
const struct test_ll_common_params *params = &test_ll_common_params_bn_1;
struct ble_hci_le_setup_iso_data_path_cp setup_iso_data_path_cp;
struct ble_hci_le_setup_iso_data_path_rp setup_iso_data_path_rp;
@@ -149,7 +148,8 @@ TEST_CASE_SELF(test_ll_ist_brd_bv_01_c) {
rsplen = 0xFF;
iso_transmit_test_cp.conn_handle = htole16(conn->handle);
iso_transmit_test_cp.payload_type = payload_type;
- rc = ble_ll_iso_transmit_test((uint8_t *)&iso_transmit_test_cp,
sizeof(iso_transmit_test_cp),
+ rc = ble_ll_iso_transmit_test((uint8_t *)&iso_transmit_test_cp,
+ sizeof(iso_transmit_test_cp),
(uint8_t *)&iso_transmit_test_rp,
&rsplen);
TEST_ASSERT(rc == 0);
TEST_ASSERT(rsplen == sizeof(iso_transmit_test_rp));
@@ -188,8 +188,9 @@ TEST_CASE_SELF(test_ll_ist_brd_bv_01_c) {
setup_iso_data_path_cp.conn_handle = htole16(conn->handle);
setup_iso_data_path_cp.data_path_dir = 0x00;
setup_iso_data_path_cp.data_path_id = 0x00;
- rc = ble_ll_iso_setup_iso_data_path((uint8_t
*)&setup_iso_data_path_cp, sizeof(setup_iso_data_path_cp),
- (uint8_t
*)&setup_iso_data_path_rp, &rsplen);
+ rc = ble_ll_iso_setup_iso_data_path(
+ (uint8_t *)&setup_iso_data_path_cp, sizeof(setup_iso_data_path_cp),
+ (uint8_t *)&setup_iso_data_path_rp, &rsplen);
TEST_ASSERT(rc == 0x0C);
/* 7. The Upper Tester sends the HCI_LE_ISO_Test_End command to the
IUT and receives an
@@ -211,7 +212,8 @@ TEST_CASE_SELF(test_ll_ist_brd_bv_01_c) {
test_ll_iso_teardown(&fixture);
}
-TEST_SUITE(ble_ll_iso_test_suite) {
+TEST_SUITE(ble_ll_iso_test_suite)
+{
ble_ll_iso_init();
test_ll_ist_brd_bv_01_c();
diff --git a/nimble/controller/test/src/ble_ll_isoal.c
b/nimble/controller/test/src/ble_ll_isoal.c
index 1b548f1bc..c52928c7d 100644
--- a/nimble/controller/test/src/ble_ll_isoal.c
+++ b/nimble/controller/test/src/ble_ll_isoal.c
@@ -87,7 +87,8 @@ test_ll_isoal_teardown(struct test_ll_isoal_fixture *fixture)
"mp_num_free is %d", g_mbuf_mempool.mp_num_free);
}
-TEST_CASE_SELF(test_ble_ll_isoal_mux_init) {
+TEST_CASE_SELF(test_ble_ll_isoal_mux_init)
+{
struct test_ll_isoal_fixture fixture;
struct ble_ll_isoal_mux *mux;
const uint32_t iso_interval_us = 10000;
@@ -103,7 +104,8 @@ TEST_CASE_SELF(test_ble_ll_isoal_mux_init) {
test_ll_isoal_teardown(&fixture);
}
-TEST_CASE_SELF(ble_ll_isoal_mux_pdu_get_unframed_1_sdu_2_pdu) {
+TEST_CASE_SELF(ble_ll_isoal_mux_pdu_get_unframed_1_sdu_2_pdu)
+{
struct test_ll_isoal_fixture fixture;
struct ble_ll_isoal_mux *mux;
struct os_mbuf *sdu_1, *sdu_2;
@@ -178,12 +180,14 @@
TEST_CASE_SELF(ble_ll_isoal_mux_pdu_get_unframed_1_sdu_2_pdu) {
TEST_ASSERT(llid == 0b00, "LLID is incorrect %d", llid);
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt > 0, "num_completed_pkt is incorrect %d",
num_completed_pkt);
+ TEST_ASSERT(num_completed_pkt > 0, "num_completed_pkt is incorrect %d",
+ num_completed_pkt);
test_ll_isoal_teardown(&fixture);
}
-TEST_CASE_SELF(test_ble_ll_isoal_mux_get_unframed_pdu) {
+TEST_CASE_SELF(test_ble_ll_isoal_mux_get_unframed_pdu)
+{
struct test_ll_isoal_fixture fixture;
struct ble_ll_isoal_mux *mux;
struct os_mbuf *sdu_1, *sdu_2;
@@ -264,7 +268,8 @@ TEST_CASE_SELF(test_ble_ll_isoal_mux_get_unframed_pdu) {
test_ll_isoal_teardown(&fixture);
}
-TEST_CASE_SELF(test_ble_ll_isoal_mux_sdu_not_in_event) {
+TEST_CASE_SELF(test_ble_ll_isoal_mux_sdu_not_in_event)
+{
struct test_ll_isoal_fixture fixture;
struct ble_ll_isoal_mux *mux;
struct os_mbuf *sdu_1;
@@ -416,8 +421,8 @@ test_ial_broadcast_single_sdu_bis(const struct
test_ial_broadcast_single_sdu_bis
seg_hdr = get_le16(&pdu[0]);
TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_SC(seg_hdr) == 0, "SC is incorrect %d",
BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
- TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr) == 1, "CMPLT is
incorrect %d",
- BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr));
+ TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr) == 1,
+ "CMPLT is incorrect %d",
BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr));
TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_LEN(seg_hdr) == 3 /* TimeOffset */ +
Max_SDU,
"Length is incorrect %d",
BLE_LL_ISOAL_SEGHDR_LEN(seg_hdr));
timeoffset = get_le24(&pdu[2]);
@@ -431,12 +436,14 @@ test_ial_broadcast_single_sdu_bis(const struct
test_ial_broadcast_single_sdu_bis
}
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt > 0, "num_completed_pkt is incorrect %d",
num_completed_pkt);
+ TEST_ASSERT(num_completed_pkt > 0, "num_completed_pkt is incorrect %d",
+ num_completed_pkt);
test_ll_isoal_teardown(&fixture);
}
-TEST_CASE_SELF(test_ial_bis_unf_brd_bv_01_c) {
+TEST_CASE_SELF(test_ial_bis_unf_brd_bv_01_c)
+{
const struct test_ial_broadcast_single_sdu_bis_cfg cfg = {
.NSE = 2,
.Framed = 0,
@@ -451,7 +458,8 @@ TEST_CASE_SELF(test_ial_bis_unf_brd_bv_01_c) {
test_ial_broadcast_single_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_unf_brd_bv_02_c) {
+TEST_CASE_SELF(test_ial_bis_unf_brd_bv_02_c)
+{
const struct test_ial_broadcast_single_sdu_bis_cfg cfg = {
.NSE = 4,
.Framed = 0,
@@ -466,7 +474,8 @@ TEST_CASE_SELF(test_ial_bis_unf_brd_bv_02_c) {
test_ial_broadcast_single_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_06_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_06_c)
+{
const struct test_ial_broadcast_single_sdu_bis_cfg cfg = {
.NSE = 4,
.Framed = 1,
@@ -481,7 +490,8 @@ TEST_CASE_SELF(test_ial_bis_fra_brd_bv_06_c) {
test_ial_broadcast_single_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_08_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_08_c)
+{
const struct test_ial_broadcast_single_sdu_bis_cfg cfg = {
.NSE = 2,
.Framed = 1,
@@ -496,7 +506,8 @@ TEST_CASE_SELF(test_ial_bis_fra_brd_bv_08_c) {
test_ial_broadcast_single_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_29_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_29_c)
+{
const struct test_ial_broadcast_single_sdu_bis_cfg cfg = {
.NSE = 6,
.Framed = 1,
@@ -528,8 +539,8 @@ static void
test_ial_broadcast_large_sdu_bis(const struct
test_ial_broadcast_large_sdu_bis_cfg *cfg)
{
const struct test_ial_broadcast_large_sdu_bis_round rounds[] = {
- {.sdu_len = 495, .sc_packets_num = 1},
- {.sdu_len = 503, .sc_packets_num = 2},
+ { .sdu_len = 495, .sc_packets_num = 1 },
+ { .sdu_len = 503, .sc_packets_num = 2 },
};
struct test_ll_isoal_fixture fixture;
struct ble_ll_isoal_mux *mux;
@@ -567,8 +578,8 @@ test_ial_broadcast_large_sdu_bis(const struct
test_ial_broadcast_large_sdu_bis_c
pdu_len = ble_ll_isoal_mux_pdu_get(mux, idx, &llid, pdu);
if (pdu_len == 0) {
TEST_ASSERT_FATAL(sdu_offset == rounds[round].sdu_len,
- "Round #%d: idx %d sdu_offset %d",
- round, idx, sdu_offset);
+ "Round #%d: idx %d sdu_offset %d", round,
+ idx, sdu_offset);
continue;
}
@@ -579,31 +590,34 @@ test_ial_broadcast_large_sdu_bis(const struct
test_ial_broadcast_large_sdu_bis_c
* bytes offset in step 1.
*/
if (sc_packets_num < rounds[round].sc_packets_num) {
- TEST_ASSERT_FATAL(pdu_len == 251, "Round #%d: idx #%d: Length
is incorrect %d",
+ TEST_ASSERT_FATAL(pdu_len == 251,
+ "Round #%d: idx #%d: Length is incorrect %d",
round, idx, pdu_len);
if (cfg->Framed) {
- TEST_ASSERT_FATAL(llid == 0b10, "Round #%d: LLID is
incorrect %d", round, llid);
+ TEST_ASSERT_FATAL(llid == 0b10, "Round #%d: LLID is
incorrect %d",
+ round, llid);
seg_hdr = get_le16(&pdu[0]);
seg_len = BLE_LL_ISOAL_SEGHDR_LEN(seg_hdr);
if (idx == 0) {
TEST_ASSERT_FATAL(BLE_LL_ISOAL_SEGHDR_SC(seg_hdr) == 0,
- "Round #%d: SC is incorrect %d",
- round,
BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
+ "Round #%d: SC is incorrect %d",
round,
+ BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
test_data_verify(&pdu[5], seg_len - 3, 0);
sdu_offset += seg_len - 3;
} else {
TEST_ASSERT_FATAL(BLE_LL_ISOAL_SEGHDR_SC(seg_hdr) == 1,
- "Round #%d: SC is incorrect %d",
- round,
BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
+ "Round #%d: SC is incorrect %d",
round,
+ BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
test_data_verify(&pdu[2], seg_len, sdu_offset);
sdu_offset += seg_len;
}
} else {
- TEST_ASSERT_FATAL(llid == 0b01, "Round #%d: LLID is
incorrect %d", round, llid);
+ TEST_ASSERT_FATAL(llid == 0b01, "Round #%d: LLID is
incorrect %d",
+ round, llid);
test_data_verify(&pdu[0], pdu_len, sdu_offset);
sdu_offset += pdu_len;
@@ -616,28 +630,31 @@ test_ial_broadcast_large_sdu_bis(const struct
test_ial_broadcast_large_sdu_bis_c
* for framed payloads, with the remaining Payload Data.
*/
if (cfg->Framed) {
- TEST_ASSERT_FATAL(pdu_len == rounds[round].sdu_len -
sdu_offset + 2,
- "Round #%d: idx %d: PDU length is
incorrect %d != %d",
- round, idx, pdu_len,
rounds[round].sdu_len - sdu_offset + 2);
+ TEST_ASSERT_FATAL(
+ pdu_len == rounds[round].sdu_len - sdu_offset + 2,
+ "Round #%d: idx %d: PDU length is incorrect %d != %d",
round,
+ idx, pdu_len, rounds[round].sdu_len - sdu_offset + 2);
TEST_ASSERT_FATAL(llid == 0b10, "Round #%d: LLID is
incorrect %d",
round, llid);
seg_hdr = get_le16(&pdu[0]);
TEST_ASSERT_FATAL(BLE_LL_ISOAL_SEGHDR_SC(seg_hdr),
- "Round #%d: SC is incorrect %d",
- round, BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
+ "Round #%d: SC is incorrect %d", round,
+ BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
TEST_ASSERT_FATAL(BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr),
- "Round #%d: CMPLT is incorrect %d",
- round,
BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr));
+ "Round #%d: CMPLT is incorrect %d",
round,
+ BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr));
seg_len = BLE_LL_ISOAL_SEGHDR_LEN(seg_hdr);
test_data_verify(&pdu[2], seg_len, sdu_offset);
sdu_offset += seg_len;
} else {
- TEST_ASSERT_FATAL(pdu_len == rounds[round].sdu_len -
sdu_offset,
- "Round #%d: idx %d: PDU length is
incorrect %d != %d",
- round, idx, pdu_len,
rounds[round].sdu_len - sdu_offset);
- TEST_ASSERT_FATAL(llid == 0b00, "Round #%d: LLID is
incorrect %d", round, llid);
+ TEST_ASSERT_FATAL(
+ pdu_len == rounds[round].sdu_len - sdu_offset,
+ "Round #%d: idx %d: PDU length is incorrect %d != %d",
+ round, idx, pdu_len, rounds[round].sdu_len -
sdu_offset);
+ TEST_ASSERT_FATAL(llid == 0b00, "Round #%d: LLID is
incorrect %d",
+ round, llid);
test_data_verify(&pdu[0], pdu_len, sdu_offset);
sdu_offset += pdu_len;
@@ -646,14 +663,15 @@ test_ial_broadcast_large_sdu_bis(const struct
test_ial_broadcast_large_sdu_bis_c
}
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt == num_expected_pkt,
- "num_completed_pkt %d != %d", num_completed_pkt,
num_expected_pkt);
+ TEST_ASSERT(num_completed_pkt == num_expected_pkt, "num_completed_pkt
%d != %d",
+ num_completed_pkt, num_expected_pkt);
}
test_ll_isoal_teardown(&fixture);
}
-TEST_CASE_SELF(test_ial_bis_unf_brd_bv_09_c) {
+TEST_CASE_SELF(test_ial_bis_unf_brd_bv_09_c)
+{
const struct test_ial_broadcast_large_sdu_bis_cfg cfg = {
.NSE = 12,
.Framed = 0,
@@ -666,7 +684,8 @@ TEST_CASE_SELF(test_ial_bis_unf_brd_bv_09_c) {
test_ial_broadcast_large_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_unf_brd_bv_10_c) {
+TEST_CASE_SELF(test_ial_bis_unf_brd_bv_10_c)
+{
const struct test_ial_broadcast_large_sdu_bis_cfg cfg = {
.NSE = 6,
.Framed = 0,
@@ -679,7 +698,8 @@ TEST_CASE_SELF(test_ial_bis_unf_brd_bv_10_c) {
test_ial_broadcast_large_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_unf_brd_bv_11_c) {
+TEST_CASE_SELF(test_ial_bis_unf_brd_bv_11_c)
+{
const struct test_ial_broadcast_large_sdu_bis_cfg cfg = {
.NSE = 8,
.Framed = 0,
@@ -692,7 +712,8 @@ TEST_CASE_SELF(test_ial_bis_unf_brd_bv_11_c) {
test_ial_broadcast_large_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_13_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_13_c)
+{
const struct test_ial_broadcast_large_sdu_bis_cfg cfg = {
.NSE = 10,
.Framed = 1,
@@ -705,7 +726,8 @@ TEST_CASE_SELF(test_ial_bis_fra_brd_bv_13_c) {
test_ial_broadcast_large_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_15_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_15_c)
+{
const struct test_ial_broadcast_large_sdu_bis_cfg cfg = {
.NSE = 6,
.Framed = 1,
@@ -727,7 +749,8 @@ struct test_ial_broadcast_multiple_small_sdus_bis_cfg {
};
static void
-test_ial_broadcast_multiple_small_sdus_bis(const struct
test_ial_broadcast_multiple_small_sdus_bis_cfg *cfg)
+test_ial_broadcast_multiple_small_sdus_bis(
+ const struct test_ial_broadcast_multiple_small_sdus_bis_cfg *cfg)
{
struct test_ll_isoal_fixture fixture;
struct ble_ll_isoal_mux *mux;
@@ -760,8 +783,8 @@ test_ial_broadcast_multiple_small_sdus_bis(const struct
test_ial_broadcast_multi
event_ts = sdu_2_ts + 200;
ble_ll_isoal_mux_event_start(mux, event_ts);
- /* The IUT sends a single Broadcast ISO Data PDU with SDU1 followed by
SDU2 over the BIS.
- * Each SDU header has SC = 0 and CMPT = 1.
+ /* The IUT sends a single Broadcast ISO Data PDU with SDU1 followed by SDU2
+ * over the BIS. Each SDU header has SC = 0 and CMPT = 1.
*/
pdu_len = ble_ll_isoal_mux_pdu_get(mux, 0, &llid, pdu);
TEST_ASSERT(llid == LLID, "LLID is incorrect %d", llid);
@@ -770,10 +793,10 @@ test_ial_broadcast_multiple_small_sdus_bis(const struct
test_ial_broadcast_multi
seg = &pdu[0];
TEST_ASSERT(pdu_len > 24, "PDU length is incorrect %d", pdu_len);
seg_hdr = get_le16(&seg[0]);
- TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_SC(seg_hdr) == 0,
- "SC is incorrect %d", BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
- TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr) == 1,
- "SC is incorrect %d", BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr));
+ TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_SC(seg_hdr) == 0, "SC is incorrect %d",
+ BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
+ TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr) == 1, "SC is incorrect %d",
+ BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr));
seg_len = BLE_LL_ISOAL_SEGHDR_LEN(seg_hdr);
TEST_ASSERT(seg_len == 20 + 3, "Segment length is incorrect %d", pdu_len);
timeoffset = get_le24(&seg[2]);
@@ -784,10 +807,10 @@ test_ial_broadcast_multiple_small_sdus_bis(const struct
test_ial_broadcast_multi
seg = &pdu[25];
TEST_ASSERT(pdu_len == 55, "PDU length is incorrect %d", pdu_len);
seg_hdr = get_le16(&seg[0]);
- TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_SC(seg_hdr) == 0,
- "SC is incorrect %d", BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
- TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr) == 1,
- "SC is incorrect %d", BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr));
+ TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_SC(seg_hdr) == 0, "SC is incorrect %d",
+ BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
+ TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr) == 1, "SC is incorrect %d",
+ BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr));
seg_len = BLE_LL_ISOAL_SEGHDR_LEN(seg_hdr);
TEST_ASSERT(seg_len == 25 + 3, "Segment length is incorrect %d", pdu_len);
timeoffset = get_le24(&seg[2]);
@@ -799,7 +822,8 @@ test_ial_broadcast_multiple_small_sdus_bis(const struct
test_ial_broadcast_multi
test_ll_isoal_teardown(&fixture);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_17_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_17_c)
+{
const struct test_ial_broadcast_multiple_small_sdus_bis_cfg cfg = {
.NSE = 2,
.BN = 1,
@@ -811,7 +835,8 @@ TEST_CASE_SELF(test_ial_bis_fra_brd_bv_17_c) {
test_ial_broadcast_multiple_small_sdus_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_18_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_18_c)
+{
const struct test_ial_broadcast_multiple_small_sdus_bis_cfg cfg = {
.NSE = 2,
.BN = 1,
@@ -823,7 +848,8 @@ TEST_CASE_SELF(test_ial_bis_fra_brd_bv_18_c) {
test_ial_broadcast_multiple_small_sdus_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_20_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_20_c)
+{
const struct test_ial_broadcast_multiple_small_sdus_bis_cfg cfg = {
.NSE = 4,
.BN = 2,
@@ -894,9 +920,11 @@ test_ial_broadcast_zero_length_sdu_bis(const struct
test_ial_broadcast_zero_leng
seg_hdr = get_le16(&pdu[0]);
TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_SC(seg_hdr) ==
cfg->Segmentation_Header.SC,
"SC is incorrect %d", BLE_LL_ISOAL_SEGHDR_SC(seg_hdr));
- TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr) ==
cfg->Segmentation_Header.CMPLT,
+ TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr) ==
+ cfg->Segmentation_Header.CMPLT,
"CMPLT is incorrect %d",
BLE_LL_ISOAL_SEGHDR_CMPLT(seg_hdr));
- TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_LEN(seg_hdr) ==
cfg->Segmentation_Header.LENGTH,
+ TEST_ASSERT(BLE_LL_ISOAL_SEGHDR_LEN(seg_hdr) ==
+ cfg->Segmentation_Header.LENGTH,
"LENGTH is incorrect %d",
BLE_LL_ISOAL_SEGHDR_LEN(seg_hdr));
timeoffset = get_le24(&pdu[2]);
TEST_ASSERT(timeoffset == 400, "Time offset is incorrect %d",
timeoffset);
@@ -913,7 +941,8 @@ test_ial_broadcast_zero_length_sdu_bis(const struct
test_ial_broadcast_zero_leng
test_ll_isoal_teardown(&fixture);
}
-TEST_CASE_SELF(test_ial_bis_unf_brd_bv_21_c) {
+TEST_CASE_SELF(test_ial_bis_unf_brd_bv_21_c)
+{
const struct test_ial_broadcast_zero_length_sdu_bis_cfg cfg = {
.NSE = 4,
.Framed = 0,
@@ -925,7 +954,8 @@ TEST_CASE_SELF(test_ial_bis_unf_brd_bv_21_c) {
test_ial_broadcast_zero_length_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_unf_brd_bv_22_c) {
+TEST_CASE_SELF(test_ial_bis_unf_brd_bv_22_c)
+{
const struct test_ial_broadcast_zero_length_sdu_bis_cfg cfg = {
.NSE = 6,
.Framed = 0,
@@ -937,7 +967,8 @@ TEST_CASE_SELF(test_ial_bis_unf_brd_bv_22_c) {
test_ial_broadcast_zero_length_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_unf_brd_bv_23_c) {
+TEST_CASE_SELF(test_ial_bis_unf_brd_bv_23_c)
+{
const struct test_ial_broadcast_zero_length_sdu_bis_cfg cfg = {
.NSE = 1,
.Framed = 0,
@@ -949,7 +980,8 @@ TEST_CASE_SELF(test_ial_bis_unf_brd_bv_23_c) {
test_ial_broadcast_zero_length_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_unf_brd_bv_24_c) {
+TEST_CASE_SELF(test_ial_bis_unf_brd_bv_24_c)
+{
const struct test_ial_broadcast_zero_length_sdu_bis_cfg cfg = {
.NSE = 2,
.Framed = 0,
@@ -961,7 +993,8 @@ TEST_CASE_SELF(test_ial_bis_unf_brd_bv_24_c) {
test_ial_broadcast_zero_length_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_25_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_25_c)
+{
const struct test_ial_broadcast_zero_length_sdu_bis_cfg cfg = {
.NSE = 6,
.Framed = 1,
@@ -977,7 +1010,8 @@ TEST_CASE_SELF(test_ial_bis_fra_brd_bv_25_c) {
test_ial_broadcast_zero_length_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_26_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_26_c)
+{
const struct test_ial_broadcast_zero_length_sdu_bis_cfg cfg = {
.NSE = 2,
.Framed = 1,
@@ -993,7 +1027,8 @@ TEST_CASE_SELF(test_ial_bis_fra_brd_bv_26_c) {
test_ial_broadcast_zero_length_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_27_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_27_c)
+{
const struct test_ial_broadcast_zero_length_sdu_bis_cfg cfg = {
.NSE = 4,
.Framed = 1,
@@ -1009,7 +1044,8 @@ TEST_CASE_SELF(test_ial_bis_fra_brd_bv_27_c) {
test_ial_broadcast_zero_length_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_28_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_28_c)
+{
const struct test_ial_broadcast_zero_length_sdu_bis_cfg cfg = {
.NSE = 6,
.Framed = 1,
@@ -1025,7 +1061,8 @@ TEST_CASE_SELF(test_ial_bis_fra_brd_bv_28_c) {
test_ial_broadcast_zero_length_sdu_bis(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_fra_brd_bv_30_c) {
+TEST_CASE_SELF(test_ial_bis_fra_brd_bv_30_c)
+{
const struct test_ial_broadcast_zero_length_sdu_bis_cfg cfg = {
.NSE = 6,
.Framed = 1,
@@ -1053,7 +1090,8 @@ struct test_ial_unframed_empty_pdus_with_llid_0b01_cfg {
};
static void
-test_ial_unframed_empty_pdus_with_llid_0b01(const struct
test_ial_unframed_empty_pdus_with_llid_0b01_cfg *cfg)
+test_ial_unframed_empty_pdus_with_llid_0b01(
+ const struct test_ial_unframed_empty_pdus_with_llid_0b01_cfg *cfg)
{
struct test_ll_isoal_fixture fixture;
struct ble_ll_isoal_mux *mux;
@@ -1078,18 +1116,16 @@ test_ial_unframed_empty_pdus_with_llid_0b01(const
struct test_ial_unframed_empty
"#%d: SDU and PDU length should be same", sdu_len);
pdu_len = ble_ll_isoal_mux_pdu_get(mux, 0, &llid, pdu);
- TEST_ASSERT(llid == 0b00,
- "#%d: LLID is incorrect %d", sdu_len, llid);
- TEST_ASSERT(pdu_len == sdu_len,
- "#%d: PDU length is incorrect %d", sdu_len, pdu_len);
+ TEST_ASSERT(llid == 0b00, "#%d: LLID is incorrect %d", sdu_len, llid);
+ TEST_ASSERT(pdu_len == sdu_len, "#%d: PDU length is incorrect %d",
+ sdu_len, pdu_len);
/* Padding */
for (uint8_t idx = 1; idx < cfg->bn; idx++) {
pdu_len = ble_ll_isoal_mux_pdu_get(mux, idx, &llid, pdu);
- TEST_ASSERT(llid == 0b01,
- "#%d #%d: LLID is incorrect %d", sdu_len, idx, llid);
- TEST_ASSERT(pdu_len == 0,
- "#%d #%d: PDU length is incorrect %d",
+ TEST_ASSERT(llid == 0b01, "#%d #%d: LLID is incorrect %d", sdu_len,
+ idx, llid);
+ TEST_ASSERT(pdu_len == 0, "#%d #%d: PDU length is incorrect %d",
sdu_len, idx, pdu_len);
}
@@ -1099,7 +1135,8 @@ test_ial_unframed_empty_pdus_with_llid_0b01(const struct
test_ial_unframed_empty
test_ll_isoal_teardown(&fixture);
}
-TEST_CASE_SELF(test_ial_bis_unf_brd_bv_29_c) {
+TEST_CASE_SELF(test_ial_bis_unf_brd_bv_29_c)
+{
const struct test_ial_unframed_empty_pdus_with_llid_0b01_cfg cfg = {
.sdu_int = 100,
.iso_int = 100,
@@ -1114,7 +1151,8 @@ TEST_CASE_SELF(test_ial_bis_unf_brd_bv_29_c) {
test_ial_unframed_empty_pdus_with_llid_0b01(&cfg);
}
-TEST_CASE_SELF(test_ial_bis_unf_early_sdus) {
+TEST_CASE_SELF(test_ial_bis_unf_early_sdus)
+{
struct test_ll_isoal_fixture fixture;
struct ble_ll_isoal_mux *mux;
const uint32_t sdu_int = 7500;
@@ -1156,8 +1194,8 @@ TEST_CASE_SELF(test_ial_bis_unf_early_sdus) {
TEST_ASSERT(pdu_len == 0, "PDU length is incorrect %d", pdu_len);
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt == 1,
- "num_completed_pkt is incorrect %d", num_completed_pkt);
+ TEST_ASSERT(num_completed_pkt == 1, "num_completed_pkt is incorrect %d",
+ num_completed_pkt);
ble_ll_isoal_mux_event_start(mux, timestamp + 50 + iso_int);
@@ -1179,8 +1217,8 @@ TEST_CASE_SELF(test_ial_bis_unf_early_sdus) {
TEST_ASSERT(pdu_len == 0, "PDU length is incorrect %d", pdu_len);
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt == 1,
- "num_completed_pkt is incorrect %d", num_completed_pkt);
+ TEST_ASSERT(num_completed_pkt == 1, "num_completed_pkt is incorrect %d",
+ num_completed_pkt);
ble_ll_isoal_mux_event_start(mux, timestamp + 50 + 2 * iso_int);
@@ -1202,13 +1240,14 @@ TEST_CASE_SELF(test_ial_bis_unf_early_sdus) {
TEST_ASSERT(pdu_len == 0, "PDU length is incorrect %d", pdu_len);
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt == 1,
- "num_completed_pkt is incorrect %d", num_completed_pkt);
+ TEST_ASSERT(num_completed_pkt == 1, "num_completed_pkt is incorrect %d",
+ num_completed_pkt);
test_ll_isoal_teardown(&fixture);
}
-TEST_CASE_SELF(test_ial_bis_fra_early_sdus) {
+TEST_CASE_SELF(test_ial_bis_fra_early_sdus)
+{
struct test_ll_isoal_fixture fixture;
struct ble_ll_isoal_mux *mux;
const uint32_t sdu_int = 87072;
@@ -1243,8 +1282,8 @@ TEST_CASE_SELF(test_ial_bis_fra_early_sdus) {
test_data_verify(&pdu[5], mx_sdu, 0);
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt == 2,
- "num_completed_pkt is incorrect %d", num_completed_pkt);
+ TEST_ASSERT(num_completed_pkt == 2, "num_completed_pkt is incorrect %d",
+ num_completed_pkt);
ble_ll_isoal_mux_event_start(mux, timestamp);
@@ -1259,8 +1298,8 @@ TEST_CASE_SELF(test_ial_bis_fra_early_sdus) {
test_data_verify(&pdu[5], mx_sdu, 0);
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt == 2,
- "num_completed_pkt is incorrect %d", num_completed_pkt);
+ TEST_ASSERT(num_completed_pkt == 2, "num_completed_pkt is incorrect %d",
+ num_completed_pkt);
ble_ll_isoal_mux_event_start(mux, timestamp);
@@ -1275,8 +1314,8 @@ TEST_CASE_SELF(test_ial_bis_fra_early_sdus) {
test_data_verify(&pdu[5], mx_sdu, 0);
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt == 2,
- "num_completed_pkt is incorrect %d", num_completed_pkt);
+ TEST_ASSERT(num_completed_pkt == 2, "num_completed_pkt is incorrect %d",
+ num_completed_pkt);
ble_ll_isoal_mux_event_start(mux, timestamp);
@@ -1291,8 +1330,8 @@ TEST_CASE_SELF(test_ial_bis_fra_early_sdus) {
test_data_verify(&pdu[5], mx_sdu, 0);
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt == 2,
- "num_completed_pkt is incorrect %d", num_completed_pkt);
+ TEST_ASSERT(num_completed_pkt == 2, "num_completed_pkt is incorrect %d",
+ num_completed_pkt);
ble_ll_isoal_mux_event_start(mux, timestamp);
@@ -1307,13 +1346,14 @@ TEST_CASE_SELF(test_ial_bis_fra_early_sdus) {
test_data_verify(&pdu[5], mx_sdu, 0);
num_completed_pkt = ble_ll_isoal_mux_event_done(mux);
- TEST_ASSERT(num_completed_pkt == 2,
- "num_completed_pkt is incorrect %d", num_completed_pkt);
+ TEST_ASSERT(num_completed_pkt == 2, "num_completed_pkt is incorrect %d",
+ num_completed_pkt);
test_ll_isoal_teardown(&fixture);
}
-TEST_SUITE(ble_ll_isoal_test_suite) {
+TEST_SUITE(ble_ll_isoal_test_suite)
+{
ble_ll_isoal_test_suite_init();
ble_ll_isoal_init();