diff --git a/src/test/app/Loan_test.cpp b/src/test/app/Loan_test.cpp index dbb0033368..ae33459791 100644 --- a/src/test/app/Loan_test.cpp +++ b/src/test/app/Loan_test.cpp @@ -92,23 +92,6 @@ protected: // even if they are set to unsupported. FeatureBitset const all_{jtx::testableAmendments()}; - - // All 2^N permutations of `all_` with each subset of the given features - // excluded. The first entry is always `all_` itself (empty exclusion); - // the last excludes every feature in the list. - std::vector - amendmentCombinations(std::initializer_list features) const - { - std::vector result{all_}; - for (auto const& f : features) - { - auto const n = result.size(); - for (std::size_t i = 0; i < n; ++i) - result.push_back(result[i] - f); - } - return result; - } - std::string const iouCurrency_{"IOU"}; void @@ -8624,8 +8607,8 @@ public: run() override { runAmendmentIndependent(); - for (auto const& features : - amendmentCombinations({fixCleanup3_1_3, fixCleanup3_2_0, featureMPTokensV2})) + for (auto const& features : jtx::amendmentCombinations( + {fixCleanup3_1_3, fixCleanup3_2_0, featureMPTokensV2}, all_)) runAmendmentSensitive(features); } }; diff --git a/src/test/jtx/Env.h b/src/test/jtx/Env.h index 3d813d993c..90a73c3350 100644 --- a/src/test/jtx/Env.h +++ b/src/test/jtx/Env.h @@ -96,6 +96,19 @@ testableAmendments() return kIds; } +inline std::vector +amendmentCombinations(std::initializer_list features, FeatureBitset seed) +{ + std::vector result{seed}; + for (auto const& f : features) + { + auto const n = result.size(); + for (std::size_t i = 0; i < n; ++i) + result.push_back(result[i] - f); + } + return result; +} + //------------------------------------------------------------------------------ class SuiteLogs : public Logs diff --git a/src/test/jtx/impl/utility.cpp b/src/test/jtx/impl/utility.cpp index ead067d058..7da419c6e7 100644 --- a/src/test/jtx/impl/utility.cpp +++ b/src/test/jtx/impl/utility.cpp @@ -4,7 +4,6 @@ #include -#include #include #include #include @@ -12,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -23,8 +21,6 @@ #include #include -#include -#include #include #include @@ -104,18 +100,4 @@ cmdToJSONRPC(std::vector const& args, beast::Journal j, unsigned in jv[jss::id] = paramsObj[jss::id]; return jv; } - -std::vector -amendmentCombinations(std::initializer_list features, FeatureBitset seed) -{ - std::vector result{seed}; - for (auto const& f : features) - { - auto const n = result.size(); - for (std::size_t i = 0; i < n; ++i) - result.push_back(result[i] - f); - } - return result; -} - } // namespace xrpl::test::jtx diff --git a/src/test/jtx/utility.h b/src/test/jtx/utility.h index 8dbc34de63..597e006575 100644 --- a/src/test/jtx/utility.h +++ b/src/test/jtx/utility.h @@ -62,9 +62,5 @@ cmdToJSONRPC(std::vector const& args, beast::Journal j, unsigned in * Useful for running a test over every combination of optional amendments * so that each case is exercised both with and without each feature. */ -std::vector -amendmentCombinations( - std::initializer_list features, - FeatureBitset seed = testableAmendments()); } // namespace xrpl::test::jtx