Various improvements: Toolbox, Updater and Unit Tests. (#2250)

* Toolbox: add seek to character stream method. UpdateUtils: reverse manifest iterator. UnitTests: more unit tests.
* Target: bump API version. Updater: delete empty folders from manifest before resource deployment.
* UnitTests: use manifest from unit_tests folder instead of global one
* Make PVS happy
* sector cache: allocate always
* Better PVS config for manifest.c
* PVS: Move exception outside of condition
* PVS: remove confusing condition

Co-authored-by: SG <who.just.the.doctor@gmail.com>
This commit is contained in:
あく
2023-01-06 15:31:17 +09:00
committed by GitHub
parent b8dd75884c
commit 41c43f4805
11 changed files with 398 additions and 24 deletions

View File

@@ -72,8 +72,32 @@ MU_TEST_1(stream_composite_subtest, Stream* stream) {
mu_check(stream_seek(stream, -3, StreamOffsetFromEnd));
mu_check(stream_tell(stream) == 4);
// test seeks to char. content: '1337_69'
stream_rewind(stream);
mu_check(stream_seek_to_char(stream, '3', StreamDirectionForward));
mu_check(stream_tell(stream) == 1);
mu_check(stream_seek_to_char(stream, '3', StreamDirectionForward));
mu_check(stream_tell(stream) == 2);
mu_check(stream_seek_to_char(stream, '_', StreamDirectionForward));
mu_check(stream_tell(stream) == 4);
mu_check(stream_seek_to_char(stream, '9', StreamDirectionForward));
mu_check(stream_tell(stream) == 6);
mu_check(!stream_seek_to_char(stream, '9', StreamDirectionForward));
mu_check(stream_tell(stream) == 6);
mu_check(stream_seek_to_char(stream, '_', StreamDirectionBackward));
mu_check(stream_tell(stream) == 4);
mu_check(stream_seek_to_char(stream, '3', StreamDirectionBackward));
mu_check(stream_tell(stream) == 2);
mu_check(stream_seek_to_char(stream, '3', StreamDirectionBackward));
mu_check(stream_tell(stream) == 1);
mu_check(!stream_seek_to_char(stream, '3', StreamDirectionBackward));
mu_check(stream_tell(stream) == 1);
mu_check(stream_seek_to_char(stream, '1', StreamDirectionBackward));
mu_check(stream_tell(stream) == 0);
// write string with replacemet
// "1337_69" -> "1337lee"
mu_check(stream_seek(stream, 4, StreamOffsetFromStart));
mu_check(stream_write_string(stream, string_lee) == 3);
mu_check(stream_size(stream) == 7);
mu_check(stream_tell(stream) == 7);