Skip to content

reset test global variable after use to suppress coverity false-positive. #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/utils/utils_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void helper_log_init(const char *var) {
fopen_count = 0;
fput_count = 0;
util_log_init();
env_variable = NULL;
EXPECT_EQ(fopen_count, expect_fopen_count);
EXPECT_EQ(fput_count, expect_fput_count);
}
Expand Down Expand Up @@ -97,7 +98,6 @@ TEST_F(test, parseEnv_errors) {
expected_message = "[ERROR UMF] Cannot open output file - path too long\n";
std::string test_env = "output:file," + std::string(300, 'x');
helper_log_init(test_env.c_str());
env_variable = NULL; // reset env_variable as test_env string is freed.
}

TEST_F(test, parseEnv) {
Expand Down