Disk: Allow mismatched access for Read and Write drivers

This will cause the driver to fall back to the least common
denominator.
This commit is contained in:
Paul Hollinsky
2022-03-03 20:29:13 -05:00
parent 1118428250
commit 0a15adbe91
9 changed files with 56 additions and 7 deletions
+3 -1
View File
@@ -15,7 +15,6 @@ using namespace icsneo;
class MockDiskDriver : public Disk::ReadDriver, public Disk::WriteDriver {
public:
Disk::Access getAccess() const override { return Disk::Access::EntireCard; }
std::pair<uint32_t, uint32_t> getBlockSizeBounds() const override { return { 8, 256 }; }
optional<uint64_t> readLogicalDiskAligned(Communication&, device_eventhandler_t,
@@ -74,6 +73,9 @@ public:
size_t atomicityChecks = 0;
bool supportsAtomic = true; // Ability to simulate a driver that doesn't support atomic writes
std::function<void(void)> afterReadHook;
private:
Disk::Access getPossibleAccess() const override { return Disk::Access::EntireCard; }
};
class DiskDriverTest : public ::testing::Test {