Reformat code with clang-format-18

This commit is contained in:
John Freeman
2024-10-15 18:27:56 -05:00
committed by tequ
parent 0619030184
commit fbeb806ffd
94 changed files with 979 additions and 1063 deletions

View File

@@ -219,55 +219,56 @@ public:
tinyNeg == mulRatio(tinyNeg, maxUInt - 1, maxUInt, false));
}
{// rounding
{IOUAmount one(1, 0);
auto const rup = mulRatio(one, maxUInt - 1, maxUInt, true);
auto const rdown = mulRatio(one, maxUInt - 1, maxUInt, false);
BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1);
}
{ // rounding
{
IOUAmount one(1, 0);
auto const rup = mulRatio(one, maxUInt - 1, maxUInt, true);
auto const rdown = mulRatio(one, maxUInt - 1, maxUInt, false);
BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1);
}
{
IOUAmount big(maxMantissa, maxExponent);
auto const rup = mulRatio(big, maxUInt - 1, maxUInt, true);
auto const rdown = mulRatio(big, maxUInt - 1, maxUInt, false);
BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1);
}
{
IOUAmount negOne(-1, 0);
auto const rup = mulRatio(negOne, maxUInt - 1, maxUInt, true);
auto const rdown =
mulRatio(negOne, maxUInt - 1, maxUInt, false);
BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1);
}
}
{
// division by zero
IOUAmount one(1, 0);
except([&] { mulRatio(one, 1, 0, true); });
}
{
// overflow
IOUAmount big(maxMantissa, maxExponent);
except([&] { mulRatio(big, 2, 0, true); });
}
} // namespace ripple
//--------------------------------------------------------------------------
void
run() override
{
IOUAmount big(maxMantissa, maxExponent);
auto const rup = mulRatio(big, maxUInt - 1, maxUInt, true);
auto const rdown = mulRatio(big, maxUInt - 1, maxUInt, false);
BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1);
testZero();
testSigNum();
testBeastZero();
testComparisons();
testToString();
testMulRatio();
}
{
IOUAmount negOne(-1, 0);
auto const rup = mulRatio(negOne, maxUInt - 1, maxUInt, true);
auto const rdown = mulRatio(negOne, maxUInt - 1, maxUInt, false);
BEAST_EXPECT(rup.mantissa() - rdown.mantissa() == 1);
}
}
{
// division by zero
IOUAmount one(1, 0);
except([&] { mulRatio(one, 1, 0, true); });
}
{
// overflow
IOUAmount big(maxMantissa, maxExponent);
except([&] { mulRatio(big, 2, 0, true); });
}
} // namespace ripple
//--------------------------------------------------------------------------
void
run() override
{
testZero();
testSigNum();
testBeastZero();
testComparisons();
testToString();
testMulRatio();
}
}
;
};
BEAST_DEFINE_TESTSUITE(IOUAmount, protocol, ripple);
} // ripple
} // namespace ripple