mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 16:56:48 +00:00
chore: Apply clang-format width 100 (#6387)
This commit is contained in:
@@ -19,7 +19,8 @@ class JobQueue_test : public beast::unit_test::suite
|
||||
{
|
||||
// addJob() should run the Job (and return true).
|
||||
std::atomic<bool> jobRan{false};
|
||||
BEAST_EXPECT(jQueue.addJob(jtCLIENT, "JobAddTest1", [&jobRan]() { jobRan = true; }) == true);
|
||||
BEAST_EXPECT(
|
||||
jQueue.addJob(jtCLIENT, "JobAddTest1", [&jobRan]() { jobRan = true; }) == true);
|
||||
|
||||
// Wait for the Job to run.
|
||||
while (jobRan == false)
|
||||
@@ -36,7 +37,9 @@ class JobQueue_test : public beast::unit_test::suite
|
||||
// unprotected variable on the stack should be completely safe.
|
||||
// Not recommended for the faint of heart...
|
||||
bool unprotected;
|
||||
BEAST_EXPECT(jQueue.addJob(jtCLIENT, "JobAddTest2", [&unprotected]() { unprotected = false; }) == false);
|
||||
BEAST_EXPECT(jQueue.addJob(jtCLIENT, "JobAddTest2", [&unprotected]() {
|
||||
unprotected = false;
|
||||
}) == false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +53,9 @@ class JobQueue_test : public beast::unit_test::suite
|
||||
// Test repeated post()s until the Coro completes.
|
||||
std::atomic<int> yieldCount{0};
|
||||
auto const coro = jQueue.postCoro(
|
||||
jtCLIENT, "PostCoroTest1", [&yieldCount](std::shared_ptr<JobQueue::Coro> const& coroCopy) {
|
||||
jtCLIENT,
|
||||
"PostCoroTest1",
|
||||
[&yieldCount](std::shared_ptr<JobQueue::Coro> const& coroCopy) {
|
||||
while (++yieldCount < 4)
|
||||
coroCopy->yield();
|
||||
});
|
||||
@@ -77,7 +82,9 @@ class JobQueue_test : public beast::unit_test::suite
|
||||
// Test repeated resume()s until the Coro completes.
|
||||
int yieldCount{0};
|
||||
auto const coro = jQueue.postCoro(
|
||||
jtCLIENT, "PostCoroTest2", [&yieldCount](std::shared_ptr<JobQueue::Coro> const& coroCopy) {
|
||||
jtCLIENT,
|
||||
"PostCoroTest2",
|
||||
[&yieldCount](std::shared_ptr<JobQueue::Coro> const& coroCopy) {
|
||||
while (++yieldCount < 4)
|
||||
coroCopy->yield();
|
||||
});
|
||||
@@ -112,8 +119,8 @@ class JobQueue_test : public beast::unit_test::suite
|
||||
// unprotected variable on the stack should be completely safe.
|
||||
// Not recommended for the faint of heart...
|
||||
bool unprotected;
|
||||
auto const coro =
|
||||
jQueue.postCoro(jtCLIENT, "PostCoroTest3", [&unprotected](std::shared_ptr<JobQueue::Coro> const&) {
|
||||
auto const coro = jQueue.postCoro(
|
||||
jtCLIENT, "PostCoroTest3", [&unprotected](std::shared_ptr<JobQueue::Coro> const&) {
|
||||
unprotected = false;
|
||||
});
|
||||
BEAST_EXPECT(coro == nullptr);
|
||||
|
||||
Reference in New Issue
Block a user