pw_blob_store: Update checking in reader::Open
- Add check for valid to read before doing the check for valid offset.
- Change GetMemoryMappedBlob() to return ConstByteSpan.
Change-Id: Ibf0b60fed00520030df5066fcf8fc7c235825a30
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/18440
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: David Rogers <davidrogers@google.com>
diff --git a/pw_blob_store/blob_store_chunk_write_test.cc b/pw_blob_store/blob_store_chunk_write_test.cc
index 42dac62..ae9ef68 100644
--- a/pw_blob_store/blob_store_chunk_write_test.cc
+++ b/pw_blob_store/blob_store_chunk_write_test.cc
@@ -84,13 +84,13 @@
// Use reader to check for valid data.
BlobStore::BlobReader reader(blob);
ASSERT_EQ(Status::OK, reader.Open());
- Result<ByteSpan> result = reader.GetMemoryMappedBlob();
+ Result<ConstByteSpan> result = reader.GetMemoryMappedBlob();
ASSERT_TRUE(result.ok());
VerifyFlash(result.value());
EXPECT_EQ(Status::OK, reader.Close());
}
- void VerifyFlash(ByteSpan verify_bytes) {
+ void VerifyFlash(ConstByteSpan verify_bytes) {
// Should be defined as same size.
EXPECT_EQ(source_buffer_.size(), flash_.buffer().size_bytes());