Commit a868b338 authored by Olivier Stasse's avatar Olivier Stasse

Fix style

parent a8451161
Pipeline #7635 passed with stage
in 4 minutes and 29 seconds
......@@ -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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment