class FakeDiskIoProtocol

Defined at line 30 of file ../../zircon/kernel/lib/efi/testing/include/lib/efi/testing/fake_disk_io_protocol.h

Wraps efi_disk_io_protocol to support reading/writing a fake disk.

Example usage:

FakeDiskIoProtocol fake;

// Register media 5 with some contents.

fake.contents(5) = {0x00, 0x88, 0xFF};

// Functions that read using the EFI protocol will see the above contents.

ASSERT_OK(my_test_read_func(fake.protocol()));

// Functions that write using the EFI protocol will update the contents.

ASSERT_OK(my_test_write_func(fake.protocol()));

ASSERT_EQ(std::vector

<uint8

_t>{0xAA, 0xAA, 0xAA}, fake.contents(5));

Public Methods

void FakeDiskIoProtocol ()

Defined at line 9 of file ../../zircon/kernel/lib/efi/testing/fake_disk_io_protocol.cc

void FakeDiskIoProtocol (const FakeDiskIoProtocol & )

Not copyable or movable.

Defined at line 35 of file ../../zircon/kernel/lib/efi/testing/include/lib/efi/testing/fake_disk_io_protocol.h

FakeDiskIoProtocol & operator= (const FakeDiskIoProtocol & )

Defined at line 36 of file ../../zircon/kernel/lib/efi/testing/include/lib/efi/testing/fake_disk_io_protocol.h

std::vector<uint8_t> & contents (uint32_t MediaId)

Returns the test disk contents for the given MediaId.

This can be modified to change what the disk looks like on subsequent

reads. If the given MediaId doesn't exist yet, a new empty disk will

be created and returned.

Trying to use the EFI APIs to read/write from a MediaId before it has

been created here will fail.

Defined at line 46 of file ../../zircon/kernel/lib/efi/testing/include/lib/efi/testing/fake_disk_io_protocol.h

efi_disk_io_protocol * protocol ()

Returns the underlying efi_disk_io_protocol struct.

Needs to be non-const to pass into the EFI functions, but callers should

not modify the struct.

Defined at line 51 of file ../../zircon/kernel/lib/efi/testing/include/lib/efi/testing/fake_disk_io_protocol.h