mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add CallQueue unit test
This commit is contained in:
@@ -165,10 +165,13 @@ public:
|
||||
{
|
||||
explicit TestThread (int id)
|
||||
: ThreadWithCallQueue ("#" + String::fromNumber (id))
|
||||
, interruptedOnce (false)
|
||||
{
|
||||
start (this);
|
||||
}
|
||||
|
||||
bool interruptedOnce;
|
||||
|
||||
void threadInit ()
|
||||
{
|
||||
}
|
||||
@@ -187,7 +190,10 @@ public:
|
||||
{
|
||||
interrupted = interruptionPoint ();
|
||||
if (interrupted)
|
||||
{
|
||||
interruptedOnce = true;
|
||||
break;
|
||||
}
|
||||
|
||||
s = s + String::fromNumber (m_random.nextInt ());
|
||||
|
||||
@@ -195,6 +201,8 @@ public:
|
||||
s = String::empty;
|
||||
}
|
||||
|
||||
bassert (interrupted);
|
||||
|
||||
return interrupted;
|
||||
}
|
||||
|
||||
@@ -243,6 +251,11 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
for (int i = 0; i < threads.size(); ++i)
|
||||
{
|
||||
expect (threads[i]->interruptedOnce);
|
||||
}
|
||||
|
||||
for (int i = 0; i < threads.size(); ++i)
|
||||
threads[i]->stop (false);
|
||||
for (int i = 0; i < threads.size(); ++i)
|
||||
|
||||
Reference in New Issue
Block a user