mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 09:46:53 +00:00
infinite loop test (#6064)
This commit is contained in:
@@ -467,6 +467,20 @@ struct Wasm_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(countSubstr(s, "exception: <finish> failure") > 0);
|
||||
}
|
||||
|
||||
{ // infinite loop
|
||||
auto const wasmStr = boost::algorithm::unhex(infiniteLoopWasmHex);
|
||||
Bytes wasm(wasmStr.begin(), wasmStr.end());
|
||||
std::string const funcName("loop");
|
||||
TestHostFunctions hfs(env, 0);
|
||||
|
||||
// infinite loop should be caught and fail
|
||||
auto const re = runEscrowWasm(wasm, hfs, funcName, {}, 1'000'000);
|
||||
if (BEAST_EXPECT(!re.has_value()))
|
||||
{
|
||||
BEAST_EXPECT(re.error() == tecFAILED_PROCESSING);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// expected import not provided
|
||||
auto wasmStr = boost::algorithm::unhex(ledgerSqnWasmHex);
|
||||
|
||||
Reference in New Issue
Block a user