Skip to content

Commit

Permalink
gcc is confused for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Oct 26, 2024
1 parent 8ca3604 commit 4a6ee21
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/tests/dsl/TaskScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class TestReactor : public test_util::TestBase<TestReactor> {

template <int Current, int Scope, typename Message>
void process_step(const Message& d) {
constexpr int Next = Current + 1;

// Get the scope state before the inline event
std::array<bool, 3> pre_scopes = {
Expand All @@ -74,21 +73,21 @@ class TestReactor : public test_util::TestBase<TestReactor> {
TaskScope<Data<2>>::in_scope(),
};

Data<Next> next_inline_data;
Data<Current + 1> next_inline_data;
next_inline_data.steps = d.steps;
next_inline_data.steps[Current] = {Scope, true, pre_scopes};
emit<Scope::INLINE>(std::make_unique<Data<Next>>(next_inline_data));
emit<Scope::INLINE>(std::make_unique<Data<Current + 1>>(next_inline_data));

// Get the scope state after the inline event
std::array<bool, 3> post_scopes = {
TaskScope<Data<0>>::in_scope(),
TaskScope<Data<1>>::in_scope(),
TaskScope<Data<2>>::in_scope(),
};
Data<Next> next_normal_data;
Data<Current + 1> next_normal_data;
next_normal_data.steps = d.steps;
next_normal_data.steps[Current] = {Scope, false, post_scopes};
emit(std::make_unique<Data<Next>>(next_normal_data));
emit(std::make_unique<Data<Current + 1>>(next_normal_data));
}

TestReactor(std::unique_ptr<NUClear::Environment> environment) : TestBase(std::move(environment)) {
Expand Down

0 comments on commit 4a6ee21

Please sign in to comment.