Commit 117cd0e1 authored by Tom Perkins's avatar Tom Perkins
Browse files

Test getPropertyAsSingleValue for valid string type

Add a test for a string like "1" that can be lexically converted to a double

re #17087
parent 203786f2
......@@ -255,6 +255,15 @@ public:
doTest_GetPropertyAsSingleValue_SingleType<uint64_t>(1UL);
}
void doTest_GetPropertyAsSingleValue_SingleValue_StringType() {
LogManager runInfo;
const std::string name = "string_prop", value = "1";
runInfo.addProperty<std::string>(name, value);
double result = std::nan("1");
TS_ASSERT_THROWS_NOTHING(result = runInfo.getPropertyAsSingleValue(name));
TS_ASSERT_EQUALS(value, std::to_string(result));
}
void
test_GetPropertyAsSingleValue_Throws_If_Type_Is_Not_Numeric_Or_TimeSeries_Numeric() {
LogManager runInfo;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment