mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:07:44 +00:00
AK+Everywhere: Change AK::fill_with_random to accept a Bytes object
Rather than the very C-like API we currently have, accepting a void* and a length, let's take a Bytes object instead. In almost all existing cases, the compiler figures out the length.
This commit is contained in:
parent
5c045b6934
commit
15532df83d
20 changed files with 37 additions and 39 deletions
|
@ -56,7 +56,7 @@ static bool test_single(Testcase const& testcase)
|
|||
|
||||
// Setup
|
||||
ByteBuffer actual = ByteBuffer::create_uninitialized(SANDBOX_CANARY_SIZE + testcase.dest_n + SANDBOX_CANARY_SIZE).release_value();
|
||||
fill_with_random(actual.data(), actual.size());
|
||||
fill_with_random(actual);
|
||||
ByteBuffer expected = actual;
|
||||
VERIFY(actual.offset_pointer(0) != expected.offset_pointer(0));
|
||||
actual.overwrite(SANDBOX_CANARY_SIZE, testcase.dest, testcase.dest_n);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue