Commit Graph

3 Commits

Author SHA1 Message Date
Wyatt Hepler
f707880fbe pw_status: StatusWithSize constants
- Provide StatusWithSize constants that can be used similarly to
  Status::Codes. For example, StatusWithSize::DATA_LOSS constructs a
  StatusWithSize with status DATA_LOSS and size 0.
- Remove the default constructor argument for the size. Use the
  constants instead.
- Update uses of StatusWithSize(Status::X) to use StatusWithSize::X.

Change-Id: I901b7bb0bbbb4fde52f6b3acc3047f366b250515
2020-02-25 13:50:41 -08:00
Wyatt Hepler
118fc3c5f0 pw_kvs: Expand tests for error handling
- Add error injection features to InMemoryFakeFlash. Reads or Writes can
  be programmed to fail.
- Introduce key_value_store_error_handling_test.cc, which focuses on
  corruption and read/write failure cases.
- Add functions for creating binary KVS entries at compile time.

Change-Id: Ie52ba5eb13eb60244835ef43314282beacc3a659
2020-02-24 10:08:27 -08:00
Wyatt Hepler
cdd6dfcfc6 pw_kvs: FlashMemory updates; test utilities
- Update comments for FlashMemory class.
- Split InMemoryFakeFlash to move the fixed-size buffer into the
  derived FakeFlashBuffer class.
- Support initializing FakeFlashBuffer to data provided at construction.
- Allow direct access to the underlying fake flash buffer for testing.
- Create utilities for working with byte arrays in byte_utils.h.

Change-Id: I90d33621cb91da079d7213fe7d33823494120e48
2020-02-19 19:10:32 +00:00