diff options
author | David Rogers <davidrogers@google.com> | 2020-08-03 08:44:10 -0700 |
---|---|---|
committer | CQ Bot Account <commit-bot@chromium.org> | 2020-08-03 16:54:45 +0000 |
commit | 436b3aa926a030f40bfc7124e2c65907a748ff67 (patch) | |
tree | 4713640af9311d24603fc25eb966b55944474c65 /pw_kvs/key_value_store_map_test.cc | |
parent | 795fecf5a2a174adbc391e9d143c02995780d6ef (diff) | |
download | pigweed-436b3aa926a030f40bfc7124e2c65907a748ff67.tar.gz |
pw_kvs: Update all KVS magics to be random numbers
To set the proper example for KVS users, update all KVS tests to use
random numbers for the magic. Add comments to each magic use to explain
use of random number.
Change-Id: I76a4012cf7848cc800705fa129a2aca49bd1cd72
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/15241
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: David Rogers <davidrogers@google.com>
Diffstat (limited to 'pw_kvs/key_value_store_map_test.cc')
-rw-r--r-- | pw_kvs/key_value_store_map_test.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pw_kvs/key_value_store_map_test.cc b/pw_kvs/key_value_store_map_test.cc index b1de09378..87d0dee68 100644 --- a/pw_kvs/key_value_store_map_test.cc +++ b/pw_kvs/key_value_store_map_test.cc @@ -85,7 +85,9 @@ class KvsTester { kParams.partition_start_sector, kParams.partition_sector_count, kParams.partition_alignment), - kvs_(&partition_, {.magic = 0xBAD'C0D3, .checksum = nullptr}) { + // For KVS magic value always use a random 32 bit integer rather than a + // human readable 4 bytes. See pw_kvs/format.h for more information. + kvs_(&partition_, {.magic = 0xc857e51d, .checksum = nullptr}) { EXPECT_EQ(Status::OK, partition_.Erase()); Status result = kvs_.Init(); EXPECT_EQ(Status::OK, result); |