From 85fcf12f6b5b263aa82270239ad54da5145c30e8 Mon Sep 17 00:00:00 2001
From: Florent Lamiraux <florent@laas.fr>
Date: Fri, 18 Oct 2019 10:36:42 +0200
Subject: [PATCH] Add a test on plugging signals of type string

---
 tests/signal-ptr.cpp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/signal-ptr.cpp b/tests/signal-ptr.cpp
index dc8a0e6..959250f 100644
--- a/tests/signal-ptr.cpp
+++ b/tests/signal-ptr.cpp
@@ -86,3 +86,19 @@ BOOST_AUTO_TEST_CASE(normal_test) {
   sigPtrBRef.get(cout);
   cout << std::endl;
 }
+
+BOOST_AUTO_TEST_CASE (plug_signal_string)
+{
+  Signal<std::string, int> outSig("output");
+  SignalPtr<std::string, int> inSig (NULL, "input");
+
+  std::string str ("value");
+  outSig.setConstant(str);
+  inSig.plug (&outSig);
+  inSig.recompute(1);
+  std::ostringstream os;
+  inSig.get (os);
+  std::string res (os.str ());
+  // Note that a '\n' is added when passing through the signal
+  BOOST_CHECK (res == str);
+}
-- 
GitLab