66
77#include " core/util/include/util.hpp"
88
9+ #ifndef _WIN32
10+ extern " C" int unsetenv (const char * name);
11+ extern " C" int setenv (const char * name, const char * value, int overwrite);
12+ #endif
13+
914TEST (util_tests, check_unset_env) {
1015#ifndef _WIN32
1116 int save_var = ppc::util::GetPPCNumThreads ();
1217
13- unsetenv (" OMP_NUM_THREADS" ); // NOLINT(misc-include-cleaner)
18+ unsetenv (" OMP_NUM_THREADS" );
1419
1520 EXPECT_EQ (ppc::util::GetPPCNumThreads (), 1 );
1621
17- setenv (" OMP_NUM_THREADS" , std::to_string (save_var).c_str (), 1 ); // NOLINT(misc-include-cleaner)
22+ setenv (" OMP_NUM_THREADS" , std::to_string (save_var).c_str (), 1 );
1823#else
1924 GTEST_SKIP ();
2025#endif
@@ -25,11 +30,11 @@ TEST(util_tests, check_set_env) {
2530 int save_var = ppc::util::GetPPCNumThreads ();
2631
2732 const int num_threads = static_cast <int >(std::thread::hardware_concurrency ());
28- setenv (" OMP_NUM_THREADS" , std::to_string (num_threads).c_str (), 1 ); // NOLINT(misc-include-cleaner)
33+ setenv (" OMP_NUM_THREADS" , std::to_string (num_threads).c_str (), 1 );
2934
3035 EXPECT_EQ (ppc::util::GetPPCNumThreads (), num_threads);
3136
32- setenv (" OMP_NUM_THREADS" , std::to_string (save_var).c_str (), 1 ); // NOLINT(misc-include-cleaner)
37+ setenv (" OMP_NUM_THREADS" , std::to_string (save_var).c_str (), 1 );
3338#else
3439 GTEST_SKIP ();
3540#endif
0 commit comments