diff --git a/src/dsl/word/emit/Initialise.hpp b/src/dsl/word/emit/Initialise.hpp index cd013fdd..435d808a 100644 --- a/src/dsl/word/emit/Initialise.hpp +++ b/src/dsl/word/emit/Initialise.hpp @@ -59,7 +59,7 @@ namespace dsl { auto emitter = std::make_unique( nullptr, false, - [](threading::ReactionTask& /*task*/) { return 1000; }, + [](threading::ReactionTask& /*task*/) { return NUClear::util::Priority::HIGHEST; }, [](threading::ReactionTask& /*task*/) { return util::Inline::NEVER; }, [](threading::ReactionTask& /*task*/) { return Pool<>::descriptor(); }, [](threading::ReactionTask& /*task*/) { diff --git a/tests/tests/api/ReactionHandle.cpp b/tests/tests/api/ReactionHandle.cpp index 427ecf01..794a32c2 100644 --- a/tests/tests/api/ReactionHandle.cpp +++ b/tests/tests/api/ReactionHandle.cpp @@ -37,13 +37,13 @@ class TestReactor : public test_util::TestBase { TestReactor(std::unique_ptr environment) : TestBase(std::move(environment)) { // Make an always disabled reaction - a = on, Priority::HIGH>().then([this](const Message& msg) { // + a = on, Priority>().then([this](const Message& msg) { // events.push_back("Executed disabled reaction " + std::to_string(msg.i)); }); a.disable(); // Make a reaction that we toggle on and off - b = on, Priority::HIGH>().then([this](const Message& msg) { // + b = on, Priority>().then([this](const Message& msg) { // events.push_back("Executed toggled reaction " + std::to_string(msg.i)); b.disable(); emit(std::make_unique(1)); diff --git a/tests/tests/api/ReactionStatistics.cpp b/tests/tests/api/ReactionStatistics.cpp index 9d8d412d..54dc989f 100644 --- a/tests/tests/api/ReactionStatistics.cpp +++ b/tests/tests/api/ReactionStatistics.cpp @@ -40,13 +40,13 @@ class TestReactor : public test_util::TestBase { // This reaction is here to emit something from a ReactionStatistics trigger // This shouldn't cause reaction statistics of their own otherwise everything would explode - on, Priority::HIGH>().then("Loop Statistics", [this](const ReactionEvent&) { // + on, Priority>().then("Loop Statistics", [this](const ReactionEvent&) { // emit(std::make_unique()); }); on>().then("No Statistics", [] {}); - on, Priority::HIGH>().then("Reaction Stats Handler", [this](const ReactionEvent& event) { + on, Priority>().then("Reaction Stats Handler", [this](const ReactionEvent& event) { const auto& stats = *event.statistics; // Other reactions statistics run on this because of built in NUClear reactors (e.g. chrono controller etc) diff --git a/tests/tests/api/ReactionStatisticsTiming.cpp b/tests/tests/api/ReactionStatisticsTiming.cpp index f0ee9904..a35065ba 100644 --- a/tests/tests/api/ReactionStatisticsTiming.cpp +++ b/tests/tests/api/ReactionStatisticsTiming.cpp @@ -60,7 +60,7 @@ class TestReactor : public test_util::TestBase { TestReactor(std::unique_ptr environment) : TestBase(std::move(environment), true, std::chrono::seconds(2)) { - on>, Priority::LOW>().then(initial_name + ":" + heavy_name, [this] { + on>, Priority>().then(initial_name + ":" + heavy_name, [this] { code_events.emplace_back("Started " + initial_name + ":" + heavy_name, NUClear::clock::now()); code_events.emplace_back("Created " + heavy_name, NUClear::clock::now()); emit(std::make_unique()); @@ -74,7 +74,7 @@ class TestReactor : public test_util::TestBase { code_events.emplace_back("Finished " + heavy_name, NUClear::clock::now()); }); - on>, Priority::LOW>().then(initial_name + ":" + light_name, [this] { + on>, Priority>().then(initial_name + ":" + light_name, [this] { code_events.emplace_back("Started " + initial_name + ":" + light_name, NUClear::clock::now()); code_events.emplace_back("Created " + light_name, NUClear::clock::now()); emit(std::make_unique()); diff --git a/tests/tests/dsl/BlockNoData.cpp b/tests/tests/dsl/BlockNoData.cpp index 702728ac..c9d8294e 100644 --- a/tests/tests/dsl/BlockNoData.cpp +++ b/tests/tests/dsl/BlockNoData.cpp @@ -47,7 +47,7 @@ class TestReactor : public test_util::TestBase { events.push_back("MessageB with MessageA triggered"); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting MessageA"); emit(std::make_unique()); }); diff --git a/tests/tests/dsl/Buffer.cpp b/tests/tests/dsl/Buffer.cpp index 5e465ef0..14e38a35 100644 --- a/tests/tests/dsl/Buffer.cpp +++ b/tests/tests/dsl/Buffer.cpp @@ -51,29 +51,29 @@ class TestReactor : public test_util::TestBase { events.push_back("Buffer<4> reaction " + std::to_string(msg.i)); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Step 1"); emit(std::make_unique(1)); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Step 2"); emit(std::make_unique(2)); emit(std::make_unique(3)); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Step 3"); emit(std::make_unique(4)); emit(std::make_unique(5)); emit(std::make_unique(6)); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Step 4"); emit(std::make_unique(7)); emit(std::make_unique(8)); emit(std::make_unique(9)); emit(std::make_unique(10)); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Step 5"); emit(std::make_unique(11)); emit(std::make_unique(12)); diff --git a/tests/tests/dsl/DSLOrdering.cpp b/tests/tests/dsl/DSLOrdering.cpp index 7deea04f..aee901b9 100644 --- a/tests/tests/dsl/DSLOrdering.cpp +++ b/tests/tests/dsl/DSLOrdering.cpp @@ -47,15 +47,15 @@ class TestReactor : public test_util::TestBase { events.push_back("Empty function"); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting 1"); emit(std::make_unique>("1")); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting 2"); emit(std::make_unique>("2")); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting 3"); emit(std::make_unique>("3")); }); diff --git a/tests/tests/dsl/FlagMessage.cpp b/tests/tests/dsl/FlagMessage.cpp index 33b81b19..817b367c 100644 --- a/tests/tests/dsl/FlagMessage.cpp +++ b/tests/tests/dsl/FlagMessage.cpp @@ -50,7 +50,7 @@ class TestReactor : public test_util::TestBase { events.push_back("MessageA with MessageB triggered"); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Step<1> triggered"); events.push_back("Emitting MessageA"); emit(std::make_unique()); diff --git a/tests/tests/dsl/IdleGlobal.cpp b/tests/tests/dsl/IdleGlobal.cpp index 47d280ff..2b012f84 100644 --- a/tests/tests/dsl/IdleGlobal.cpp +++ b/tests/tests/dsl/IdleGlobal.cpp @@ -89,7 +89,7 @@ class TestReactor : public test_util::TestBase { }); // At low priority shutdown, this will run after all the global idles (should be 1) have been fired - on>, Priority::LOW>().then([this] { powerplant.shutdown(); }); + on>, Priority>().then([this] { powerplant.shutdown(); }); // This shutdown is here in case the test times out so all the spinlocks don't hang the test on>().then([this] { diff --git a/tests/tests/dsl/IdleSingle.cpp b/tests/tests/dsl/IdleSingle.cpp index 27459cf4..17c44de8 100644 --- a/tests/tests/dsl/IdleSingle.cpp +++ b/tests/tests/dsl/IdleSingle.cpp @@ -76,7 +76,7 @@ class TestReactor : public test_util::TestBase { // Run this at low priority but have it first // This way MainThread will get notified that it has access to Sync but then it will lose it when // The other task on the default pool gets created so it'll be notified but unable to act - on, MainThread, Priority::LOW, Sync>().then([this](const TaskB& t) { + on, MainThread, Priority, Sync>().then([this](const TaskB& t) { main_calls[t.i].fetch_add(1, std::memory_order_relaxed); if (t.i + 1 < n_loops) { @@ -87,7 +87,7 @@ class TestReactor : public test_util::TestBase { } }); // This is the high priority task that preempts the main thread and makes it go idle again - on, Pool<>, Priority::HIGH, Sync>().then([this](const TaskB& t) { // + on, Pool<>, Priority, Sync>().then([this](const TaskB& t) { // default_calls[t.i].fetch_add(1, std::memory_order_relaxed); }); diff --git a/tests/tests/dsl/Once.cpp b/tests/tests/dsl/Once.cpp index d8bff7e4..f482c3f1 100644 --- a/tests/tests/dsl/Once.cpp +++ b/tests/tests/dsl/Once.cpp @@ -36,7 +36,7 @@ class TestReactor : public NUClear::Reactor { TestReactor(std::unique_ptr environment) : Reactor(std::move(environment)) { // Make this priority high so it will always run first if it is able - on, Priority::HIGH, Once>().then([this](const SimpleMessage& msg) { // + on, Priority, Once>().then([this](const SimpleMessage& msg) { // events.push_back("Once Trigger executed " + std::to_string(msg.run)); }); diff --git a/tests/tests/dsl/Priority.cpp b/tests/tests/dsl/Priority.cpp index ae650f73..3404ff0b 100644 --- a/tests/tests/dsl/Priority.cpp +++ b/tests/tests/dsl/Priority.cpp @@ -35,20 +35,20 @@ class TestReactor : public test_util::TestBase { TestReactor(std::unique_ptr environment) : TestBase(std::move(environment)) { // Declare in the order you'd expect them to fire - on>, Priority::REALTIME>().then([this] { events.push_back("Realtime Message<1>"); }); - on>, Priority::HIGH>().then("High", [this] { events.push_back("High Message<1>"); }); + on>, Priority>().then([this] { events.push_back("Highest Message<1>"); }); + on>, Priority>().then("High", [this] { events.push_back("High Message<1>"); }); on>>().then([this] { events.push_back("Default Message<1>"); }); - on>, Priority::NORMAL>().then("Normal", [this] { events.push_back("Normal Message<1>"); }); - on>, Priority::LOW>().then("Low", [this] { events.push_back("Low Message<1>"); }); - on>, Priority::IDLE>().then([this] { events.push_back("Idle Message<1>"); }); + on>, Priority>().then("Normal", [this] { events.push_back("Normal Message<1>"); }); + on>, Priority>().then("Low", [this] { events.push_back("Low Message<1>"); }); + on>, Priority>().then([this] { events.push_back("Lowest Message<1>"); }); // Declare in the opposite order to what you'd expect them to fire - on>, Priority::IDLE>().then([this] { events.push_back("Idle Message<2>"); }); - on>, Priority::LOW>().then([this] { events.push_back("Low Message<2>"); }); - on>, Priority::NORMAL>().then([this] { events.push_back("Normal Message<2>"); }); + on>, Priority>().then([this] { events.push_back("Lowest Message<2>"); }); + on>, Priority>().then([this] { events.push_back("Low Message<2>"); }); + on>, Priority>().then([this] { events.push_back("Normal Message<2>"); }); on>>().then([this] { events.push_back("Default Message<2>"); }); - on>, Priority::HIGH>().then([this] { events.push_back("High Message<2>"); }); - on>, Priority::REALTIME>().then([this] { events.push_back("Realtime Message<2>"); }); + on>, Priority>().then([this] { events.push_back("High Message<2>"); }); + on>, Priority>().then([this] { events.push_back("Highest Message<2>"); }); // Declare in a random order std::array order = {0, 1, 2, 3, 4}; @@ -56,21 +56,21 @@ class TestReactor : public test_util::TestBase { for (const auto& i : order) { switch (i) { case 0: - on>, Priority::REALTIME>().then( - [this] { events.push_back("Realtime Message<3>"); }); + on>, Priority>().then( + [this] { events.push_back("Highest Message<3>"); }); break; case 1: - on>, Priority::HIGH>().then([this] { events.push_back("High Message<3>"); }); + on>, Priority>().then([this] { events.push_back("High Message<3>"); }); break; case 2: - on>, Priority::NORMAL>().then([this] { events.push_back("Normal Message<3>"); }); + on>, Priority>().then([this] { events.push_back("Normal Message<3>"); }); on>>().then([this] { events.push_back("Default Message<3>"); }); break; case 3: - on>, Priority::LOW>().then([this] { events.push_back("Low Message<3>"); }); + on>, Priority>().then([this] { events.push_back("Low Message<3>"); }); break; case 4: - on>, Priority::IDLE>().then([this] { events.push_back("Idle Message<3>"); }); + on>, Priority>().then([this] { events.push_back("Lowest Message<3>"); }); break; default: throw std::invalid_argument("Should be impossible"); } @@ -98,9 +98,9 @@ TEST_CASE("Tests that priority orders the tasks appropriately", "[api][priority] plant.start(); const std::vector expected = { - "Realtime Message<1>", - "Realtime Message<2>", - "Realtime Message<3>", + "Highest Message<1>", + "Highest Message<2>", + "Highest Message<3>", "High Message<1>", "High Message<2>", "High Message<3>", @@ -113,9 +113,9 @@ TEST_CASE("Tests that priority orders the tasks appropriately", "[api][priority] "Low Message<1>", "Low Message<2>", "Low Message<3>", - "Idle Message<1>", - "Idle Message<2>", - "Idle Message<3>", + "Lowest Message<1>", + "Lowest Message<2>", + "Lowest Message<3>", }; // Make an info print the diff in an easy to read way if we fail diff --git a/tests/tests/dsl/RawFunction.cpp b/tests/tests/dsl/RawFunction.cpp index b7d7c7dd..7750c70a 100644 --- a/tests/tests/dsl/RawFunction.cpp +++ b/tests/tests/dsl/RawFunction.cpp @@ -88,10 +88,10 @@ class TestReactor : public test_util::TestBase { on, Trigger>().then(raw_function_test_right_arg); on, Trigger>().then(raw_function_test_both_args); - on>, Priority::LOW>().then([this] { emit(std::make_unique("D1")); }); - on>, Priority::LOW>().then([this] { emit(std::make_unique("M2")); }); - on>, Priority::LOW>().then([this] { emit(std::make_unique("D3")); }); - on>, Priority::LOW>().then([this] { emit(std::make_unique("M4")); }); + on>, Priority>().then([this] { emit(std::make_unique("D1")); }); + on>, Priority>().then([this] { emit(std::make_unique("M2")); }); + on>, Priority>().then([this] { emit(std::make_unique("D3")); }); + on>, Priority>().then([this] { emit(std::make_unique("M4")); }); on().then([this] { emit(std::make_unique>()); diff --git a/tests/tests/dsl/Shutdown.cpp b/tests/tests/dsl/Shutdown.cpp index 9f644217..5741092a 100644 --- a/tests/tests/dsl/Shutdown.cpp +++ b/tests/tests/dsl/Shutdown.cpp @@ -34,7 +34,7 @@ class TestReactor : public test_util::TestBase { events.push_back("Shutdown task executed"); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Requesting shutdown"); powerplant.shutdown(); }); diff --git a/tests/tests/dsl/Transient.cpp b/tests/tests/dsl/Transient.cpp index dd957406..d36a135b 100644 --- a/tests/tests/dsl/Transient.cpp +++ b/tests/tests/dsl/Transient.cpp @@ -72,39 +72,39 @@ class TestReactor : public test_util::TestBase { events.push_back(m.msg + " : " + t.msg); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Message 1"); emit(std::make_unique("S1")); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Transient 1"); emit(std::make_unique("T1", true)); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Message 2"); emit(std::make_unique("S2")); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Invalid Transient 2"); emit(std::make_unique("T2", false)); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Message 3"); emit(std::make_unique("S3")); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Transient 3"); emit(std::make_unique("T3", true)); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Transient 4"); emit(std::make_unique("T4", true)); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Invalid Transient 5"); emit(std::make_unique("T5", false)); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Message 4"); emit(std::make_unique("S4")); }); diff --git a/tests/tests/dsl/With.cpp b/tests/tests/dsl/With.cpp index fd389bcc..35edac64 100644 --- a/tests/tests/dsl/With.cpp +++ b/tests/tests/dsl/With.cpp @@ -43,27 +43,27 @@ class TestReactor : public test_util::TestBase { events.push_back("Message: " + m.data + " Data: " + d.data); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Data 1"); emit(std::make_unique("D1")); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Data 2"); emit(std::make_unique("D2")); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Message 1"); emit(std::make_unique("M1")); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Data 3"); emit(std::make_unique("D3")); }); - on>, Priority::LOW>().then([this] { + on>, Priority>().then([this] { events.push_back("Emitting Message 2"); emit(std::make_unique("M2")); }); diff --git a/tests/tests/threading/Group.cpp b/tests/tests/threading/Group.cpp index ea94b683..ecbb52c8 100644 --- a/tests/tests/threading/Group.cpp +++ b/tests/tests/threading/Group.cpp @@ -42,14 +42,14 @@ namespace threading { NUClear::id_t task_id_source = 1; WHEN("Creating a lock") { - std::unique_ptr lock1 = group->lock(++task_id_source, 1, [] {}); + std::unique_ptr lock1 = group->lock(++task_id_source, util::Priority::LOW, [] {}); THEN("The lock should be true") { CHECK(lock1->lock() == true); } AND_WHEN("Creating a second lock") { - std::unique_ptr lock2 = group->lock(++task_id_source, 1, [] {}); + std::unique_ptr lock2 = group->lock(++task_id_source, util::Priority::LOW, [] {}); THEN("The lock should be false") { CHECK(lock1->lock() == true); @@ -67,7 +67,7 @@ namespace threading { WHEN("Creating a lock and locking it") { int notified1 = 0; - std::unique_ptr lock1 = group->lock(task_id_source++, 1, [&] { ++notified1; }); + std::unique_ptr lock1 = group->lock(task_id_source++, util::Priority::LOW, [&] { ++notified1; }); lock1->lock(); THEN("The lock should be true") { @@ -77,8 +77,8 @@ namespace threading { AND_WHEN("Creating two more locks") { int notified2 = 0; int notified3 = 0; - std::unique_ptr lock2 = group->lock(task_id_source++, 1, [&] { ++notified2; }); - std::unique_ptr lock3 = group->lock(task_id_source++, 1, [&] { ++notified3; }); + std::unique_ptr lock2 = group->lock(task_id_source++, util::Priority::LOW, [&] { ++notified2; }); + std::unique_ptr lock3 = group->lock(task_id_source++, util::Priority::LOW, [&] { ++notified3; }); THEN("The new locks should be false") { CHECK(lock1->lock() == true); @@ -116,11 +116,11 @@ namespace threading { WHEN("Creating a lock and locking it") { int notified1 = 0; - std::unique_ptr lock1 = group->lock(1, 1, [&] { ++notified1; }); + std::unique_ptr lock1 = group->lock(1, util::Priority::LOW, [&] { ++notified1; }); AND_WHEN("Locking the lock and creating a higher priority task") { lock1->lock(); - std::unique_ptr lock2 = group->lock(2, 2, [] {}); + std::unique_ptr lock2 = group->lock(2, util::Priority::NORMAL, [] {}); THEN("The new lock should be false") { CHECK(lock1->lock() == true); @@ -128,7 +128,7 @@ namespace threading { } } AND_WHEN("Not locking the lock and creating a higher priority task") { - std::unique_ptr lock2 = group->lock(2, 2, [] {}); + std::unique_ptr lock2 = group->lock(2, util::Priority::NORMAL, [] {}); THEN("The new lock should be true") { CHECK(lock1->lock() == false); @@ -151,11 +151,11 @@ namespace threading { std::array notified = {0, 0, 0, 0, 0}; std::array, n_locks> locks; - locks[3] = group->lock(3, 1, [&] { ++notified[3]; }); - locks[1] = group->lock(1, 1, [&] { ++notified[1]; }); - locks[4] = group->lock(4, 1, [&] { ++notified[4]; }); - locks[0] = group->lock(0, 1, [&] { ++notified[0]; }); - locks[2] = group->lock(2, 1, [&] { ++notified[2]; }); + locks[3] = group->lock(3, util::Priority::LOW, [&] { ++notified[3]; }); + locks[1] = group->lock(1, util::Priority::LOW, [&] { ++notified[1]; }); + locks[4] = group->lock(4, util::Priority::LOW, [&] { ++notified[4]; }); + locks[0] = group->lock(0, util::Priority::LOW, [&] { ++notified[0]; }); + locks[2] = group->lock(2, util::Priority::LOW, [&] { ++notified[2]; }); THEN("The locks should be lockable in the proper order") { CHECK(locks[0]->lock() == (0 < n_tokens)); @@ -198,11 +198,11 @@ namespace threading { WHEN("Creating a series of locks") { std::array notified = {0, 0, 0, 0, 0}; std::array, n_locks> locks = { - group->lock(0, 1, [&] { ++notified[0]; }), - group->lock(1, 1, [&] { ++notified[1]; }), - group->lock(2, 1, [&] { ++notified[2]; }), - group->lock(3, 1, [&] { ++notified[3]; }), - group->lock(4, 1, [&] { ++notified[4]; }), + group->lock(0, util::Priority::LOW, [&] { ++notified[0]; }), + group->lock(1, util::Priority::LOW, [&] { ++notified[1]; }), + group->lock(2, util::Priority::LOW, [&] { ++notified[2]; }), + group->lock(3, util::Priority::LOW, [&] { ++notified[3]; }), + group->lock(4, util::Priority::LOW, [&] { ++notified[4]; }), }; // Note that because this is in a scope, for the rest of the AND_WHEN calls, no locks have been @@ -291,9 +291,9 @@ namespace threading { WHEN("Creating a series of locks") { std::array notified = {0, 0, 0}; std::array, 3> locks = { - group->lock(0, 1, [&] { ++notified[0]; }), - group->lock(1, 1, [&] { ++notified[1]; }), - group->lock(2, 1, [&] { ++notified[2]; }), + group->lock(0, util::Priority::LOW, [&] { ++notified[0]; }), + group->lock(1, util::Priority::LOW, [&] { ++notified[1]; }), + group->lock(2, util::Priority::LOW, [&] { ++notified[2]; }), }; THEN("Locking and then unlocking the second lock") { @@ -316,7 +316,7 @@ namespace threading { WHEN("Creating a lock and locking it") { int notified1 = 0; - std::unique_ptr lock1 = group->lock(1, 1, [&] { ++notified1; }); + std::unique_ptr lock1 = group->lock(1, util::Priority::LOW, [&] { ++notified1; }); lock1->lock(); THEN("The lock should be true") { @@ -325,7 +325,7 @@ namespace threading { AND_WHEN("Creating a second lock with a higher priority") { int notified2 = 0; - std::unique_ptr lock2 = group->lock(2, 2, [&] { ++notified2; }); + std::unique_ptr lock2 = group->lock(2, util::Priority::NORMAL, [&] { ++notified2; }); THEN("The new lock should be false") { CHECK(lock1->lock() == true); @@ -352,7 +352,7 @@ namespace threading { WHEN("Creating a lock and locking it") { int notified1 = 0; - std::unique_ptr lock1 = group->lock(1, 1, [&] { ++notified1; }); + std::unique_ptr lock1 = group->lock(1, util::Priority::LOW, [&] { ++notified1; }); lock1->lock(); THEN("The lock should be true") { @@ -361,7 +361,7 @@ namespace threading { AND_WHEN("Adding a second lock") { int notified2 = 0; - std::unique_ptr lock2 = group->lock(2, 1, [&] { ++notified2; }); + std::unique_ptr lock2 = group->lock(2, util::Priority::LOW, [&] { ++notified2; }); THEN("The second lock should be false") { CHECK(lock2->lock() == false); @@ -378,7 +378,7 @@ namespace threading { AND_WHEN("Adding a third lock with higher priority") { int notified3 = 0; - std::unique_ptr lock3 = group->lock(3, 2, [&] { ++notified3; }); + std::unique_ptr lock3 = group->lock(3, util::Priority::NORMAL, [&] { ++notified3; }); THEN("The third lock should be lockable and second lock should not") { CHECK(lock3->lock() == true);