Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 89f1f17

Browse files
committed
Klocwork fix: Using uninitialized variable
A test consists in getting a value and testing it. But currently the value is tested even if the "get" has failed. This patch fixes it. Signed-off-by: Thomas Cahuzac <[email protected]>
1 parent 3d178a2 commit 89f1f17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/functional-tests/FloatingPoint.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ SCENARIO_METHOD(FloatsPF, "Floating points", "[floating points]")
9999
GIVEN ("A valid value " + vec.title) {
100100
CHECK_NOTHROW(setParameter(path, vec.payload));
101101
string getValueBack;
102-
CHECK_NOTHROW(getParameter(path, getValueBack));
102+
REQUIRE_NOTHROW(getParameter(path, getValueBack));
103103
CHECK(getValueBack == vec.payload);
104104
}
105105
}
@@ -138,7 +138,7 @@ SCENARIO_METHOD(FloatsPF, "Floating points", "[floating points]")
138138
GIVEN ("A valid value " + vec.title) {
139139
CHECK_NOTHROW(setParameter(path, vec.payload));
140140
string getValueBack;
141-
CHECK_NOTHROW(getParameter(path, getValueBack));
141+
REQUIRE_NOTHROW(getParameter(path, getValueBack));
142142
CHECK(getValueBack == vec.payload);
143143
}
144144
}
@@ -161,7 +161,7 @@ SCENARIO_METHOD(FloatsPF, "Floating points", "[floating points]")
161161
GIVEN ("A valid value " + vec.title) {
162162
CHECK_NOTHROW(handle.setAsDouble(vec.payload));
163163
double getValueBack;
164-
CHECK_NOTHROW(handle.getAsDouble(getValueBack));
164+
REQUIRE_NOTHROW(handle.getAsDouble(getValueBack));
165165
CHECK(getValueBack == vec.payload);
166166
}
167167
}

0 commit comments

Comments
 (0)