mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 08:46:46 +00:00
This change renames all occurrences of `namespace ripple` and `ripple::` to `namespace xrpl` and `xrpl::`, respectively, as well as the names of test suites. It also provides a script to allow developers to replicate the changes in their local branch or fork to avoid conflicts.
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
#include <xrpld/overlay/detail/Handshake.h>
|
|
|
|
#include <xrpl/beast/unit_test.h>
|
|
|
|
namespace xrpl {
|
|
|
|
namespace test {
|
|
|
|
class handshake_test : public beast::unit_test::suite
|
|
{
|
|
public:
|
|
handshake_test() = default;
|
|
|
|
void
|
|
testHandshake()
|
|
{
|
|
testcase("X-Protocol-Ctl");
|
|
boost::beast::http::fields headers;
|
|
headers.insert(
|
|
"X-Protocol-Ctl",
|
|
"feature1=v1,v2,v3; feature2=v4; feature3=10; feature4=1; "
|
|
"feature5=v6");
|
|
BEAST_EXPECT(!featureEnabled(headers, "feature1"));
|
|
BEAST_EXPECT(!isFeatureValue(headers, "feature1", "2"));
|
|
BEAST_EXPECT(isFeatureValue(headers, "feature1", "v1"));
|
|
BEAST_EXPECT(isFeatureValue(headers, "feature1", "v2"));
|
|
BEAST_EXPECT(isFeatureValue(headers, "feature1", "v3"));
|
|
BEAST_EXPECT(isFeatureValue(headers, "feature2", "v4"));
|
|
BEAST_EXPECT(!isFeatureValue(headers, "feature3", "1"));
|
|
BEAST_EXPECT(isFeatureValue(headers, "feature3", "10"));
|
|
BEAST_EXPECT(!isFeatureValue(headers, "feature4", "10"));
|
|
BEAST_EXPECT(isFeatureValue(headers, "feature4", "1"));
|
|
BEAST_EXPECT(!featureEnabled(headers, "v6"));
|
|
}
|
|
|
|
void
|
|
run() override
|
|
{
|
|
testHandshake();
|
|
}
|
|
};
|
|
|
|
BEAST_DEFINE_TESTSUITE(handshake, overlay, xrpl);
|
|
|
|
} // namespace test
|
|
} // namespace xrpl
|