Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 516bfa5

Browse files
authored
Fix Klocwork warnings (#2698)
1 parent db61000 commit 516bfa5

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

test/all_close_f.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ class all_close_f_param_test : public testing::TestWithParam<::std::tuple<float,
192192
float lower_bound;
193193
float past_upper_bound;
194194
float past_lower_bound;
195-
float min_signal_too_low;
196-
float min_signal_enables_passing;
195+
float min_signal_too_low{0};
196+
float min_signal_enables_passing{0};
197197
};
198198

199199
TEST_P(all_close_f_param_test, test_boundaries)
@@ -349,8 +349,8 @@ class all_close_f_double_param_test : public testing::TestWithParam<::std::tuple
349349
double lower_bound;
350350
double past_upper_bound;
351351
double past_lower_bound;
352-
double min_signal_too_low;
353-
double min_signal_enables_passing;
352+
double min_signal_too_low{0};
353+
double min_signal_enables_passing{0};
354354
};
355355

356356
TEST_P(all_close_f_double_param_test, test_boundaries)

test/cpu_debugger.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ using namespace std;
4040

4141
bool static is_codegen_mode()
4242
{
43-
if (std::getenv("NGRAPH_CODEGEN") != nullptr &&
44-
std::string(std::getenv("NGRAPH_CODEGEN")) != "0")
43+
static bool codegen_set = false;
44+
static bool codegen_mode = false;
45+
if (!codegen_set)
4546
{
46-
return true;
47+
const char* ngraph_codegen = std::getenv("NGRAPH_CODEGEN");
48+
codegen_mode = (ngraph_codegen != nullptr) && std::string(ngraph_codegen) != "0";
49+
codegen_set = true;
4750
}
48-
return false;
51+
return codegen_mode;
4952
}
5053

5154
// These tests are for DEX mode only.

0 commit comments

Comments
 (0)