infinite loop test (#6064)

This commit is contained in:
Mayukha Vadari
2026-01-07 11:51:58 -05:00
committed by GitHub
parent a98269f049
commit f57f67a8ae
4 changed files with 40 additions and 0 deletions

View File

@@ -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);