mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibTLS+Userland: Remove all uses of ByteBuffer::slice_view()
This was another way to get a non-owning ByteBuffer wrapper.
This commit is contained in:
parent
d5600e966a
commit
b30acdb4b7
4 changed files with 21 additions and 21 deletions
|
@ -89,9 +89,9 @@ static bool test_single(const Testcase& testcase)
|
|||
|
||||
// Checking the results:
|
||||
bool return_ok = actual_return == testcase.src_n;
|
||||
bool canary_1_ok = actual.slice_view(0, SANDBOX_CANARY_SIZE) == expected.slice_view(0, SANDBOX_CANARY_SIZE);
|
||||
bool main_ok = actual.slice_view(SANDBOX_CANARY_SIZE, testcase.dest_n) == expected.slice_view(SANDBOX_CANARY_SIZE, testcase.dest_n);
|
||||
bool canary_2_ok = actual.slice_view(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE) == expected.slice_view(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE);
|
||||
bool canary_1_ok = actual.slice(0, SANDBOX_CANARY_SIZE) == expected.slice(0, SANDBOX_CANARY_SIZE);
|
||||
bool main_ok = actual.slice(SANDBOX_CANARY_SIZE, testcase.dest_n) == expected.slice(SANDBOX_CANARY_SIZE, testcase.dest_n);
|
||||
bool canary_2_ok = actual.slice(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE) == expected.slice(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE);
|
||||
bool buf_ok = actual == expected;
|
||||
|
||||
// Evaluate gravity:
|
||||
|
@ -102,20 +102,20 @@ static bool test_single(const Testcase& testcase)
|
|||
if (!canary_1_ok) {
|
||||
warnln("Canary 1 overwritten: Expected canary {}\n"
|
||||
" instead got {}",
|
||||
show(expected.slice_view(0, SANDBOX_CANARY_SIZE)),
|
||||
show(actual.slice_view(0, SANDBOX_CANARY_SIZE)));
|
||||
show(expected.slice(0, SANDBOX_CANARY_SIZE)),
|
||||
show(actual.slice(0, SANDBOX_CANARY_SIZE)));
|
||||
}
|
||||
if (!main_ok) {
|
||||
warnln("Wrong output: Expected {}\n"
|
||||
" instead got {}",
|
||||
show(expected.slice_view(SANDBOX_CANARY_SIZE, testcase.dest_n)),
|
||||
show(actual.slice_view(SANDBOX_CANARY_SIZE, testcase.dest_n)));
|
||||
show(expected.slice(SANDBOX_CANARY_SIZE, testcase.dest_n)),
|
||||
show(actual.slice(SANDBOX_CANARY_SIZE, testcase.dest_n)));
|
||||
}
|
||||
if (!canary_2_ok) {
|
||||
warnln("Canary 2 overwritten: Expected {}\n"
|
||||
" instead got {}",
|
||||
show(expected.slice_view(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE)),
|
||||
show(actual.slice_view(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE)));
|
||||
show(expected.slice(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE)),
|
||||
show(actual.slice(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE)));
|
||||
}
|
||||
if (!return_ok) {
|
||||
warnln("Wrong return value: Expected {}, got {} instead!", testcase.src_n, actual_return);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue