File tree 3 files changed +15
-6
lines changed
3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 25
25
#include < ripple/protocol/jss.h>
26
26
#include < ripple/rpc/impl/Handler.h>
27
27
#include < test/jtx/Env.h>
28
+ #include < test/jtx/TestHelpers.h>
28
29
29
30
#include < atomic>
30
31
#include < chrono>
@@ -309,9 +310,8 @@ class PerfLog_test : public beast::unit_test::suite
309
310
310
311
// Get the all the labels we can use for RPC interfaces without
311
312
// causing an assert.
312
- std::set<const char *> handlerNames = ripple::RPC::getHandlerNames ();
313
- std::vector<char const *> labels (
314
- handlerNames.begin (), handlerNames.end ());
313
+ std::vector<char const *> labels =
314
+ test::jtx::make_vector (ripple::RPC::getHandlerNames ());
315
315
std::shuffle (labels.begin (), labels.end (), default_prng ());
316
316
317
317
// Get two IDs to associate with each label. Errors tend to happen at
Original file line number Diff line number Diff line change 27
27
#include < ripple/protocol/jss.h>
28
28
#include < test/jtx/Env.h>
29
29
30
+ #include < ranges>
31
+
30
32
namespace ripple {
31
33
namespace test {
32
34
namespace jtx {
33
35
36
+ // Helper to make vector from iterable
37
+ auto
38
+ make_vector (auto const & input)
39
+ requires std::ranges::range<decltype(input)>
40
+ {
41
+ return std::vector (std::ranges::begin (input), std::ranges::end (input));
42
+ }
43
+
34
44
// Functions used in debugging
35
45
Json::Value
36
46
getAccountOffers (Env& env, AccountID const & acct, bool current = false );
Original file line number Diff line number Diff line change @@ -99,9 +99,8 @@ class Handler_test : public beast::unit_test::suite
99
99
std::random_device dev;
100
100
std::ranlux48 prng (dev ());
101
101
102
- std::set<const char *> handlerNames = RPC::getHandlerNames ();
103
- std::vector<const char *> names (
104
- handlerNames.begin (), handlerNames.end ());
102
+ std::vector<const char *> names =
103
+ test::jtx::make_vector (ripple::RPC::getHandlerNames ());
105
104
106
105
std::uniform_int_distribution<std::size_t > distr{0 , names.size () - 1 };
107
106
You can’t perform that action at this time.
0 commit comments