1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:07:45 +00:00

AK: Rename Stream::read_entire_buffer to Stream::read_until_filled

No functional changes.
This commit is contained in:
Tim Schumacher 2023-03-01 15:27:35 +01:00 committed by Linus Groh
parent d5871f5717
commit a3f73e7d85
31 changed files with 58 additions and 58 deletions

View file

@ -90,17 +90,17 @@ TEST_CASE(file_seeking_around)
EXPECT(!file->seek(500, SeekMode::SetPosition).is_error());
EXPECT_EQ(file->tell().release_value(), 500ul);
EXPECT(!file->read_entire_buffer(buffer).is_error());
EXPECT(!file->read_until_filled(buffer).is_error());
EXPECT_EQ(buffer_contents, expected_seek_contents1);
EXPECT(!file->seek(234, SeekMode::FromCurrentPosition).is_error());
EXPECT_EQ(file->tell().release_value(), 750ul);
EXPECT(!file->read_entire_buffer(buffer).is_error());
EXPECT(!file->read_until_filled(buffer).is_error());
EXPECT_EQ(buffer_contents, expected_seek_contents2);
EXPECT(!file->seek(-105, SeekMode::FromEndPosition).is_error());
EXPECT_EQ(file->tell().release_value(), 8597ul);
EXPECT(!file->read_entire_buffer(buffer).is_error());
EXPECT(!file->read_until_filled(buffer).is_error());
EXPECT_EQ(buffer_contents, expected_seek_contents3);
}
@ -123,7 +123,7 @@ TEST_CASE(file_adopt_fd)
EXPECT(!file->seek(500, SeekMode::SetPosition).is_error());
EXPECT_EQ(file->tell().release_value(), 500ul);
EXPECT(!file->read_entire_buffer(buffer).is_error());
EXPECT(!file->read_until_filled(buffer).is_error());
EXPECT_EQ(buffer_contents, expected_seek_contents1);
// A single seek & read test should be fine for now.

View file

@ -18,7 +18,7 @@ static DeprecatedString read_all(DeprecatedString const& path)
auto file = MUST(Core::File::open(path, Core::File::OpenMode::Read));
auto file_size = MUST(file->size());
auto content = MUST(ByteBuffer::create_uninitialized(file_size));
MUST(file->read_entire_buffer(content.bytes()));
MUST(file->read_until_filled(content.bytes()));
return DeprecatedString { content.bytes() };
}

View file

@ -17,7 +17,7 @@ static DeprecatedString read_all(DeprecatedString const& path)
auto file = MUST(Core::File::open(path, Core::File::OpenMode::Read));
auto file_size = MUST(file->size());
auto content = MUST(ByteBuffer::create_uninitialized(file_size));
MUST(file->read_entire_buffer(content.bytes()));
MUST(file->read_until_filled(content.bytes()));
return DeprecatedString { content.bytes() };
}

View file

@ -22,7 +22,7 @@ TEST_SETUP
auto file = file_or_error.release_value();
auto file_size = MUST(file->size());
auto content = MUST(ByteBuffer::create_uninitialized(file_size));
MUST(file->read_entire_buffer(content.bytes()));
MUST(file->read_until_filled(content.bytes()));
DeprecatedString test_data { content.bytes() };
auto tests = JsonParser(test_data).parse().value().as_array();