Commit e34bd06d authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Update tests/debug-real-time-tracer.cpp

parent d9dc152e
...@@ -66,36 +66,37 @@ BOOST_AUTO_TEST_CASE(test_tracer) { ...@@ -66,36 +66,37 @@ BOOST_AUTO_TEST_CASE(test_tracer) {
std::string suffix(".dat"); std::string suffix(".dat");
/// Test openfiles /// Test openfiles
atracer.setBufferSize(1<<14);
atracer.openFiles(rootdir, basename, suffix); atracer.openFiles(rootdir, basename, suffix);
/// Add trace by name /// Add trace by name
atracer.addSignalToTraceByName("my-entity.out_double", "output"); atracer.addSignalToTraceByName("my-entity.out_double", "output");
/// Add trace by name /// Add trace by name
SignalBase<int> &aSignal = entity.getSignal("out2double"); SignalBase<int> &out_double = entity.getSignal("out_double");
SignalBase<int> &out_double_2 = entity.getSignal("out2double");
entity.m_sigdTwoTimeDepSOUT.recompute(2); Signal<double, int> &in_double =
Signal<double, int> &aSignalInt =
*(dynamic_cast<Signal<double, int> *>(&entity.getSignal("in_double"))); *(dynamic_cast<Signal<double, int> *>(&entity.getSignal("in_double")));
aSignalInt.setConstant(1.5); in_double.setConstant(1.5);
atracer.start(); atracer.start();
atracer.trace();
std::string emptybuf_cmd_str("empty"); std::string emptybuf_cmd_str("empty");
command::Command *acmd = atracer.getNewStyleCommand(emptybuf_cmd_str); command::Command *acmd = atracer.getNewStyleCommand(emptybuf_cmd_str);
acmd->execute(); acmd->execute();
for (int i = 0; i < 1000; i++) { for (int i = 0; i < 1000; i++) {
aSignal.setTime(i); in_double.setTime(i);
aSignalInt.setTime(i); out_double.recompute(i);
out_double_2.recompute(i);
atracer.recordTrigger(i, i); atracer.recordTrigger(i, i);
} }
output_test_stream output; output_test_stream output;
atracer.display(output); atracer.display(output);
atracer.stop(); atracer.stop();
atracer.trace();
atracer.clearSignalToTrace(); atracer.clearSignalToTrace();
atracer.closeFiles(); atracer.closeFiles();
acmd->execute(); acmd->execute();
...@@ -105,5 +106,5 @@ BOOST_AUTO_TEST_CASE(test_tracer) { ...@@ -105,5 +106,5 @@ BOOST_AUTO_TEST_CASE(test_tracer) {
"TracerRealTime my-tracer [mode=play] : \n" "TracerRealTime my-tracer [mode=play] : \n"
" - Dep list: \n" " - Dep list: \n"
" -> MyEntity(my-entity)::input(double)::out_double (in output)" " -> MyEntity(my-entity)::input(double)::out_double (in output)"
" [0Mo/1Mo] \n")); " [9Ko/16Ko] \n"));
} }
Supports Markdown
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