Skip to content

Commit 3ffef93

Browse files
committed
DPL: extend test to check for spaces
1 parent 0476f73 commit 3ffef93

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

Framework/Core/test/test_DeviceConfigInfo.cxx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,21 @@ BOOST_AUTO_TEST_CASE(TestDeviceConfigInfo)
9494
BOOST_CHECK(strncmp(match.beginValue, "bar", 3) == 0);
9595
BOOST_CHECK(strncmp(match.beginProvenance, "prov", 4) == 0);
9696

97+
// Parse a simple configuration bit with a space in the value
98+
configString = "foo[XX:XX:XX][INFO] [CONFIG] foo=bar and foo 1789372894 prov\n";
99+
std::string_view configWithSpace{configString.data() + 3, configString.size() - 4};
100+
BOOST_REQUIRE_EQUAL(configWithSpace, std::string("[XX:XX:XX][INFO] [CONFIG] foo=bar and foo 1789372894 prov"));
101+
result = DeviceConfigHelper::parseConfig(configWithSpace, match);
102+
BOOST_REQUIRE_EQUAL(result, true);
103+
BOOST_CHECK(strncmp(match.beginKey, "foo", 3) == 0);
104+
BOOST_CHECK_EQUAL(match.timestamp, 1789372894);
105+
BOOST_CHECK(strncmp(match.beginValue, "bar and foo", 11) == 0);
106+
BOOST_CHECK(strncmp(match.beginProvenance, "prov", 4) == 0);
107+
97108
// Process a given config entry
98109
result = DeviceConfigHelper::processConfig(match, info);
99110
BOOST_CHECK_EQUAL(result, true);
100-
BOOST_CHECK_EQUAL(info.currentConfig.get<std::string>("foo"), "bar");
111+
BOOST_CHECK_EQUAL(info.currentConfig.get<std::string>("foo"), "bar and foo");
101112
BOOST_CHECK_EQUAL(info.currentProvenance.get<std::string>("foo"), "prov");
102113

103114
// Parse an array

0 commit comments

Comments
 (0)