6
6
7
7
#include " core/util/include/util.hpp"
8
8
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
+
9
14
TEST (util_tests, check_unset_env) {
10
15
#ifndef _WIN32
11
16
int save_var = ppc::util::GetPPCNumThreads ();
12
17
13
- unsetenv (" OMP_NUM_THREADS" ); // NOLINT(misc-include-cleaner)
18
+ unsetenv (" OMP_NUM_THREADS" );
14
19
15
20
EXPECT_EQ (ppc::util::GetPPCNumThreads (), 1 );
16
21
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 );
18
23
#else
19
24
GTEST_SKIP ();
20
25
#endif
@@ -25,11 +30,11 @@ TEST(util_tests, check_set_env) {
25
30
int save_var = ppc::util::GetPPCNumThreads ();
26
31
27
32
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 );
29
34
30
35
EXPECT_EQ (ppc::util::GetPPCNumThreads (), num_threads);
31
36
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 );
33
38
#else
34
39
GTEST_SKIP ();
35
40
#endif
0 commit comments