src/storage/blobfs/test/unit/format-test.cc
// Blobfs can be formatted on the smallest possible device.
Blobfs can be formatted on the smallest possible device.
Blobfs can be formatted on the smallest possible device .
TEST(FormatFilesystemTest, FormatNonFVMSmallestDevice) {
  const uint32_t kBlockSize = 512;
  const uint64_t kDiskBlockRatio = kBlobfsBlockSize / kBlockSize;
  const uint64_t kBlockCount = kDiskBlockRatio * MinimumFilesystemBlocks();
  {
    auto device = std::make_unique<FakeBlockDevice>(kBlockCount, kBlockSize);
    ASSERT_EQ(FormatFilesystem(device.get()), ZX_OK);
    ASSERT_EQ(CheckMountability(std::move(device)), ZX_OK);
  }
  {
    auto device = std::make_unique<FakeBlockDevice>(kBlockCount - 1, kBlockSize);
    ASSERT_EQ(ZX_ERR_NO_SPACE, FormatFilesystem(device.get()));
  }
}
TEST ( FormatFilesystemTest , FormatNonFVMSmallestDevice ) { const uint32_t kBlockSize = 512 ; const uint64_t kDiskBlockRatio = kBlobfsBlockSize / kBlockSize ; const uint64_t kBlockCount = kDiskBlockRatio * MinimumFilesystemBlocks ( ) ; { auto device = std :: make_unique < FakeBlockDevice > ( kBlockCount , kBlockSize ) ; ASSERT_EQ ( FormatFilesystem ( device . get ( ) ) , ZX_OK ) ; ASSERT_EQ ( CheckMountability ( std :: move ( device ) ) , ZX_OK ) ; } { auto device = std :: make_unique < FakeBlockDevice > ( kBlockCount - 1 , kBlockSize ) ; ASSERT_EQ ( ZX_ERR_NO_SPACE , FormatFilesystem ( device . get ( ) ) ) ; } }
Blobfs can be formatted on the smallest possible device.
Blobfs can be formatted on the smallest possible device .
// Smallest possible device. // One block smaller than the smallest possible device.