src/devices/block/drivers/fvm/test/block-device-test.cc
// Verifies that simple TRIM commands are forwarded to the underlying device.
Verifies that simple TRIM commands are forwarded to the underlying device.
Verifies that simple TRIM commands are forwarded to the underlying device .
TEST_F(BlockDeviceTest, QueueTrimOneSlice) {
  const uint32_t kOperationLength = 20;
  partition_->SliceSetUnsafe(0, 0);
  block_op_t op = {};
  op.trim.command = BLOCK_OP_TRIM;
  op.trim.length = kOperationLength;
  op.trim.offset_dev = kBlocksPerSlice / 2;
  partition_->BlockImplQueue(
      &op, [](void*, zx_status_t status, block_op_t*) {}, nullptr);
  EXPECT_EQ(1, block_device_.num_calls());
  EXPECT_EQ(kOperationLength, block_device_.trim_length());
}
TEST_F ( BlockDeviceTest , QueueTrimOneSlice ) { const uint32_t kOperationLength = 20 ; partition_ -> SliceSetUnsafe ( 0 , 0 ) ; block_op_t op = { } ; op . trim . command = BLOCK_OP_TRIM ; op . trim . length = kOperationLength ; op . trim . offset_dev = kBlocksPerSlice / 2 ; partition_ -> BlockImplQueue ( & op , [ ] ( void * , zx_status_t status , block_op_t * ) { } , nullptr ) ; EXPECT_EQ ( 1 , block_device_ . num_calls ( ) ) ; EXPECT_EQ ( kOperationLength , block_device_ . trim_length ( ) ) ; }
Verifies that simple TRIM commands are forwarded to the underlying device.
Verifies that simple TRIM commands are forwarded to the underlying device .