File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,7 @@ template <>
79
79
inline boost::any DefaultCastRegisterer<std::string>::cast
80
80
(std::istringstream &iss)
81
81
{
82
- std::string inst (" " );
83
- iss >> inst;
82
+ std::string inst (iss.str ());
84
83
return inst;
85
84
}
86
85
Original file line number Diff line number Diff line change @@ -92,12 +92,21 @@ BOOST_AUTO_TEST_CASE (plug_signal_string)
92
92
Signal<std::string, int > outSig (" output" );
93
93
SignalPtr<std::string, int > inSig (NULL , " input" );
94
94
95
- std::string str (" value " );
95
+ std::string str (" two words " );
96
96
outSig.setConstant (str);
97
97
inSig.plug (&outSig);
98
98
inSig.recompute (1 );
99
- std::ostringstream os;
100
- inSig.get (os);
101
- std::string res (os.str ());
99
+ std::ostringstream os1;
100
+ inSig.get (os1);
101
+ std::string res (os1.str ());
102
+ BOOST_CHECK (res == str);
103
+
104
+ Signal<std::string, int > s (" signal" );
105
+ std::ostringstream os2;
106
+ s.setConstant (str);
107
+ os2.clear ();
108
+ s.get (os2);
109
+ res = os2.str ();
110
+ std::cout << " res=" << res << std::endl;
102
111
BOOST_CHECK (res == str);
103
112
}
You can’t perform that action at this time.
0 commit comments