20 #include <ripple/overlay/impl/ProtocolVersion.h>
21 #include <ripple/beast/unit_test.h>
28 template <
class FwdIt>
31 join (FwdIt first, FwdIt last,
char const* sep =
",")
46 BEAST_EXPECT(
join(result.begin(), result.end()) == answer);
53 testcase(
"Convert protocol version to string");
61 testcase(
"Convert strings to protocol versions");
68 "RTXP/1.1,RTXP/1.3,XRPL/2.1,RTXP/1.2,XRPL/2.0",
69 "RTXP/1.2,XRPL/2.0,XRPL/2.1");
71 "RTXP/0.9,RTXP/1.01,XRPL/0.3,XRPL/2.01,XRPL/19.04,Oscar/123,NIKB",
74 "RTXP/1.2,XRPL/2.0,RTXP/1.2,XRPL/2.0,XRPL/19.4,XRPL/7.89,XRPL/A.1,XRPL/2.01",
75 "RTXP/1.2,XRPL/2.0,XRPL/7.89,XRPL/19.4");
77 "XRPL/2.0,XRPL/3.0,XRPL/4,XRPL/,XRPL,OPT XRPL/2.2,XRPL/5.67",
78 "XRPL/2.0,XRPL/3.0,XRPL/5.67");
82 testcase(
"Protocol version negotiation");
BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, ripple)
constexpr ProtocolVersion make_protocol(std::uint16_t major, std::uint16_t minor)
std::vector< ProtocolVersion > parseProtocolVersions(boost::beast::string_view const &value)
Parse a set of protocol versions.
std::pair< std::uint16_t, std::uint16_t > ProtocolVersion
Represents a particular version of the peer-to-peer protocol.
std::string to_string(ListDisposition disposition)
boost::optional< ProtocolVersion > negotiateProtocolVersion(std::vector< ProtocolVersion > const &versions)
Given a list of supported protocol versions, choose the one we prefer.
void check(std::string const &s, std::string const &answer)
static std::string join(FwdIt first, FwdIt last, char const *sep=",")
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.