Remove using namespace declarations at namespace scope in headers

This commit is contained in:
Scott Schurr
2018-08-03 11:42:39 -07:00
committed by seelabs
parent 4aa0bc37c0
commit 2901577be7
30 changed files with 74 additions and 38 deletions

View File

@@ -335,6 +335,7 @@ class Check_test : public beast::unit_test::suite
// expected interaction between these optional fields; other than
// the expiration, they are just plopped into the ledger. So I'm
// not looking at interactions.
using namespace std::chrono_literals;
std::size_t const aliceCount {checksOnAccount (env, alice).size()};
std::size_t const bobCount {checksOnAccount (env, bob).size()};
env (check::create (alice, bob, USD(50)), expiration (env.now() + 1s));
@@ -540,6 +541,7 @@ class Check_test : public beast::unit_test::suite
expiration (env.now()), ter (tecEXPIRED));
env.close();
using namespace std::chrono_literals;
env (check::create (alice, bob, USD(50)), expiration (env.now() + 1s));
env.close();
@@ -1341,6 +1343,7 @@ class Check_test : public beast::unit_test::suite
env (check::create (alice, bob, XRP(10)));
env.close();
using namespace std::chrono_literals;
uint256 const chkIdExp {getCheckIndex (alice, env.seq (alice))};
env (check::create (alice, bob, XRP(10)), expiration (env.now() + 1s));
env.close();
@@ -1615,6 +1618,7 @@ class Check_test : public beast::unit_test::suite
env.close();
// Three checks that expire in 10 minutes.
using namespace std::chrono_literals;
uint256 const chkIdNotExp1 {getCheckIndex (alice, env.seq (alice))};
env (check::create (alice, bob, XRP(10)), expiration (env.now()+600s));
env.close();

View File

@@ -259,6 +259,7 @@ public:
g.signal();
});
using namespace std::chrono_literals;
BEAST_EXPECT(g.wait_for(5s));
BEAST_EXPECT(! result.isMember(jss::error));
return result;

View File

@@ -101,6 +101,7 @@ class RCLValidations_test : public beast::unit_test::suite
std::vector<std::shared_ptr<Ledger const>> altHistory(
history.begin(), history.begin() + diverge);
// advance clock to get new ledgers
using namespace std::chrono_literals;
env.timeKeeper().set(env.timeKeeper().now() + 1200s);
prev = altHistory.back();
bool forceHash = true;

View File

@@ -277,6 +277,7 @@ class Ticket_test : public beast::unit_test::suite
Env env {*this, supported_amendments().set(featureTickets)};
// create and verify
using namespace std::chrono_literals;
uint32_t expire =
(env.timeKeeper ().closeTime () + 60s)
.time_since_epoch ().count ();

View File

@@ -265,6 +265,7 @@ class TrustAndBalance_test : public beast::unit_test::suite
env.close();
using namespace std::chrono_literals;
BEAST_EXPECT(wsc->findMsg(5s,
[](auto const& jv)
{
@@ -470,6 +471,7 @@ class TrustAndBalance_test : public beast::unit_test::suite
"00000000DEADBEEF");
env.close();
using namespace std::chrono_literals;
BEAST_EXPECT(wsc->findMsg(2s,
[](auto const& jv)
{

View File

@@ -145,6 +145,7 @@ class TxQ_test : public beast::unit_test::suite
// Close the ledger with a delay to force the TxQ stats
// to stay at the default.
using namespace std::chrono_literals;
env.close(env.now() + 5s, 10000ms);
checkMetrics(env, 0,
2 * (ripple::detail::supportedAmendments().size() + 1),
@@ -2463,6 +2464,7 @@ public:
checkMetrics(env, 0, boost::none, 4, 3, 256);
// First transaction establishes the messaging
using namespace std::chrono_literals;
BEAST_EXPECT(wsc->findMsg(5s,
[&](auto const& jv)
{

View File

@@ -409,6 +409,7 @@ private:
manifest1, expiredblob, expiredSig, version));
// apply single list
using namespace std::chrono_literals;
NetClock::time_point const expiration =
env.timeKeeper().now() + 3600s;
auto const blob1 = makeList (
@@ -764,6 +765,7 @@ private:
// do not apply expired list
auto const version = 1;
auto const sequence = 1;
using namespace std::chrono_literals;
NetClock::time_point const expiration =
env.timeKeeper().now() + 60s;
auto const blob = makeList (
@@ -929,6 +931,7 @@ private:
auto const version = 1;
auto const sequence = 1;
using namespace std::chrono_literals;
NetClock::time_point const expiration =
env.timeKeeper().now() + 3600s;
auto const blob = makeList (
@@ -1011,6 +1014,7 @@ private:
NetClock::time_point expiration;
};
using namespace std::chrono_literals;
auto addPublishedList = [this, &env, &trustedKeys, &validators]()
{
auto const publisherSecret = randomSecretKey();

View File

@@ -174,6 +174,7 @@ private:
auto const sequence = 1;
auto const version = 1;
using namespace std::chrono_literals;
NetClock::time_point const expiration =
env.timeKeeper().now() + 3600s;

View File

@@ -393,8 +393,6 @@ struct Peer
Ledger const*
acquireLedger(Ledger::ID const& ledgerID)
{
using namespace std::chrono;
auto it = ledgers.find(ledgerID);
if (it != ledgers.end())
return &(it->second);
@@ -411,7 +409,7 @@ struct Peer
return nullptr;
}
using namespace std::chrono_literals;
SimDuration minDuration{10s};
for (auto const& link : net.links(this))
{
@@ -457,6 +455,7 @@ struct Peer
return nullptr;
}
using namespace std::chrono_literals;
SimDuration minDuration{10s};
for (auto const& link : net.links(this))
{

View File

@@ -101,6 +101,7 @@ LedgerOracle::accept(
NetClock::duration closeTimeResolution,
NetClock::time_point const& consensusCloseTime)
{
using namespace std::chrono_literals;
Ledger::Instance next(*parent.instance_);
next.txs.insert(txs.begin(), txs.end());
next.seq = parent.seq() + Ledger::Seq{1};

View File

@@ -45,12 +45,12 @@ class HeartbeatTimer
public:
HeartbeatTimer(
Scheduler& sched,
SimDuration interval = std::chrono::seconds(60s),
std::ostream& out = std::cerr)
: scheduler_{sched}, interval_{interval}, out_{out},
startRealTime_{RealClock::now()},
startSimTime_{sched.now()}
Scheduler& sched,
SimDuration interval = std::chrono::seconds {60},
std::ostream& out = std::cerr)
: scheduler_{sched}, interval_{interval}, out_{out},
startRealTime_{RealClock::now()},
startSimTime_{sched.now()}
{
}

View File

@@ -130,6 +130,7 @@ Env::close(NetClock::time_point closeTime,
boost::optional<std::chrono::milliseconds> consensusDelay)
{
// Round up to next distinguishable value
using namespace std::chrono_literals;
closeTime += closed()->info().closeTimeResolution - 1s;
timeKeeper().set(closeTime);
// Go through the rpc interface unless we need to simulate

View File

@@ -1013,6 +1013,7 @@ public:
BEAST_EXPECT(jrOffer[jss::owner_funds] == "100");
BEAST_EXPECT(jrOffer[jss::quality] == "400000000");
using namespace std::chrono_literals;
BEAST_EXPECT(wsc->findMsg(5s,
[&](auto const& jv)
{
@@ -1156,6 +1157,7 @@ public:
env(offer(charlie, USD(1000), XRP(1000)));
env.close();
env.require(offers(alice, 0), offers(bob, 0), offers(charlie, 0));
using namespace std::chrono_literals;
BEAST_EXPECT(offerOnlyOnceInStream(wsc, 1s, XRP(1000), USD(1000)));
// RPC unsubscribe
@@ -1238,6 +1240,7 @@ public:
// Charlies places an on offer for EUR -> USD that should auto-bridge
env(offer(charlie, USD(1), EUR(1)));
env.close();
using namespace std::chrono_literals;
BEAST_EXPECT(offerOnlyOnceInStream(wsc, 1s, EUR(1), USD(1)));
// RPC unsubscribe

View File

@@ -666,6 +666,7 @@ class LedgerRPC_test : public beast::unit_test::suite
return jv;
};
using namespace std::chrono_literals;
env (escrowCreate (alice, alice, XRP(333), env.now() + 2s));
env.close();

View File

@@ -52,6 +52,7 @@ class Peers_test : public beast::unit_test::suite
std::string name = "Node " + std::to_string(i);
using namespace std::chrono_literals;
env.app().cluster().update(
kp.first,
name,

View File

@@ -360,6 +360,7 @@ public:
env.close();
// Check stream update
using namespace std::chrono_literals;
BEAST_EXPECT(wsc->findMsg(5s,
[&](auto const& jv)
{

View File

@@ -269,6 +269,7 @@ public:
//----------------------------------------------------------------------
// Publisher list site available
{
using namespace std::chrono_literals;
NetClock::time_point const expiration{3600s};
// Manage single thread io_service for server