Skip to content

Commit d09f741

Browse files
alstrzebonskinordicjm
authored andcommitted
tests: fast_pair: storage: Align tests to bond management changes
Jira: NCSDK-18829 Signed-off-by: Aleksander Strzebonski <[email protected]>
1 parent 1deb009 commit d09f741

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

tests/subsys/bluetooth/fast_pair/storage/account_key_storage/src/main.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#define ACCOUNT_KEY_MAX_CNT CONFIG_BT_FAST_PAIR_STORAGE_ACCOUNT_KEY_MAX
2020

21+
/* Account Key storage bond management feature is not yet supported by the unit test. */
22+
BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND));
2123

2224
static void reload_keys_from_storage(void)
2325
{
@@ -93,7 +95,7 @@ ZTEST(suite_fast_pair_storage_common, test_one_key)
9395
struct fp_account_key account_key;
9496

9597
cu_generate_account_key(seed, &account_key);
96-
err = fp_storage_ak_save(&account_key);
98+
err = fp_storage_ak_save(&account_key, NULL);
9799
zassert_ok(err, "Unexpected error during Account Key save");
98100

99101
struct fp_account_key read_keys[ACCOUNT_KEY_MAX_CNT];
@@ -143,11 +145,11 @@ ZTEST(suite_fast_pair_storage_common, test_duplicate)
143145
struct fp_account_key account_key;
144146

145147
cu_generate_account_key(seed, &account_key);
146-
err = fp_storage_ak_save(&account_key);
148+
err = fp_storage_ak_save(&account_key, NULL);
147149
zassert_ok(err, "Unexpected error during Account Key save");
148150

149151
/* Try to add key duplicate. */
150-
err = fp_storage_ak_save(&account_key);
152+
err = fp_storage_ak_save(&account_key, NULL);
151153
if (!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_OWNER_ACCOUNT_KEY)) {
152154
zassert_ok(err, "Unexpected error during Account Key save");
153155
} else {
@@ -310,7 +312,7 @@ ZTEST(suite_fast_pair_storage_common, test_owner_key)
310312
ret = fp_storage_ak_is_owner(&account_key);
311313
zassert_equal(ret, -ESRCH, "No owner account key should be stored");
312314

313-
ret = fp_storage_ak_save(&account_key);
315+
ret = fp_storage_ak_save(&account_key, NULL);
314316
zassert_ok(ret, "Unexpected error during Account Key save");
315317

316318
ret = fp_storage_ak_is_owner(&account_key);

tests/subsys/bluetooth/fast_pair/storage/common/src/common_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void cu_account_keys_generate_and_store(uint8_t first_seed, uint8_t gen_count)
2828
for (uint8_t i = 0; i < gen_count; i++) {
2929
cu_generate_account_key(i + first_seed, &account_key);
3030

31-
err = fp_storage_ak_save(&account_key);
31+
err = fp_storage_ak_save(&account_key, NULL);
3232
zassert_ok(err, "Failed to store Account Key");
3333
}
3434
}
@@ -64,7 +64,7 @@ void cu_account_keys_validate_uninitialized(void)
6464
size_t read_cnt = ACCOUNT_KEY_MAX_CNT;
6565

6666
cu_generate_account_key(seed, &account_key);
67-
err = fp_storage_ak_save(&account_key);
67+
err = fp_storage_ak_save(&account_key, NULL);
6868
zassert_equal(err, -EACCES, "Expected error before initialization");
6969

7070
err = fp_storage_ak_count();

tests/subsys/bluetooth/fast_pair/storage/factory_reset/src/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ static int settings_set_err;
6060

6161
static bool storage_reset_pass;
6262

63+
/* Account Key storage bond management feature is not yet supported by the unit test. */
64+
BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_FAST_PAIR_STORAGE_AK_BOND));
65+
6366

6467
static int settings_load_stage(size_t len, settings_read_cb read_cb, void *cb_arg)
6568
{

0 commit comments

Comments
 (0)