Skip to content

Commit 85fcf12

Browse files
Add a test on plugging signals of type string
1 parent db25cb6 commit 85fcf12

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
@@ -86,3 +86,19 @@ BOOST_AUTO_TEST_CASE(normal_test) {
8686
sigPtrBRef.get(cout);
8787
cout << std::endl;
8888
}
89+
90+
BOOST_AUTO_TEST_CASE (plug_signal_string)
91+
{
92+
Signal<std::string, int> outSig("output");
93+
SignalPtr<std::string, int> inSig (NULL, "input");
94+
95+
std::string str ("value");
96+
outSig.setConstant(str);
97+
inSig.plug (&outSig);
98+
inSig.recompute(1);
99+
std::ostringstream os;
100+
inSig.get (os);
101+
std::string res (os.str ());
102+
// Note that a '\n' is added when passing through the signal
103+
BOOST_CHECK (res == str);
104+
}

0 commit comments

Comments
 (0)