Skip to content

Commit

Permalink
Are you ok there gcc?
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Oct 26, 2024
1 parent defe3ff commit 9807767
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/dsl/word/TaskScope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace dsl {
* Locks the current task id to the word until the lock goes out of scope
*/
struct Lock {
Lock(NUClear::id_t old_id) : old_id(old_id) {}
explicit Lock(NUClear::id_t old_id) : old_id(old_id) {}

// No copying the lock
Lock(const Lock&) = delete;
Expand Down
34 changes: 16 additions & 18 deletions tests/tests/dsl/TaskScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,26 @@ class TestReactor : public test_util::TestBase<TestReactor> {
template <int Current, int Scope, typename Message>
void process_step(const Message& d) {

using NextData = Data<Current + 1>;

// Get the scope state before the inline event
std::array<bool, 3> pre_scopes = {
TaskScope<Data<0>>::in_scope(),
TaskScope<Data<1>>::in_scope(),
TaskScope<Data<2>>::in_scope(),
auto next_inline = std::make_unique<NextData>();
next_inline->steps = d.steps;
next_inline->steps[Current] = {
Scope,
true,
{TaskScope<Data<0>>::in_scope(), TaskScope<Data<1>>::in_scope(), TaskScope<Data<2>>::in_scope()},
};

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<Current + 1>>(next_inline_data));
emit<Scope::INLINE>(next_inline);

// 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<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<Current + 1>>(next_normal_data));
auto next_normal = std::make_unique<NextData>();
next_normal->steps = d.steps;
next_normal->steps[Current] = {
Scope,
false,
{TaskScope<Data<0>>::in_scope(), TaskScope<Data<1>>::in_scope(), TaskScope<Data<2>>::in_scope()}};
emit(next_normal);
}

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

0 comments on commit 9807767

Please sign in to comment.