From 7d63654221ba8b51787001511de385bffe3d3558 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Mon, 25 Mar 2024 22:34:34 +0000 Subject: [PATCH] Increase unit tests coverage --- src/test/app/AMM_test.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/test/app/AMM_test.cpp b/src/test/app/AMM_test.cpp index e7e9d0e91c7..82659a989fb 100644 --- a/src/test/app/AMM_test.cpp +++ b/src/test/app/AMM_test.cpp @@ -3693,6 +3693,32 @@ struct AMM_test : public jtx::AMMTest Env env{*this, feature}; fund(env, gw, {alice}, {USD(1'000)}, Fund::All); AMM amm(env, alice, XRP(1'000), USD(1'000), ter(temDISABLED)); + amm.bid( + alice, + 1000, + std::nullopt, + {}, + std::nullopt, + std::nullopt, + std::nullopt, + ter(temMALFORMED)); + amm.vote( + std::nullopt, + 100, + std::nullopt, + std::nullopt, + std::nullopt, + ter(temDISABLED)); + amm.withdraw( + alice, 100, std::nullopt, std::nullopt, ter(temMALFORMED)); + amm.deposit( + alice, + USD(100), + std::nullopt, + std::nullopt, + std::nullopt, + ter(temDISABLED)); + amm.ammDelete(alice, ter(temDISABLED)); } } @@ -4391,6 +4417,9 @@ struct AMM_test : public jtx::AMMTest amm.ammDelete(alice); BEAST_EXPECT(!amm.ammExists()); BEAST_EXPECT(!env.le(keylet::ownerDir(amm.ammAccount()))); + + // Try redundant delete + amm.ammDelete(alice, ter(terNO_AMM)); } }