mirror of
https://github.com/Xahau/xahaud.git
synced 2026-04-29 15:37:46 +00:00
test: add forAllApiVersions helper function (#4611)
Introduce a new variadic template helper function, `forAllApiVersions`, that accepts callables to execute a set of functions over a range of versions - from RPC::apiMinimumSupportedVersion to RPC::apiBetaVersion. This avoids the duplication of code. Context: #4552
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include <ripple/beast/unit_test.h>
|
||||
#include <ripple/protocol/ErrorCodes.h>
|
||||
#include <ripple/protocol/jss.h>
|
||||
#include <ripple/rpc/impl/RPCHelpers.h>
|
||||
#include <test/app/Import_json.h>
|
||||
#include <test/jtx.h>
|
||||
|
||||
@@ -2455,13 +2454,8 @@ public:
|
||||
testQueue();
|
||||
testLedgerAccountsOption();
|
||||
|
||||
// version specific tests
|
||||
for (auto testVersion = RPC::apiMinimumSupportedVersion;
|
||||
testVersion <= RPC::apiBetaVersion;
|
||||
++testVersion)
|
||||
{
|
||||
testLedgerEntryInvalidParams(testVersion);
|
||||
}
|
||||
test::jtx::forAllApiVersions(std::bind_front(
|
||||
&LedgerRPC_test::testLedgerEntryInvalidParams, this));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user