}
bool EventBase::runImmediatelyOrRunInEventBaseThreadAndWait(const Cob& fn) {
- if (inRunningEventBaseThread()) {
+ if (isInEventBaseThread()) {
fn();
return true;
} else {
});
}
+TEST(EventBaseTest, RunImmediatelyOrRunInEventBaseThreadNotLooping) {
+ EventBase eb;
+ auto mutated = false;
+ eb.runImmediatelyOrRunInEventBaseThreadAndWait([&] {
+ mutated = true;
+ });
+ EXPECT_TRUE(mutated);
+}
+
///////////////////////////////////////////////////////////////////////////
// Tests for runInLoop()
///////////////////////////////////////////////////////////////////////////