third_party_littlefs/tests
Christopher Haster 12e464e9c3 Fixed issue with writes following a truncate
The problem was not setting the file state correctly after the truncate.
To truncate < size, we end up using the cache to traverse the ctz
skip-list far away from where our file->pos is.

We can leave the last block in the cache in case we're going to append
to the file, but if we do this we need to set up file->block+file->off
to tell use where we are in the file, and set the LFS_F_READING flag to
indicate that our cache contains read data.

Note this is different than the LFS_F_DIRTY, which we need also. The
purpose of the flags are as follows:
- LFS_F_DIRTY - file ctz skip-list branch is out of sync with
  filesystem, need to update metadata
- LFS_F_READING - file cache is in use for reading, need to drop cache
- LFS_F_WRITING - file cache is in use for writing, need to write out
  cache to disk

The difference between flags is subtle but important because read/prog
caches are handled differently. Prog caches have asserts in place to
catch programs without erases (the infamous pcache->block == 0xffffffff
assert).

Though maybe the names deserve an update...

Found by ebinans
2019-05-23 16:43:10 -05:00
..
corrupt.py Cleaned up tag encoding, now with clear chunk field 2019-01-13 23:56:01 -06:00
debug.py Cleaned up tag encoding, now with clear chunk field 2019-01-13 23:56:01 -06:00
stats.py Added allocation randomization for dynamic wear-leveling 2018-10-18 09:55:47 -05:00
template.fmt Changed lookahead configuration unit to bytes instead of bits 2018-10-18 10:00:49 -05:00
test_alloc.sh Cleaned up tag encoding, now with clear chunk field 2019-01-13 23:56:01 -06:00
test_attrs.sh Changed custom attribute descriptors to used arrays 2019-01-13 23:56:53 -06:00
test_corrupt.sh Fixed mkdir when inserting into a non-end block 2018-10-18 10:00:49 -05:00
test_dirs.sh Merge remote-tracking branch 'origin/master' into v2-rebase-part2 2018-10-20 21:02:25 -05:00
test_entries.sh Fixed testing issues introduced by expanding superblocks 2018-10-16 20:18:24 -05:00
test_files.sh Switched to strongly ordered directories 2018-10-18 10:00:49 -05:00
test_format.sh Cleaned up tag encoding, now with clear chunk field 2019-01-13 23:56:01 -06:00
test_interspersed.sh Renamed test_parallel tests to test_interespersed 2018-04-08 17:31:09 -05:00
test_move.sh Switched to strongly ordered directories 2018-10-18 10:00:49 -05:00
test_orphan.sh Added allocation randomization for dynamic wear-leveling 2018-10-18 09:55:47 -05:00
test_paths.sh Fixed several small issues 2019-02-12 00:01:28 -06:00
test_seek.sh Merge remote-tracking branch 'origin/master' into v2-rebase-part2 2018-10-20 21:02:25 -05:00
test_truncate.sh Fixed issue with writes following a truncate 2019-05-23 16:43:10 -05:00
test.py Added tests for resizable entries and custom attributes 2018-10-09 23:02:57 -05:00