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

@@ -126,7 +126,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Cancel Nonexistent");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
env (ticket::cancel (env.master, idOne), ter (tecNO_ENTRY));
}
@@ -135,7 +135,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Create/Cancel Ticket with Bad Fee, Fail Preflight");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
env (ticket::create (env.master), fee (XRP (-1)), ter (temBAD_FEE));
env (ticket::cancel (env.master, idOne), fee (XRP (-1)), ter (temBAD_FEE));
@@ -146,7 +146,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Create Tickets with Nonexistent Accounts");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
Account alice {"alice"};
env.memoize (alice);
@@ -162,7 +162,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Create Tickets with Same Account and Target");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
env (ticket::create (env.master, env.master));
auto cr = checkTicketMeta (env);
@@ -183,7 +183,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Create Ticket and Then Cancel by Creator");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
// create and verify
env (ticket::create (env.master));
@@ -215,7 +215,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Create Ticket Insufficient Reserve");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
Account alice {"alice"};
env.fund (env.current ()->fees ().accountReserve (0), alice);
@@ -229,7 +229,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Create Ticket and Then Cancel by Target");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
Account alice {"alice"};
env.fund (XRP (10000), alice);
@@ -275,7 +275,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Create Ticket with Future Expiration");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
// create and verify
uint32_t expire =
@@ -300,7 +300,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Create Ticket with Zero Expiration");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
// create and verify
env (ticket::create (env.master, 0u), ter (temBAD_EXPIRATION));
@@ -311,7 +311,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Create Ticket with Past Expiration");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
env.timeKeeper ().adjustCloseTime (days {2});
env.close ();
@@ -340,7 +340,7 @@ class Ticket_test : public beast::unit_test::suite
testcase ("Create Ticket and Allow to Expire");
using namespace test::jtx;
Env env {*this, with_features (featureTickets)};
Env env {*this, with_only_features (featureTickets)};
// create and verify
uint32_t expire =