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

Commit f28f9fe

Browse files
author
Sebastien Guiriec
committed
Functional test: Check rejection of Integer parameter in double format
Integer parameter cannot be set in double format except in case of Linear or Logarithm Adaptation format. Signed-off-by: Sebastien Guiriec <[email protected]>
1 parent d8f1b76 commit f28f9fe

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/functional-tests/Integer.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,30 @@ SCENARIO_METHOD(IntegerPF, "Integer types", "[Integer types]")
154154
}
155155
}
156156
}
157+
158+
AND_THEN ("Set/Get double type parameter handle") {
159+
ElementHandle handle{*this, path};
160+
/** @FIXME: 'set' operations on a ParameterHandle are silently
161+
* ignored in tuning mode. Does it make sense ? */
162+
REQUIRE_NOTHROW(setTuningMode(false));
163+
164+
for (auto &vec : Tests<double>{
165+
{"(upper limit)", 12.0f},
166+
{"(lower limit)", -50.0f},
167+
{"(inside range)", 0.0f},
168+
}) {
169+
GIVEN ("A valid value (rejected not supported)" + vec.title) {
170+
CHECK_THROWS_AS(handle.setAsDouble(vec.payload), Exception);
171+
}
172+
}
173+
for (auto &vec : Tests<double>{
174+
{"(too high)", 12.01f}, {"(too low)", -50.01f},
175+
}) {
176+
GIVEN ("An invalid value " + vec.title) {
177+
CHECK_THROWS_AS(handle.setAsDouble(vec.payload), Exception);
178+
}
179+
}
180+
}
157181
}
158182
}
159183
}

0 commit comments

Comments
 (0)