Skip to content

Remove misc-include-cleaner suppression in util_tests.cpp #389

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
Show file tree
Hide file tree
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 .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ CheckOptions:
- key: readability-identifier-length.MinimumParameterNameLength
value: 1
- key: misc-include-cleaner.IgnoreHeaders
value: '(__chrono/.*)'
value: '(__chrono/.*|stdlib\.h)'
9 changes: 4 additions & 5 deletions modules/core/util/func_tests/util_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ TEST(util_tests, check_unset_env) {
#ifndef _WIN32
int save_var = ppc::util::GetPPCNumThreads();

unsetenv("PPC_NUM_THREADS"); // NOLINT(concurrency-mt-unsafe,misc-include-cleaner)
unsetenv("PPC_NUM_THREADS"); // NOLINT(concurrency-mt-unsafe)

EXPECT_EQ(ppc::util::GetPPCNumThreads(), 1);

setenv("PPC_NUM_THREADS", std::to_string(save_var).c_str(), 1); // NOLINT(concurrency-mt-unsafe,misc-include-cleaner)
setenv("PPC_NUM_THREADS", std::to_string(save_var).c_str(), 1); // NOLINT(concurrency-mt-unsafe)
#else
GTEST_SKIP();
#endif
Expand All @@ -25,12 +25,11 @@ TEST(util_tests, check_set_env) {
int save_var = ppc::util::GetPPCNumThreads();

const int num_threads = static_cast<int>(std::thread::hardware_concurrency());
// NOLINTNEXTLINE(concurrency-mt-unsafe,misc-include-cleaner)
setenv("PPC_NUM_THREADS", std::to_string(num_threads).c_str(), 1);
setenv("PPC_NUM_THREADS", std::to_string(num_threads).c_str(), 1); // NOLINT(concurrency-mt-unsafe)

EXPECT_EQ(ppc::util::GetPPCNumThreads(), num_threads);

setenv("PPC_NUM_THREADS", std::to_string(save_var).c_str(), 1); // NOLINT(concurrency-mt-unsafe,misc-include-cleaner)
setenv("PPC_NUM_THREADS", std::to_string(save_var).c_str(), 1); // NOLINT(concurrency-mt-unsafe)
#else
GTEST_SKIP();
#endif
Expand Down
Loading