pw_kvs: Alternate ConvertsToSpan implementation
- Update ConvertsToSpan so that it doesn't rely on class template
argument deduction (a C++17 feature). Instead, use make_span from
Chromium.
- Create a new test file for ConvertsToSpan and expand it.
- Move a test for bytes::Concat to the appropriate test file in
pw_bytes.
Change-Id: I0682aac7f54f046aa9b583b0387de1a2e5620bdf
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/26660
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Rob Oliver <rgoliver@google.com>
diff --git a/pw_kvs/BUILD b/pw_kvs/BUILD
index fec76d0..2cd3cbc 100644
--- a/pw_kvs/BUILD
+++ b/pw_kvs/BUILD
@@ -101,8 +101,8 @@
"public/pw_kvs/flash_test_partition.h",
],
deps = [
- ":pw_kvs",
":fake_flash",
+ ":pw_kvs",
],
)
@@ -114,11 +114,11 @@
hdrs = [
"public/pw_kvs/flash_test_partition.h",
],
+ defines = ["PW_FLASH_TEST_ALIGNMENT=64"],
deps = [
- ":pw_kvs",
":fake_flash",
+ ":pw_kvs",
],
- defines = [ "PW_FLASH_TEST_ALIGNMENT=64" ],
)
pw_cc_library(
@@ -129,11 +129,11 @@
hdrs = [
"public/pw_kvs/flash_test_partition.h",
],
+ defines = ["PW_FLASH_TEST_ALIGNMENT=256"],
deps = [
- ":pw_kvs",
":fake_flash",
+ ":pw_kvs",
],
- defines = [ "PW_FLASH_TEST_ALIGNMENT=256" ],
)
pw_cc_library(
@@ -146,8 +146,8 @@
],
deps = [
":crc16",
- ":pw_kvs",
":fake_flash",
+ ":pw_kvs",
],
)
@@ -204,6 +204,12 @@
)
pw_cc_test(
+ name = "converts_to_span_test",
+ srcs = ["converts_to_span_test.cc"],
+ deps = [":pw_kvs"],
+)
+
+pw_cc_test(
name = "entry_test",
srcs = [
"entry_test.cc",
@@ -231,37 +237,37 @@
pw_cc_test(
name = "flash_partition_small_test",
srcs = ["flash_partition_test.cc"],
+ defines = ["PW_FLASH_TEST_ITERATIONS=100"],
deps = [
- ":pw_kvs",
":fake_flash_small_partition",
+ ":pw_kvs",
"//pw_log:backend",
"//pw_unit_test",
],
- defines = [ "PW_FLASH_TEST_ITERATIONS=100" ],
)
pw_cc_test(
name = "flash_partition_64_alignment_test",
srcs = ["flash_partition_test.cc"],
+ defines = ["PW_FLASH_TEST_ITERATIONS=100"],
deps = [
- ":pw_kvs",
":fake_flash_64_aligned_partition",
+ ":pw_kvs",
"//pw_log:backend",
"//pw_unit_test",
],
- defines = [ "PW_FLASH_TEST_ITERATIONS=100" ],
)
pw_cc_test(
name = "flash_partition_256_alignment_test",
srcs = ["flash_partition_test.cc"],
+ defines = ["PW_FLASH_TEST_ITERATIONS=100"],
deps = [
- ":pw_kvs",
":fake_flash_256_aligned_partition",
+ ":pw_kvs",
"//pw_log:backend",
"//pw_unit_test",
],
- defines = [ "PW_FLASH_TEST_ITERATIONS=100" ],
)
pw_cc_test(
@@ -286,8 +292,8 @@
srcs = ["key_value_store_initialized_test.cc"],
deps = [
":crc16",
- ":pw_kvs",
":fake_flash_small_partition",
+ ":pw_kvs",
":test_utils",
"//pw_checksum",
"//pw_log:backend",
@@ -304,8 +310,8 @@
srcs = ["key_value_store_initialized_test.cc"],
deps = [
":crc16",
- ":pw_kvs",
":fake_flash_64_aligned_partition",
+ ":pw_kvs",
":test_utils",
"//pw_checksum",
"//pw_log:backend",
@@ -322,8 +328,8 @@
srcs = ["key_value_store_initialized_test.cc"],
deps = [
":crc16",
- ":pw_kvs",
":fake_flash_256_aligned_partition",
+ ":pw_kvs",
":test_utils",
"//pw_checksum",
"//pw_log:backend",