src/storage/blobfs/test/host/host-test.cc
// Verify that we compress small files.
Verify that we compress small files.
Verify that we compress small files .
TEST(BlobfsHostCompressionTest, CompressSmallFiles) {
  File fs_file(tmpfile());
  EXPECT_EQ(0, Mkfs(fs_file.fd(), 10000));
  constexpr size_t all_zero_size = 12 * 1024;
  File blob_file(tmpfile());
  EXPECT_EQ(0, ftruncate(blob_file.fd(), all_zero_size));
  constexpr bool compress = true;
  MerkleInfo info;
  EXPECT_EQ(ZX_OK, blobfs_preprocess(blob_file.fd(), compress, &info));
  EXPECT_TRUE(info.compressed);
  EXPECT_LE(info.compressed_length, all_zero_size);
}
TEST ( BlobfsHostCompressionTest , CompressSmallFiles ) { File fs_file ( tmpfile ( ) ) ; EXPECT_EQ ( 0 , Mkfs ( fs_file . fd ( ) , 10000 ) ) ; constexpr size_t all_zero_size = 12 * 1024 ; File blob_file ( tmpfile ( ) ) ; EXPECT_EQ ( 0 , ftruncate ( blob_file . fd ( ) , all_zero_size ) ) ; constexpr bool compress = true ; MerkleInfo info ; EXPECT_EQ ( ZX_OK , blobfs_preprocess ( blob_file . fd ( ) , compress , & info ) ) ; EXPECT_TRUE ( info . compressed ) ; EXPECT_LE ( info . compressed_length , all_zero_size ) ; }
Verify that we compress small files.
Verify that we compress small files .