[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>
24 files changed
tree: 8069a6ffb0f0a32086b5f4c5956e5574d64de072
  1. boards/
  2. build/
  3. buildtools/
  4. bundles/
  5. docs/
  6. examples/
  7. garnet/
  8. products/
  9. scripts/
  10. sdk/
  11. src/
  12. third_party/
  13. tools/
  14. zircon/
  15. .clang-format
  16. .clang-tidy
  17. .git-blame-ignore-revs
  18. .gitattributes
  19. .gitignore
  20. .gn
  21. .style.yapf
  22. AUTHORS
  23. BUILD.gn
  24. CODE_OF_CONDUCT.md
  25. CONTRIBUTING.md
  26. LICENSE
  27. OWNERS
  28. PATENTS
  29. README.md
  30. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

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.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.