Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Apr 30, 2024
1 parent a978f43 commit 1ebab03
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tests/dsl/emit/Delay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,16 @@ class TestReactor : public test_util::TestBase<TestReactor> {
});

on<Startup>().then([this] {
// Delay with consistent jumps
// Interleave absolute and relative events
for (int i = 0; i < test_loops; ++i) {
auto delay = TimeUnit(i * 2);
emit<Scope::DELAY>(std::make_unique<DelayedMessage>(delay), delay);
}

// Target time with consistent jumps that interleave the first set
for (int i = 0; i < test_loops; ++i) {
auto target = NUClear::clock::now() + TimeUnit(1 + (2 * i));
auto target = NUClear::clock::now() + TimeUnit(1 + (i * 2));
emit<Scope::DELAY>(std::make_unique<TargetTimeMessage>(target), target);
}

// Emit a shutdown one time unit after
emit<Scope::DELAY>(std::make_unique<FinishTest>(), TimeUnit((test_loops + 1) * 2));
emit<Scope::DELAY>(std::make_unique<FinishTest>(), TimeUnit(test_loops * 2));
});
}
};
Expand Down

0 comments on commit 1ebab03

Please sign in to comment.