diff options
author | Angus Gratton <angus@redyak.com.au> | 2024-09-04 15:19:20 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-09-26 22:08:48 +1000 |
commit | f4ab9d924790581989f2398fe30bbac5d680577f (patch) | |
tree | e9ae7d243a891dbed84abe278f61941a503c4f14 /tests/extmod/vfs_blockdev_invalid.py | |
parent | 4f6d4b2b498b0555c3b27eba2fa4e212468e1450 (diff) |
extmod/vfs_blockdev: Implement common helper for read and write.
- Code size saving as all of these functions are very similar.
- Resolves the "TODO" of the plain read and write functions not propagating
errors. An error in the underlying block device now causes VFatFs to
return EIO, for example.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'tests/extmod/vfs_blockdev_invalid.py')
-rw-r--r-- | tests/extmod/vfs_blockdev_invalid.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/extmod/vfs_blockdev_invalid.py b/tests/extmod/vfs_blockdev_invalid.py index 80afc6414..9b12746b2 100644 --- a/tests/extmod/vfs_blockdev_invalid.py +++ b/tests/extmod/vfs_blockdev_invalid.py @@ -52,6 +52,8 @@ except MemoryError: def test(vfs_class): print(vfs_class) + bdev.read_res = 0 # reset function results + bdev.write_res = 0 vfs_class.mkfs(bdev) fs = vfs_class(bdev) @@ -84,4 +86,4 @@ def test(vfs_class): test(vfs.VfsLfs2) -test(vfs.VfsFat) # Looks like most failures of underlying device are ignored by VFAT currently +test(vfs.VfsFat) |