Re-enable asserts in headers
Several parts of the code had commented-out asserts due to DCHECK not
working in headers or constexpr functions. This updates those to use the
pw_assert light API.
Fixes: 246
Change-Id: I92899045f9dd2188af8d5bbd13472f00a5431b76
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22820
Commit-Queue: Alexei Frolov <frolv@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
diff --git a/pw_kvs/public/pw_kvs/flash_memory.h b/pw_kvs/public/pw_kvs/flash_memory.h
index 28fd043..8a3d35d0 100644
--- a/pw_kvs/public/pw_kvs/flash_memory.h
+++ b/pw_kvs/public/pw_kvs/flash_memory.h
@@ -166,7 +166,6 @@
FlashPartition::Address address_;
};
- // TODO(pwbug/246): This can be constexpr when tokenized asserts are fixed.
FlashPartition(
FlashMemory* flash,
uint32_t start_sector_index,
@@ -175,7 +174,6 @@
PartitionPermission permission = PartitionPermission::kReadAndWrite);
// Creates a FlashPartition that uses the entire flash with its alignment.
- // TODO(pwbug/246): This can be constexpr when tokenized asserts are fixed.
FlashPartition(FlashMemory* flash)
: FlashPartition(
flash, 0, flash->sector_count(), flash->alignment_bytes()) {}
@@ -301,4 +299,4 @@
};
} // namespace kvs
-} // namespace pw
\ No newline at end of file
+} // namespace pw