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/SField.h>
6#include <xrpl/protocol/STAmount.h>
7#include <xrpl/protocol/STNumber.h>
20 STNumber const before{sfNumber, number};
21 BEAST_EXPECT(number == before);
24 BEAST_EXPECT(s.
size() == 12);
27 BEAST_EXPECT(
after.isEquivalent(before));
28 BEAST_EXPECT(number ==
after);
38 BEAST_EXPECT(stnum.getSType() == STI_NUMBER);
39 BEAST_EXPECT(stnum.getText() ==
"0");
40 BEAST_EXPECT(stnum.isDefault() ==
true);
41 BEAST_EXPECT(stnum.value() ==
Number{0});
60 STNumber const factor{sfNumber, 100};
61 auto const iouValue = strikePrice.iou();
64 BEAST_EXPECT(totalAmount ==
Number{10'000});
163 BEAST_EXPECT(e.
what() == expected);
173 std::string const expected =
"'e' is not a number";
174 BEAST_EXPECT(e.
what() == expected);
184 std::string const expected =
"'1e' is not a number";
185 BEAST_EXPECT(e.
what() == expected);
195 std::string const expected =
"'e2' is not a number";
196 BEAST_EXPECT(e.
what() == expected);
207 BEAST_EXPECT(e.
what() == expected);
214 "1234567890123456789012345678901234567890123456789012345678"
215 "9012345678901234567890123456789012345678901234567890123456"
216 "78901234567890123456789012345678901234567890");
232 std::string const expected =
"'001' is not a number";
233 BEAST_EXPECT(e.
what() == expected);
243 std::string const expected =
"'000.0' is not a number";
244 BEAST_EXPECT(e.
what() == expected);
255 std::string const expected =
"'.1' is not a number";
256 BEAST_EXPECT(e.
what() == expected);
266 std::string const expected =
"'1.' is not a number";
267 BEAST_EXPECT(e.
what() == expected);
277 std::string const expected =
"'1.e3' is not a number";
278 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.