commit | 08ff9d3b731bea860799e6011db9bcbb635ad939 | [log] [tgz] |
---|---|---|
author | Chris Drouillard <cdrllrd@google.com> | Wed Jan 27 19:01:21 2021 +0000 |
committer | CQ Bot <commit-bot@chromium.org> | Wed Jan 27 19:01:21 2021 +0000 |
tree | 8069a6ffb0f0a32086b5f4c5956e5574d64de072 | |
parent | 9fdfc6da8ee31f5d30e80c63543aba76bcdfb63b [diff] |
[blobfs] Cleanup in blob test utils Remove the Merkle tree validation from GenerateBlob. The digest library is responsible for testing the Merkle tree generation so it doesn't need to be done here. This removes all of the ASSERT_* calls from GenerateBlob and GenerateRandomBlob allowing them to return the generated BlobInfo. Replace The ASSERT_GT in GenerateRealisticBlob with a ZX_ASSERT_MSG because it's checking an invariant of the test util and not an invariant of the code being tested. This allows GenerateRealisticBlob to return BlobInfo as well. Stop returning a status from CreateMerkleTree and instead ZX_ASSERT inside of the method. Failing to generate the Merkle tree is a bug in the test and not a bug in the code under test. Remove the merkle and size_merkle member variables from BlobInfo and remove the Generate*Blob overloads taking a BlobLayoutFormat. The overloads were added to support the new Merkle tree format in blobfs but very few tests actually use the merkle tree member variables so the overloads were making the common case more complicated. If tests need the Merkle tree or it's size they can call CreateMerkleTree. Change the type of BlobInfo::data to use uint8_t instead char to match the rest of the blobfs code. Remove several unnecessary std::move calls. Update some function params to better match how the params are used. Fixed: 63295 Change-Id: Ia5e0d1051bc8085a23df02e1128ed4a8c1f858c4 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/470532 Commit-Queue: Chris Drouillard <cdrllrd@google.com> Reviewed-by: James Sullivan <jfsulliv@google.com>
Pink + Purple == Fuchsia (a new operating system)
Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.
Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.