12 #include <boost/foreach.hpp> 13 #if BOOST_VERSION >= 105900 14 #include <boost/test/tools/output_test_stream.hpp> 16 #include <boost/test/output_test_stream.hpp> 18 #include <boost/test/unit_test.hpp> 21 #define BOOST_TEST_MODULE signal_array 23 using boost::test_tools::output_test_stream;
34 sigArr_C.operator<<(sigBa);
35 sigArr_C.operator<<(sigBa);
36 BOOST_CHECK_EQUAL(2, sigArr_C.
getSize());
39 sigArr.operator<<(sigBa);
40 sigArr.operator<<(sigBa);
41 BOOST_CHECK_EQUAL(2, sigArr.getSize());
46 sigA.operator<<(sigB);
55 BOOST_CHECK_EQUAL(
true, sigB.
getReady());
64 output_test_stream output;
66 BOOST_CHECK(output.is_equal(
""));
73 res = (aea.
getCode() == ExceptionSignal::PLUG_IMPOSSIBLE);
81 res = (aea.
getCode() == ExceptionSignal::PLUG_IMPOSSIBLE);
89 res = (aea.
getCode() == ExceptionSignal::PLUG_IMPOSSIBLE);
98 res = (aea.
getCode() == ExceptionSignal::PLUG_IMPOSSIBLE);
103 std::istringstream iss(
"empty");
108 res = (aea.
getCode() == ExceptionSignal::SET_IMPOSSIBLE);
114 std::ostringstream oss;
118 res = (aea.
getCode() == ExceptionSignal::SET_IMPOSSIBLE);
127 res = (aea.
getCode() == ExceptionSignal::SET_IMPOSSIBLE);
136 res = (aea.
getCode() == ExceptionSignal::SET_IMPOSSIBLE);
142 BOOST_CHECK(output.is_equal(
"Sig:test"));
146 std::istringstream iss;
151 std::istringstream iss_fail;
157 output_test_stream output;
168 amatrix.resize(2, 2);
175 std::istringstream aiss(
"test");
virtual void trace(std::ostream &) const
virtual Time getPeriodTime() const
virtual void setConstantDefault()
virtual void recompute(const Time &)
virtual void setPeriodTime(const Time &)
Class used for I/O operations in Signal<T,Time>
dynamicgraph::SignalArray_const< double > sig
Exceptions raised when an error related to signals happen.
virtual void get(std::ostream &) const
virtual void set(std::istringstream &)
int getCode() const
Access to the error code.
virtual void checkCompatibility()
virtual std::ostream & display(std::ostream &os) const
virtual unsigned int getSize() const
BOOST_AUTO_TEST_CASE(test_array)
virtual void addDependency(const SignalBase< Time > &)
virtual void plug(SignalBase< Time > *sigarg)
virtual bool needUpdate(const Time &) const
virtual void clearDependencies()
virtual std::ostream & writeGraph(std::ostream &os) const
void setReady(const bool sready=true)
virtual void removeDependency(const SignalBase< Time > &)
const bool & getReady() const