mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:28:11 +00:00
Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe
This commit is contained in:
parent
3a9f00c59b
commit
97e97bccab
105 changed files with 629 additions and 290 deletions
|
@ -18,7 +18,7 @@ TEST_CASE(can_write)
|
|||
{ 7, 8, 9 },
|
||||
};
|
||||
|
||||
auto buffer = ByteBuffer::create_uninitialized(1024);
|
||||
auto buffer = ByteBuffer::create_uninitialized(1024).release_value();
|
||||
OutputMemoryStream stream { buffer };
|
||||
|
||||
Writer::CSV csv(stream, data);
|
||||
|
@ -39,7 +39,7 @@ TEST_CASE(can_write_with_header)
|
|||
{ 7, 8, 9 },
|
||||
};
|
||||
|
||||
auto buffer = ByteBuffer::create_uninitialized(1024);
|
||||
auto buffer = ByteBuffer::create_uninitialized(1024).release_value();
|
||||
OutputMemoryStream stream { buffer };
|
||||
|
||||
Writer::CSV csv(stream, data, { "A", "B\"", "C" });
|
||||
|
@ -60,7 +60,7 @@ TEST_CASE(can_write_with_different_behaviours)
|
|||
{ "We\"ll", "Hello,", " Friends" },
|
||||
};
|
||||
|
||||
auto buffer = ByteBuffer::create_uninitialized(1024);
|
||||
auto buffer = ByteBuffer::create_uninitialized(1024).release_value();
|
||||
OutputMemoryStream stream { buffer };
|
||||
|
||||
Writer::CSV csv(stream, data, { "A", "B\"", "C" }, Writer::WriterBehaviour::QuoteOnlyInFieldStart | Writer::WriterBehaviour::WriteHeaders);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue