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