From 5c41e8ee5ce44de5648565155fba68ae960d193d Mon Sep 17 00:00:00 2001 From: ymski <114902604+ymski@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:11:58 +0900 Subject: [PATCH] refactor Signed-off-by: ymski <114902604+ymski@users.noreply.github.com> --- CARET_trace/test/test_trace_node.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CARET_trace/test/test_trace_node.cpp b/CARET_trace/test/test_trace_node.cpp index 0e5ce225..a6b81046 100644 --- a/CARET_trace/test/test_trace_node.cpp +++ b/CARET_trace/test/test_trace_node.cpp @@ -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); @@ -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); @@ -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 @@ -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));