Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
Signed-off-by: ymski <[email protected]>
  • Loading branch information
ymski committed Jan 19, 2024
1 parent f53bfac commit 00a30d6
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions CARET_trace/test/test_trace_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ TEST_F(CaretTraceNodeTest, TestPrepareTransition)
{
init_context();

{ // subscribe start message with lttng session: PREPARE -> PREPARE
{ // subscribe start message without lttng session: PREPARE -> PREPARE
set_status(TRACE_STATUS::PREPARE);
set_lttng_session_running_return_value(true);
set_lttng_session_running_return_value(false);

EXPECT_TRUE(node_->get_status() == TRACE_STATUS::PREPARE);

Expand All @@ -203,9 +203,9 @@ TEST_F(CaretTraceNodeTest, TestPrepareTransition)
EXPECT_TRUE(node_->get_status() == TRACE_STATUS::PREPARE);
}

{ // subscribe start message without lttng session: PREPARE -> PREPARE
{ // subscribe start message with lttng session: PREPARE -> PREPARE
set_status(TRACE_STATUS::PREPARE);
set_lttng_session_running_return_value(false);
set_lttng_session_running_return_value(true);

EXPECT_TRUE(node_->get_status() == TRACE_STATUS::PREPARE);

Expand All @@ -215,28 +215,28 @@ TEST_F(CaretTraceNodeTest, TestPrepareTransition)
EXPECT_TRUE(node_->get_status() == TRACE_STATUS::PREPARE);
}

{ // subscribe end message with lttng session: PREPARE -> PREPARE
{ // subscribe end message without lttng session: PREPARE -> WAIT
set_status(TRACE_STATUS::PREPARE);
set_lttng_session_running_return_value(true);
set_lttng_session_running_return_value(false);

EXPECT_TRUE(node_->get_status() == TRACE_STATUS::PREPARE);

auto end_msg = get_end_msg();
node_->end_callback(std::move(end_msg));

EXPECT_TRUE(node_->get_status() == TRACE_STATUS::PREPARE);
EXPECT_TRUE(node_->get_status() == TRACE_STATUS::WAIT);
}

{ // subscribe end message without lttng session: PREPARE -> WAIT
{ // subscribe end message with lttng session: PREPARE -> PREPARE
set_status(TRACE_STATUS::PREPARE);
set_lttng_session_running_return_value(false);
set_lttng_session_running_return_value(true);

EXPECT_TRUE(node_->get_status() == TRACE_STATUS::PREPARE);

auto end_msg = get_end_msg();
node_->end_callback(std::move(end_msg));

EXPECT_TRUE(node_->get_status() == TRACE_STATUS::WAIT);
EXPECT_TRUE(node_->get_status() == TRACE_STATUS::PREPARE);
}

{ // transition by timer_callback: PREPARE -> RECORD
Expand All @@ -260,22 +260,22 @@ TEST_F(CaretTraceNodeTest, TestRecordTransition)
{
init_context();

{ // subscribe start message with lttng session: RECORD -> RECORD
{ // subscribe start message without lttng session: RECORD -> RECORD
set_status(TRACE_STATUS::RECORD);
EXPECT_TRUE(node_->get_status() == TRACE_STATUS::RECORD);

set_lttng_session_running_return_value(true);
set_lttng_session_running_return_value(false);
auto start_msg = get_start_msg();
node_->start_callback(std::move(start_msg));

EXPECT_TRUE(node_->get_status() == TRACE_STATUS::RECORD);
}

{ // subscribe start message without lttng session: RECORD -> RECORD
{ // subscribe start message with lttng session: RECORD -> RECORD
set_status(TRACE_STATUS::RECORD);
EXPECT_TRUE(node_->get_status() == TRACE_STATUS::RECORD);

set_lttng_session_running_return_value(false);
set_lttng_session_running_return_value(true);
auto start_msg = get_start_msg();
node_->start_callback(std::move(start_msg));

Expand Down

0 comments on commit 00a30d6

Please sign in to comment.