diff --git a/userspace/libsinsp/test/eventformatter.ut.cpp b/userspace/libsinsp/test/eventformatter.ut.cpp index 4aa4093ca70..6d0d2b1cf04 100644 --- a/userspace/libsinsp/test/eventformatter.ut.cpp +++ b/userspace/libsinsp/test/eventformatter.ut.cpp @@ -49,26 +49,18 @@ class sinsp_formatter_test : public sinsp_with_test_input open_inspector(); } - void TearDown() override - { - m_last_res = false; - m_last_output.clear(); - m_last_field_names.clear(); - m_last_field_values.clear(); - } - void format(const std::string& fmt, sinsp_evt_formatter::output_format of = sinsp_evt_formatter::output_format::OF_NORMAL) { sinsp_evt_formatter f(&m_inspector, fmt, m_filter_list); - auto evt = generate_getcwd_exit_event(); + auto evt = generate_getcwd_failed_entry_event(); f.get_field_names(m_last_field_names); auto r1 = f.resolve_tokens(evt, m_last_field_values); auto r2 = f.tostring_withformat(evt, m_last_output, of); m_last_res = r1 && r2; } - bool m_last_res; + bool m_last_res = false; std::string m_last_output; std::vector m_last_field_names; std::map m_last_field_values; diff --git a/userspace/libsinsp/test/filter_compiler.ut.cpp b/userspace/libsinsp/test/filter_compiler.ut.cpp index d6da386900d..c974cd54a7d 100644 --- a/userspace/libsinsp/test/filter_compiler.ut.cpp +++ b/userspace/libsinsp/test/filter_compiler.ut.cpp @@ -277,5 +277,5 @@ TEST_F(sinsp_with_test_input, filter_simple_evaluation) // Basic case just to assert that the basic setup works add_default_init_thread(); open_inspector(); - ASSERT_TRUE(evaluate_filter_str(&m_inspector, "(evt.type = getcwd)", generate_getcwd_exit_event())); + ASSERT_TRUE(evaluate_filter_str(&m_inspector, "(evt.type = getcwd)", generate_getcwd_failed_entry_event())); } diff --git a/userspace/libsinsp/test/sinsp_with_test_input.cpp b/userspace/libsinsp/test/sinsp_with_test_input.cpp index bcefec677b3..c7592dd6a38 100644 --- a/userspace/libsinsp/test/sinsp_with_test_input.cpp +++ b/userspace/libsinsp/test/sinsp_with_test_input.cpp @@ -260,7 +260,7 @@ sinsp_evt* sinsp_with_test_input::generate_random_event(int64_t tid_caller) return add_event_advance_ts(increasing_ts(), tid_caller, PPME_SYSCALL_GETCWD_E, 0); } -sinsp_evt* sinsp_with_test_input::generate_getcwd_exit_event(int64_t tid_caller) +sinsp_evt* sinsp_with_test_input::generate_getcwd_failed_entry_event(int64_t tid_caller) { int64_t err = -1; std::string path = "/test/dir"; diff --git a/userspace/libsinsp/test/sinsp_with_test_input.h b/userspace/libsinsp/test/sinsp_with_test_input.h index cb3e9d00229..02efb1e747a 100644 --- a/userspace/libsinsp/test/sinsp_with_test_input.h +++ b/userspace/libsinsp/test/sinsp_with_test_input.h @@ -67,7 +67,7 @@ class sinsp_with_test_input : public ::testing::Test void remove_thread(int64_t tid_to_remove, int64_t reaper_tid); sinsp_evt* generate_proc_exit_event(int64_t tid_to_remove, int64_t reaper_tid); sinsp_evt* generate_random_event(int64_t tid_caller = INIT_TID); - sinsp_evt* generate_getcwd_exit_event(int64_t tid_caller = INIT_TID); + sinsp_evt* generate_getcwd_failed_entry_event(int64_t tid_caller = INIT_TID); //=============================== PROCESS GENERATION ===========================