Skip to content

Commit

Permalink
#649: Convert some tests away from addAction
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilMiller committed Jul 28, 2020
1 parent 879f871 commit a4c769e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
22 changes: 11 additions & 11 deletions tests/unit/active/test_active_bcast_put.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<PutTestMessage>();
msg->setPut(&put_payload[0], put_size * sizeof(int));
theMsg()->broadcastMsg<PutTestMessage, test_handler>(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<PutTestMessage>();
msg->setPut(&put_payload[0], put_size * sizeof(int));
theMsg()->broadcastMsg<PutTestMessage, test_handler>(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
Expand Down
20 changes: 10 additions & 10 deletions tests/unit/active/test_active_broadcast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<TestMsg>();
theMsg()->broadcastMsg<TestMsg, test_handler>(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<TestMsg>();
theMsg()->broadcastMsg<TestMsg, test_handler>(msg.get());
}
}
});

if (my_node != root) {
ASSERT_TRUE(handler_count == num_msg_sent);
}
}
}

Expand Down

0 comments on commit a4c769e

Please sign in to comment.