From a4c769ea2fbaf646cd66898c483580409e3500d8 Mon Sep 17 00:00:00 2001 From: Phil Miller Date: Tue, 28 Jul 2020 19:27:50 -0400 Subject: [PATCH] #649: Convert some tests away from addAction --- tests/unit/active/test_active_bcast_put.cc | 22 +++++++++++----------- tests/unit/active/test_active_broadcast.cc | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/unit/active/test_active_bcast_put.cc b/tests/unit/active/test_active_bcast_put.cc index a9023d938e..03b7133301 100644 --- a/tests/unit/active/test_active_bcast_put.cc +++ b/tests/unit/active/test_active_bcast_put.cc @@ -121,19 +121,19 @@ TEST_P(TestActiveBroadcastPut, test_type_safe_active_fn_bcast2) { } if (root < num_nodes) { - if (my_node == root) { - for (int i = 0; i < num_msg_sent; i++) { - auto msg = makeMessage(); - msg->setPut(&put_payload[0], put_size * sizeof(int)); - theMsg()->broadcastMsg(msg.get()); - } - } - - theTerm()->addAction([=]{ - if (my_node != root) { - ASSERT_TRUE(handler_count == num_msg_sent); + runInEpochCollective([&]{ + if (my_node == root) { + for (int i = 0; i < num_msg_sent; i++) { + auto msg = makeMessage(); + msg->setPut(&put_payload[0], put_size * sizeof(int)); + theMsg()->broadcastMsg(msg.get()); + } } }); + + if (my_node != root) { + ASSERT_TRUE(handler_count == num_msg_sent); + } } // Spin here so test_vec does not go out of scope before the send completes diff --git a/tests/unit/active/test_active_broadcast.cc b/tests/unit/active/test_active_broadcast.cc index 795d3c874a..0ce1f1302b 100644 --- a/tests/unit/active/test_active_broadcast.cc +++ b/tests/unit/active/test_active_broadcast.cc @@ -95,18 +95,18 @@ TEST_P(TestActiveBroadcast, test_type_safe_active_fn_bcast2) { #endif if (root < num_nodes) { - if (my_node == root) { - for (int i = 0; i < num_msg_sent; i++) { - auto msg = makeMessage(); - theMsg()->broadcastMsg(msg.get()); - } - } - - theTerm()->addAction([=]{ - if (my_node != root) { - ASSERT_TRUE(handler_count == num_msg_sent); + runInEpochCollective([&]{ + if (my_node == root) { + for (int i = 0; i < num_msg_sent; i++) { + auto msg = makeMessage(); + theMsg()->broadcastMsg(msg.get()); + } } }); + + if (my_node != root) { + ASSERT_TRUE(handler_count == num_msg_sent); + } } }