13 #include <boost/foreach.hpp>
17 #if BOOST_VERSION >= 105900
18 #include <boost/test/tools/output_test_stream.hpp>
20 #include <boost/test/output_test_stream.hpp>
22 #include <boost/test/unit_test.hpp>
23 #include <boost/test/unit_test_suite.hpp>
26 using boost::test_tools::output_test_stream;
42 : proname(n), res(), call(), timedata() {}
44 T &
fun(T &res,
int t) {
68 res = call * timedata;
73 std::ostringstream oss;
74 oss << call * timedata;
90 cout <<
"Error catch" << std::endl;
116 output_test_stream output;
129 sig.setConstant(1.56);
131 std::string
name =
"sig";
133 std::string test =
"test";
135 sig.getClassName(test);
142 sigPtrA.recompute(3);
147 &sigPtrAbstractRef = sigPtrAbstract;
149 sigPtrARef.
plug(&sigRef);
150 sigPtrBRef.plug(&sigPtrARef);
152 sigPtrAbstractRef.plug(&sigRef);
156 int ltime = sigPtrA.getTime();
163 sigPtrA.setConstantDefault(1.2);
165 sigPtrA.setConstantDefault();
167 sigPtrA.setConstant(3.4);
172 sigPtrA.setReference(tab_D, NULL);
174 output_test_stream output;
175 sigPtrA.display(output);
176 sigPtrA.setReferenceNonConstant(tab_D, NULL);
178 sigPtrA.display(output);
181 sigPtrA.operator=(1.2);
183 sigPtrA.displayDependencies(output);
188 cout <<
"SigPtrA = ";
189 sigPtrARef.
get(cout);
191 cout <<
"SigPtrB = ";
192 sigPtrBRef.get(cout);
205 std::string str(
"two words");
209 std::ostringstream os1;
211 std::string res(os1.str());
212 BOOST_CHECK(res == str);
222 inSigVec.
plug(&outSigVec);
223 inSigVec.recompute(1);
224 output_test_stream output;
225 inSigVec.get(output);
226 BOOST_CHECK(output.is_equal(
"1 2 3 4 5"));
229 std::ostringstream os2;
234 std::cout <<
"res=" << res << std::endl;
235 BOOST_CHECK(res == str);
241 std::ostringstream os;
243 std::istringstream value(os.str());
246 }
catch (
const std::exception &exc) {
247 std::cout << exc.what() << std::endl;
248 BOOST_CHECK(!(
bool)(
"Tentative to set signal to empty string"));