1#include <xrpl/beast/unit_test.h>
2#include <xrpl/beast/unit_test/suite.h>
3#include <xrpl/json/json_forwards.h>
4#include <xrpl/protocol/Issue.h>
5#include <xrpl/protocol/STAmount.h>
6#include <xrpl/protocol/STNumber.h>
19 STNumber const before{sfNumber, number};
20 BEAST_EXPECT(number == before);
23 BEAST_EXPECT(s.
size() == 12);
26 BEAST_EXPECT(
after.isEquivalent(before));
27 BEAST_EXPECT(number ==
after);
37 BEAST_EXPECT(stnum.getSType() == STI_NUMBER);
38 BEAST_EXPECT(stnum.getText() ==
"0");
39 BEAST_EXPECT(stnum.isDefault() ==
true);
40 BEAST_EXPECT(stnum.value() ==
Number{0});
59 STNumber const factor{sfNumber, 100};
60 auto const iouValue = strikePrice.iou();
63 BEAST_EXPECT(totalAmount ==
Number{10'000});
138 BEAST_EXPECT(e.
what() == expected);
148 std::string const expected =
"'e' is not a number";
149 BEAST_EXPECT(e.
what() == expected);
159 std::string const expected =
"'1e' is not a number";
160 BEAST_EXPECT(e.
what() == expected);
170 std::string const expected =
"'e2' is not a number";
171 BEAST_EXPECT(e.
what() == expected);
182 BEAST_EXPECT(e.
what() == expected);
189 "1234567890123456789012345678901234567890123456789012345678"
190 "9012345678901234567890123456789012345678901234567890123456"
191 "78901234567890123456789012345678901234567890");
207 std::string const expected =
"'001' is not a number";
208 BEAST_EXPECT(e.
what() == expected);
218 std::string const expected =
"'000.0' is not a number";
219 BEAST_EXPECT(e.
what() == expected);
230 std::string const expected =
"'.1' is not a number";
231 BEAST_EXPECT(e.
what() == expected);
241 std::string const expected =
"'1.' is not a number";
242 BEAST_EXPECT(e.
what() == expected);
252 std::string const expected =
"'1.e3' is not a number";
253 BEAST_EXPECT(e.
what() == expected);
Floating point representation of amounts with high dynamic range.
static constexpr int maxExponent
static constexpr int minExponent
Issue const & issue() const
std::size_t size() const noexcept
Slice slice() const noexcept
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void testCompile(std::ostream &out)
Issue const & noIssue()
Returns an asset specifier that represents no account and currency.
STNumber numberFromJson(SField const &field, Json::Value const &value)
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
void testCombo(Number number)
void run() override
Runs the suite.