Unit tests don't enable Tickets or SHAMapV2 by default:

Both Tickets and SHAMapV2 have been around for a while and don't
look like they will be enabled on the network soon.  So they are
removed from the supportedAmendments list.  This prevents Env
from automatically testing with Tickets or SHAMapV2 enabled,
although testing with those features can still be explicitly
specified.

Drive-by cleanups:

o supportedAmendments() returns a const reference rather than
  a fresh vector on each call.

o supportedAmendments() implementation moved from Amendments.cpp
  to Feature.cpp.  Amendments.cpp deleted.

o supportedAmendments() declared in Feature.h.  All other
  declarations deleted.

o preEnabledAmendments() removed, since it was empty and only
  used in one place.  It will be easy to re-add when it is needed.

o jtx::all_features_except() renamed to
  jtx::supported_features_except(), which is more descriptive.

o jtx::all_amendments() renamed to jxt::supported_amendments()

o jtx::with_features() renamed to with_only_features()

o Env_test.cpp adjusted since featureTickets is no longer
  automatically enabled for unit tests.
This commit is contained in:
Scott Schurr
2017-08-03 16:26:40 -07:00
committed by seelabs
parent 07e3f81b76
commit feb7582aca
34 changed files with 282 additions and 345 deletions

View File

@@ -237,7 +237,7 @@ public:
{
testcase ("Setting transfer rate (without fix1201)");
doTests (all_features_except(fix1201),
doTests (supported_features_except(fix1201),
{
{ 1.0, tesSUCCESS, 1.0 },
{ 1.1, tesSUCCESS, 1.1 },
@@ -250,7 +250,7 @@ public:
{
testcase ("Setting transfer rate (with fix1201)");
doTests (all_amendments(),
doTests (supported_amendments(),
{
{ 1.0, tesSUCCESS, 1.0 },
{ 1.1, tesSUCCESS, 1.1 },
@@ -290,16 +290,16 @@ public:
};
// Test gateway with allowed transfer rates
runTest (Env{*this, all_features_except(fix1201)}, 1.02);
runTest (Env{*this, all_features_except(fix1201)}, 1);
runTest (Env{*this, all_features_except(fix1201)}, 2);
runTest (Env{*this, all_features_except(fix1201)}, 2.1);
runTest (Env{*this, all_amendments()}, 1.02);
runTest (Env{*this, all_amendments()}, 2);
runTest (Env{*this, supported_features_except(fix1201)}, 1.02);
runTest (Env{*this, supported_features_except(fix1201)}, 1);
runTest (Env{*this, supported_features_except(fix1201)}, 2);
runTest (Env{*this, supported_features_except(fix1201)}, 2.1);
runTest (Env{*this, supported_amendments()}, 1.02);
runTest (Env{*this, supported_amendments()}, 2);
// Test gateway when amendment is set after transfer rate
{
Env env (*this, all_features_except(fix1201));
Env env (*this, supported_features_except(fix1201));
Account const alice ("alice");
Account const bob ("bob");
Account const gw ("gateway");
@@ -371,7 +371,7 @@ public:
void testRequireAuthWithDir()
{
using namespace test::jtx;
Env env(*this, with_features(featureMultiSign));
Env env(*this, with_only_features(featureMultiSign));
Account const alice ("alice");
Account const bob ("bob");