Remove using namespace beast in base_uint.h

This commit is contained in:
Joe Loser
2018-07-13 21:08:20 -04:00
committed by Nik Bougalis
parent 79d819584f
commit 70d9d88cda
62 changed files with 206 additions and 196 deletions

View File

@@ -35,13 +35,13 @@ public:
BEAST_EXPECT(z.exponent () == -100);
BEAST_EXPECT(!z);
BEAST_EXPECT(z.signum () == 0);
BEAST_EXPECT(z == zero);
BEAST_EXPECT(z == beast::zero);
BEAST_EXPECT((z + z) == z);
BEAST_EXPECT((z - z) == z);
BEAST_EXPECT(z == -z);
IOUAmount const zz (zero);
IOUAmount const zz (beast::zero);
BEAST_EXPECT(z == zz);
}
@@ -63,6 +63,8 @@ public:
{
testcase ("beast::Zero Comparisons");
using beast::zero;
{
IOUAmount z (zero);
BEAST_EXPECT(z == zero);
@@ -201,8 +203,8 @@ public:
// tiny negative numbers
IOUAmount tinyNeg (-minMantissa, minExponent);
// Round up should give zero
BEAST_EXPECT(zero == mulRatio (tinyNeg, 1, maxUInt, true));
BEAST_EXPECT(zero == mulRatio (tinyNeg, maxUInt - 1, maxUInt, true));
BEAST_EXPECT(beast::zero == mulRatio (tinyNeg, 1, maxUInt, true));
BEAST_EXPECT(beast::zero == mulRatio (tinyNeg, maxUInt - 1, maxUInt, true));
// rounding down should be tiny
BEAST_EXPECT(tinyNeg == mulRatio (tinyNeg, 1, maxUInt, false));
BEAST_EXPECT(tinyNeg == mulRatio (tinyNeg, maxUInt - 1, maxUInt, false));

View File

@@ -233,7 +233,7 @@ public:
raw (4131113916555555, -16)); // .4131113916555555
Amounts const result (
q.ceil_out (value, limit));
BEAST_EXPECT(result.in != zero);
BEAST_EXPECT(result.in != beast::zero);
}
}

View File

@@ -211,9 +211,9 @@ public:
unexpected (serializeAndDeserialize (hundred) != hundred, "STAmount fail");
unexpected (!zeroSt.native (), "STAmount fail");
unexpected (!hundred.native (), "STAmount fail");
unexpected (zeroSt != zero, "STAmount fail");
unexpected (one == zero, "STAmount fail");
unexpected (hundred == zero, "STAmount fail");
unexpected (zeroSt != beast::zero, "STAmount fail");
unexpected (one == beast::zero, "STAmount fail");
unexpected (hundred == beast::zero, "STAmount fail");
unexpected ((zeroSt < zeroSt), "STAmount fail");
unexpected (! (zeroSt < one), "STAmount fail");
unexpected (! (zeroSt < hundred), "STAmount fail");
@@ -294,9 +294,9 @@ public:
unexpected (serializeAndDeserialize (hundred) != hundred, "STAmount fail");
unexpected (zeroSt.native (), "STAmount fail");
unexpected (hundred.native (), "STAmount fail");
unexpected (zeroSt != zero, "STAmount fail");
unexpected (one == zero, "STAmount fail");
unexpected (hundred == zero, "STAmount fail");
unexpected (zeroSt != beast::zero, "STAmount fail");
unexpected (one == beast::zero, "STAmount fail");
unexpected (hundred == beast::zero, "STAmount fail");
unexpected ((zeroSt < zeroSt), "STAmount fail");
unexpected (! (zeroSt < one), "STAmount fail");
unexpected (! (zeroSt < hundred), "STAmount fail");
@@ -460,21 +460,21 @@ public:
STAmount smallXsmall = multiply (smallValue, smallValue, noIssue());
BEAST_EXPECT(smallXsmall == zero);
BEAST_EXPECT(smallXsmall == beast::zero);
STAmount bigDsmall = divide (smallValue, bigValue, noIssue());
BEAST_EXPECT(bigDsmall == zero);
BEAST_EXPECT(bigDsmall == beast::zero);
BEAST_EXPECT(bigDsmall == zero);
BEAST_EXPECT(bigDsmall == beast::zero);
bigDsmall = divide (smallValue, bigValue, xrpIssue ());
BEAST_EXPECT(bigDsmall == zero);
BEAST_EXPECT(bigDsmall == beast::zero);
bigDsmall = divide (smallValue, bigNative, xrpIssue ());
BEAST_EXPECT(bigDsmall == zero);
BEAST_EXPECT(bigDsmall == beast::zero);
// very bad offer
std::uint64_t r = getRate (smallValue, bigValue);

View File

@@ -46,6 +46,8 @@ public:
{
testcase ("beast::Zero Comparisons");
using beast::zero;
for (auto i : { -1, 0, 1})
{
XRPAmount const x (i);
@@ -145,8 +147,8 @@ public:
// tiny negative numbers
XRPAmount tinyNeg (-1);
// Round up should give zero
BEAST_EXPECT(zero == mulRatio (tinyNeg, 1, maxUInt32, true));
BEAST_EXPECT(zero == mulRatio (tinyNeg, maxUInt32 - 1, maxUInt32, true));
BEAST_EXPECT(beast::zero == mulRatio (tinyNeg, 1, maxUInt32, true));
BEAST_EXPECT(beast::zero == mulRatio (tinyNeg, maxUInt32 - 1, maxUInt32, true));
// rounding down should be tiny
BEAST_EXPECT(tinyNeg == mulRatio (tinyNeg, maxUInt32 - 1, maxUInt32, false));
}