src/devices/block/drivers/fvm/test/block-device-test.cc
// Verifies that TRIM commands that span slices are forwarded to the underlying device.
Verifies that TRIM commands that span slices are forwarded to the underlying device.
Verifies that TRIM commands that span slices are forwarded to the underlying device .
TEST_F(BlockDeviceTest, QueueTrimConsecutiveSlices) {
  const uint32_t kOperationLength = 20;
  partition_->SliceSetUnsafe(0, 0);
  partition_->SliceSetUnsafe(1, 1);
  block_op_t op = {};
  op.trim.command = BLOCK_OP_TRIM;
  op.trim.length = kOperationLength;
  op.trim.offset_dev = kBlocksPerSlice - kOperationLength / 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 , QueueTrimConsecutiveSlices ) { const uint32_t kOperationLength = 20 ; partition_ -> SliceSetUnsafe ( 0 , 0 ) ; partition_ -> SliceSetUnsafe ( 1 , 1 ) ; block_op_t op = { } ; op . trim . command = BLOCK_OP_TRIM ; op . trim . length = kOperationLength ; op . trim . offset_dev = kBlocksPerSlice - kOperationLength / 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 TRIM commands that span slices are forwarded to the underlying device.
Verifies that TRIM commands that span slices are forwarded to the underlying device .