1#include <test/jtx/Env.h>
3#include <xrpl/beast/unit_test/suite.h>
4#include <xrpl/core/Job.h>
5#include <xrpl/core/JobQueue.h>
26 jQueue.
addJob(
JtClient,
"JobAddTest1", [&jobRan]() { jobRan = true; }) ==
true);
36 using namespace std::chrono_literals;
42 bool unprotected =
false;
43 BEAST_EXPECT(jQueue.
addJob(
JtClient,
"JobAddTest2", [&unprotected]() {
62 while (++yieldCount < 4)
65 BEAST_EXPECT(coro !=
nullptr);
68 while (yieldCount == 0)
73 while (coro->runnable())
75 BEAST_EXPECT(coro->post());
76 while (old == yieldCount)
80 BEAST_EXPECT(++old == yieldCount);
82 BEAST_EXPECT(yieldCount == 4);
91 while (++yieldCount < 4)
106 int old = yieldCount;
107 while (coro->runnable())
110 BEAST_EXPECT(++old == yieldCount);
112 BEAST_EXPECT(yieldCount == 4);
118 using namespace std::chrono_literals;
124 bool unprotected =
false;
129 BEAST_EXPECT(coro ==
nullptr);
A pool of threads to perform work.
std::shared_ptr< Coro > postCoro(JobType t, std::string const &name, F &&f)
Creates a coroutine and adds a job to the queue which will run it.
bool addJob(JobType type, std::string const &name, JobHandler &&jobHandler)
Adds a job to the JobQueue.
virtual JobQueue & getJobQueue()=0
void run() override
Runs the suite.
A transaction testing environment.
BEAST_DEFINE_TESTSUITE(AMMClawback, app, xrpl)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.