Skip to content

Commit e70e3c8

Browse files
Add a test that sets a signal to empty string.
1 parent 7086411 commit e70e3c8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/signal-ptr.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,19 @@ BOOST_AUTO_TEST_CASE(plug_signal_string) {
297297
std::cout << "res=" << res << std::endl;
298298
BOOST_CHECK(res == str);
299299
}
300+
301+
BOOST_AUTO_TEST_CASE(set_signal_string) {
302+
Signal<std::string, int> s("signal");
303+
std::string str("");
304+
std::ostringstream os;
305+
os << str;
306+
std::istringstream value(os.str());
307+
try {
308+
s.set(value);
309+
}
310+
catch(const std::exception& exc)
311+
{
312+
std::cout << exc.what() << std::endl;
313+
BOOST_CHECK(!"Tentative to set signal to empty string");
314+
}
315+
}

0 commit comments

Comments
 (0)