diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-04 20:26:14 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-05 09:16:39 +0200 |
commit | 1370963723917eed6c93e28c9970a2b27be57ea4 (patch) | |
tree | 14c6e45fc1a4ccd1721823d65edd8a892135e23d /lib/io/test | |
parent | 8af4ee6f415fe316894e4423235dfc4ee70d8cbb (diff) |
libio: remove buffer_offset from istream_t
Instead, make the buffer const, let the user adjust the pointer and
size. The offset can then be inferred in precache.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/io/test')
-rw-r--r-- | lib/io/test/istream_read.c | 2 | ||||
-rw-r--r-- | lib/io/test/istream_skip.c | 2 | ||||
-rw-r--r-- | lib/io/test/stream_splice.c | 2 | ||||
-rw-r--r-- | lib/io/test/xfrm.c | 1 |
4 files changed, 3 insertions, 4 deletions
diff --git a/lib/io/test/istream_read.c b/lib/io/test/istream_read.c index 87e52c5..7029c38 100644 --- a/lib/io/test/istream_read.c +++ b/lib/io/test/istream_read.c @@ -101,7 +101,7 @@ int main(int argc, char **argv) } TEST_ASSERT(dummy->eof); - TEST_ASSERT(dummy->buffer_offset >= dummy->buffer_used); + TEST_ASSERT(dummy->buffer_used == 0); sqfs_drop(dummy); return EXIT_SUCCESS; } diff --git a/lib/io/test/istream_skip.c b/lib/io/test/istream_skip.c index 40d4ea4..c54a9cd 100644 --- a/lib/io/test/istream_skip.c +++ b/lib/io/test/istream_skip.c @@ -90,7 +90,7 @@ int main(int argc, char **argv) } TEST_ASSERT(dummy->eof); - TEST_ASSERT(dummy->buffer_offset >= dummy->buffer_used); + TEST_ASSERT(dummy->buffer_used == 0); sqfs_drop(dummy); return EXIT_SUCCESS; } diff --git a/lib/io/test/stream_splice.c b/lib/io/test/stream_splice.c index 9008d83..ab8a0e4 100644 --- a/lib/io/test/stream_splice.c +++ b/lib/io/test/stream_splice.c @@ -92,7 +92,7 @@ int main(int argc, char **argv) } TEST_ASSERT(in->eof); - TEST_ASSERT(in->buffer_offset >= in->buffer_used); + TEST_ASSERT(in->buffer_used == 0); TEST_EQUAL_UI(total, end2); TEST_EQUAL_UI(out_offset, end2); sqfs_drop(in); diff --git a/lib/io/test/xfrm.c b/lib/io/test/xfrm.c index d06c558..ffb1f37 100644 --- a/lib/io/test/xfrm.c +++ b/lib/io/test/xfrm.c @@ -440,7 +440,6 @@ static void run_unpack_test(const void *blob, size_t size) TEST_EQUAL_I(ret, 0); TEST_EQUAL_UI(mem_istream->buffer_used, 0); - TEST_EQUAL_UI(mem_istream->buffer_offset, 0); TEST_ASSERT(mem_istream->eof); sqfs_drop(istream); |