File tree 2 files changed +12
-4
lines changed
testing/unit/channel_sounding_behavior/src
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ static struct net_buf test_buf = {
348
348
349
349
// static struct bt_conn test_conn;
350
350
351
- ZTEST (channel_sounding_tests_error_handling , test_buffer_too_short )
351
+ ZTEST (channel_sounding_tests_error_handling , test_bt_hci_le_cs_read_remote_fae_table_complete_invalid_buf_size_fail )
352
352
{
353
353
// Setup
354
354
test_buf .len = sizeof (struct bt_hci_evt_le_cs_read_remote_fae_table_complete ) - 1 ;
@@ -360,7 +360,7 @@ ZTEST(channel_sounding_tests_error_handling, test_buffer_too_short)
360
360
zassert_equal (notify_remote_cs_fae_table_fake .call_count , 0 , "Expected notify_remote_cs_fae_table not to be called" );
361
361
}
362
362
363
- ZTEST (channel_sounding_tests_error_handling , test_evt_status_failure )
363
+ ZTEST (channel_sounding_tests_error_handling , test_bt_hci_le_cs_read_remote_fae_table_complete_evt_status_fail )
364
364
{
365
365
struct bt_hci_evt_le_cs_read_remote_fae_table_complete * evt ;
366
366
@@ -375,7 +375,7 @@ ZTEST(channel_sounding_tests_error_handling, test_evt_status_failure)
375
375
zassert_equal (notify_remote_cs_fae_table_fake .call_count , 0 , "Expected notify_remote_cs_fae_table not to be called" );
376
376
}
377
377
378
- ZTEST (channel_sounding_tests_error_handling , test_conn_lookup_failure )
378
+ ZTEST (channel_sounding_tests_error_handling , test_bt_hci_le_cs_read_remote_fae_table_complete_conn_lookup_fail )
379
379
{
380
380
struct bt_hci_evt_le_cs_read_remote_fae_table_complete * evt ;
381
381
Original file line number Diff line number Diff line change @@ -198,6 +198,14 @@ ZTEST(channel_sounding_tests, test_read_remote_fae_table)
198
198
zassert_equal_ptr (net_buf_simple_add_fake .arg0_val , simple_test_buf );
199
199
}
200
200
201
+ void * net_buf_simple_pull_mem_mock (struct net_buf_simple * buf , size_t len )
202
+ {
203
+ void * data = buf -> data ; // Save the current data pointer
204
+ buf -> data += len ; // Advance the data pointer
205
+ buf -> len -= len ; // Reduce the remaining length
206
+ return data ; // Return the original data pointer
207
+ }
208
+
201
209
ZTEST (channel_sounding_tests , test_successful_read )
202
210
{
203
211
struct bt_conn * test_conn = & test_conn_mock ;
@@ -235,7 +243,7 @@ ZTEST(channel_sounding_tests, test_successful_read)
235
243
236
244
// Replace generic mock implementation with stubbed function
237
245
// net_buf_simple_add_fake.custom_fake = custom_net_buf_simple_add;
238
- net_buf_simple_pull_mem_fake .return_val = & evt ;
246
+ net_buf_simple_pull_mem_fake .custom_fake = net_buf_simple_pull_mem_mock ;
239
247
240
248
/* Call the function */
241
249
bt_hci_le_cs_read_remote_fae_table_complete (& test_buf );
You can’t perform that action at this time.
0 commit comments