Skip to content

Commit

Permalink
State argument removed from execute_command
Browse files Browse the repository at this point in the history
  • Loading branch information
eflumerf committed Jul 18, 2024
1 parent 001121a commit 642c60e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions unittest/DFOModule_test.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ BOOST_AUTO_TEST_CASE(Commands)
auto start_json = "{\"run\": 1}"_json;
auto null_json = "{}"_json;

dfo->execute_command("conf", "INITIAL", conf_json);
dfo->execute_command("start", "CONFIGURED", start_json);
dfo->execute_command("drain_dataflow", "RUNNING", null_json);
dfo->execute_command("scrap", "CONFIGURED", null_json);
dfo->execute_command("conf", conf_json);
dfo->execute_command("start", start_json);
dfo->execute_command("drain_dataflow", null_json);
dfo->execute_command("scrap", null_json);

auto info = get_dfo_info(dfo);
BOOST_REQUIRE_EQUAL(info.tokens_received, 0);
Expand All @@ -180,7 +180,7 @@ BOOST_AUTO_TEST_CASE(DataFlow)
auto start_json = "{\"run\": 1}"_json;
auto null_json = "{}"_json;

dfo->execute_command("conf", "INITIAL", conf_json);
dfo->execute_command("conf", conf_json);

auto iom = iomanager::IOManager::get();
auto dec_recv = iom->get_receiver<dfmessages::TriggerDecision>("trigdec_0");
Expand All @@ -198,7 +198,7 @@ BOOST_AUTO_TEST_CASE(DataFlow)
auto info = get_dfo_info(dfo);
BOOST_REQUIRE_EQUAL(info.tokens_received, 0);

dfo->execute_command("start", "CONFIGURED", start_json);
dfo->execute_command("start", start_json);
send_init_token();

std::this_thread::sleep_for(std::chrono::milliseconds(150));
Expand Down Expand Up @@ -227,8 +227,8 @@ BOOST_AUTO_TEST_CASE(DataFlow)
BOOST_REQUIRE_EQUAL(info.decisions_sent, 1);
BOOST_REQUIRE(!busy_signal_recvd.load());

dfo->execute_command("drain_dataflow", "RUNNING", null_json);
dfo->execute_command("scrap", "CONFIGURED", null_json);
dfo->execute_command("drain_dataflow", null_json);
dfo->execute_command("scrap", null_json);

dec_recv->remove_callback();
inh_recv->remove_callback();
Expand All @@ -244,9 +244,9 @@ BOOST_AUTO_TEST_CASE(SendTrigDecFailed)
auto start_json = "{\"run\": 1}"_json;
auto null_json = "{}"_json;

dfo->execute_command("conf", "INITIAL", conf_json);
dfo->execute_command("conf", conf_json);

dfo->execute_command("start", "CONFIGURED", start_json);
dfo->execute_command("start", start_json);

send_init_token("invalid_connection");

Expand All @@ -267,8 +267,8 @@ BOOST_AUTO_TEST_CASE(SendTrigDecFailed)
send_token(1000);
std::this_thread::sleep_for(std::chrono::milliseconds(50));

dfo->execute_command("drain_dataflow", "RUNNING", null_json);
dfo->execute_command("scrap", "CONFIGURED", null_json);
dfo->execute_command("drain_dataflow", null_json);
dfo->execute_command("scrap", null_json);
}

BOOST_AUTO_TEST_SUITE_END()
Expand Down

0 comments on commit 642c60e

Please sign in to comment.