Minimize use of jtx::with_only_features (RIPD-1515):

In order to automatically run unit tests with newly created
amendments, prefer to start with jtx::supported_features() and
then subtract unwanted features.

These changes identified a few bugs that were hiding in
amendments.  One of those bugs, in FlowCross, is not yet fixed.
By uncommenting the test in CrossingLimits_test.cpp you can see
failures relating to that bug.  Since FlowCross is not yet
enabled on the network we can fix the bug at our convenience.
This commit is contained in:
Scott Schurr
2017-08-16 18:30:55 -07:00
committed by seelabs
parent aa76632bb3
commit 3523cee63d
30 changed files with 826 additions and 658 deletions

View File

@@ -37,11 +37,11 @@ class Discrepancy_test : public beast::unit_test::suite
// A payment with path and sendmax is made and the transaction is queried
// to verify that the net of balance changes match the fee charged.
void
testXRPDiscrepancy (std::initializer_list<uint256> fs)
testXRPDiscrepancy (FeatureBitset features)
{
testcase ("Discrepancy test : XRP Discrepancy");
using namespace test::jtx;
Env env {*this, with_only_features(fs)};
Env env {*this, features};
Account A1 {"A1"};
Account A2 {"A2"};
@@ -144,10 +144,14 @@ class Discrepancy_test : public beast::unit_test::suite
public:
void run ()
{
testXRPDiscrepancy ({});
testXRPDiscrepancy ({featureFlow});
testXRPDiscrepancy ({featureFlow, fix1373});
testXRPDiscrepancy ({featureFlow, fix1373, featureFlowCross});
using namespace test::jtx;
testXRPDiscrepancy (
supported_features_except (featureFlow, fix1373, featureFlowCross));
testXRPDiscrepancy (
supported_features_except ( fix1373, featureFlowCross));
testXRPDiscrepancy (
supported_features_except ( featureFlowCross));
testXRPDiscrepancy (supported_amendments());
}
};