zircon/system/ulib/blobfs/test/format-test.cc
// Formatting filesystems should fail on devices that cannot be written.
Formatting filesystems should fail on devices that cannot be written.
Formatting filesystems should fail on devices that cannot be written .
TEST(FormatFilesystemTest, CannotFormatReadOnlyDevice) {
  auto device = std::make_unique<FakeBlockDevice>(1 << 20, 512);
  device->SetInfoFlags(fuchsia_hardware_block_FLAG_READONLY);
  ASSERT_EQ(ZX_ERR_ACCESS_DENIED, FormatFilesystem(device.get()));
}
TEST ( FormatFilesystemTest , CannotFormatReadOnlyDevice ) { auto device = std :: make_unique < FakeBlockDevice > ( 1 << 20 , 512 ) ; device -> SetInfoFlags ( fuchsia_hardware_block_FLAG_READONLY ) ; ASSERT_EQ ( ZX_ERR_ACCESS_DENIED , FormatFilesystem ( device . get ( ) ) ) ; }
Formatting filesystems should fail on devices that cannot be written.
Formatting filesystems should fail on devices that cannot be written .