Skip to content
Snippets Groups Projects
Commit a868b338 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Fix style

parent a8451161
No related branches found
No related tags found
No related merge requests found
......@@ -76,18 +76,16 @@ void DefaultCastRegisterer<dynamicgraph::Matrix>::trace(
// for std::string, do not check failure. If input stream contains an
// empty string, iss.fail() returns true and an exception is thrown
template <>
inline boost::any DefaultCastRegisterer<std::string>::cast
(std::istringstream &iss)
{
std::string inst (iss.str ());
inline boost::any
DefaultCastRegisterer<std::string>::cast(std::istringstream &iss) {
std::string inst(iss.str());
return inst;
}
// for std::string, do not add std::endl at the end of the stream.
template <>
inline void DefaultCastRegisterer<std::string>::disp
(const boost::any &object, std::ostream &os)
{
inline void DefaultCastRegisterer<std::string>::disp(const boost::any &object,
std::ostream &os) {
os << boost::any_cast<std::string>(object);
}
......
......@@ -87,26 +87,25 @@ BOOST_AUTO_TEST_CASE(normal_test) {
cout << std::endl;
}
BOOST_AUTO_TEST_CASE (plug_signal_string)
{
BOOST_AUTO_TEST_CASE(plug_signal_string) {
Signal<std::string, int> outSig("output");
SignalPtr<std::string, int> inSig (NULL, "input");
SignalPtr<std::string, int> inSig(NULL, "input");
std::string str ("two words");
std::string str("two words");
outSig.setConstant(str);
inSig.plug (&outSig);
inSig.plug(&outSig);
inSig.recompute(1);
std::ostringstream os1;
inSig.get (os1);
std::string res (os1.str ());
BOOST_CHECK (res == str);
inSig.get(os1);
std::string res(os1.str());
BOOST_CHECK(res == str);
Signal<std::string, int> s ("signal");
Signal<std::string, int> s("signal");
std::ostringstream os2;
s.setConstant (str);
os2.clear ();
s.get (os2);
res = os2.str ();
s.setConstant(str);
os2.clear();
s.get(os2);
res = os2.str();
std::cout << "res=" << res << std::endl;
BOOST_CHECK (res == str);
BOOST_CHECK(res == str);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment