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

Commit 7d95b4c

Browse files
author
Sebastien Guiriec
committed
Functional Test: Add Raw Value for Integer test case.
Add few additional test for Integer parameter in Hexa format. Signed-off-by: Sebastien Guiriec <[email protected]>
1 parent b5ecca5 commit 7d95b4c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/functional-tests/Integer.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,31 @@ SCENARIO_METHOD(IntegerPF, "Integer types", "[Integer types]")
130130
}
131131
}
132132

133+
AND_THEN ("Set/Get a integer type parameter in raw value space") {
134+
REQUIRE_NOTHROW(setRawValueSpace(true));
135+
REQUIRE_NOTHROW(setHexOutputFormat(true));
136+
137+
for (auto &vec : Tests<string>{
138+
{"(too high)", "0x0D"}, {"(too low)", "0xCD"},
139+
}) {
140+
GIVEN ("Invalid value " + vec.title) {
141+
CHECK_THROWS_AS(setParameter(path, vec.payload), Exception);
142+
}
143+
}
144+
for (auto &vec : Tests<string>{
145+
{"(upper limit)", "0x0C"},
146+
{"(lower limit)", "0xCE"},
147+
{"(inside range)", "0x00"},
148+
}) {
149+
GIVEN ("A valid value " + vec.title) {
150+
CHECK_NOTHROW(setParameter(path, vec.payload));
151+
string getValueBack;
152+
REQUIRE_NOTHROW(getParameter(path, getValueBack));
153+
CHECK(getValueBack == vec.payload);
154+
}
155+
}
156+
}
157+
133158
AND_THEN ("Set/Get integer type parameter handle") {
134159
ElementHandle handle{*this, path};
135160
/** @FIXME: 'set' operations on a ParameterHandle are silently

0 commit comments

Comments
 (0)