|
@@ -72,9 +72,9 @@ static bool test_single(Testcase<TArg> const& testcase)
|
|
|
|
|
|
// Checking the results:
|
|
// Checking the results:
|
|
bool return_ok = actual_return == testcase.expected_return;
|
|
bool return_ok = actual_return == testcase.expected_return;
|
|
- 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 canary_1_ok = MUST(actual.slice(0, SANDBOX_CANARY_SIZE)) == MUST(expected.slice(0, SANDBOX_CANARY_SIZE));
|
|
|
|
+ bool main_ok = MUST(actual.slice(SANDBOX_CANARY_SIZE, testcase.dest_n)) == MUST(expected.slice(SANDBOX_CANARY_SIZE, testcase.dest_n));
|
|
|
|
+ bool canary_2_ok = MUST(actual.slice(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE)) == MUST(expected.slice(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE));
|
|
bool buf_ok = actual == expected;
|
|
bool buf_ok = actual == expected;
|
|
|
|
|
|
// Evaluate gravity:
|
|
// Evaluate gravity:
|
|
@@ -85,20 +85,20 @@ static bool test_single(Testcase<TArg> const& testcase)
|
|
if (!canary_1_ok) {
|
|
if (!canary_1_ok) {
|
|
warnln("Canary 1 overwritten: Expected {}\n"
|
|
warnln("Canary 1 overwritten: Expected {}\n"
|
|
" instead got {}",
|
|
" instead got {}",
|
|
- show(expected.slice(0, SANDBOX_CANARY_SIZE)),
|
|
|
|
- show(actual.slice(0, SANDBOX_CANARY_SIZE)));
|
|
|
|
|
|
+ show(MUST(expected.slice(0, SANDBOX_CANARY_SIZE))),
|
|
|
|
+ show(MUST(actual.slice(0, SANDBOX_CANARY_SIZE))));
|
|
}
|
|
}
|
|
if (!main_ok) {
|
|
if (!main_ok) {
|
|
warnln("Wrong output: Expected {}\n"
|
|
warnln("Wrong output: Expected {}\n"
|
|
" instead, got {}",
|
|
" instead, got {}",
|
|
- show(expected.slice(SANDBOX_CANARY_SIZE, testcase.dest_n)),
|
|
|
|
- show(actual.slice(SANDBOX_CANARY_SIZE, testcase.dest_n)));
|
|
|
|
|
|
+ show(MUST(expected.slice(SANDBOX_CANARY_SIZE, testcase.dest_n))),
|
|
|
|
+ show(MUST(actual.slice(SANDBOX_CANARY_SIZE, testcase.dest_n))));
|
|
}
|
|
}
|
|
if (!canary_2_ok) {
|
|
if (!canary_2_ok) {
|
|
warnln("Canary 2 overwritten: Expected {}\n"
|
|
warnln("Canary 2 overwritten: Expected {}\n"
|
|
" instead, got {}",
|
|
" instead, got {}",
|
|
- show(expected.slice(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE)),
|
|
|
|
- show(actual.slice(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE)));
|
|
|
|
|
|
+ show(MUST(expected.slice(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE))),
|
|
|
|
+ show(MUST(actual.slice(SANDBOX_CANARY_SIZE + testcase.dest_n, SANDBOX_CANARY_SIZE))));
|
|
}
|
|
}
|
|
if (!return_ok) {
|
|
if (!return_ok) {
|
|
warnln("Wrong return value: Expected {}, got {} instead!", testcase.expected_return, actual_return);
|
|
warnln("Wrong return value: Expected {}, got {} instead!", testcase.expected_return, actual_return);
|