Update of /cvsroot/boost-sandbox/boost-sandbox/libs/thread_safe_signals/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20668
Modified Files:
track_test.cpp
Log Message:
Make tracking of double argument less meaningless by passing reference
instead of copy.
Index: track_test.cpp
===================================================================
RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/thread_safe_signals/test/track_test.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- track_test.cpp 27 Feb 2007 21:19:25 -0000 1.1
+++ track_test.cpp 27 Feb 2007 22:24:33 -0000 1.2
@@ -8,6 +8,7 @@
// For more information, see http://www.boost.org
+#include <boost/ref.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/test/minimal.hpp>
#include <boost/thread_safe_signal.hpp>
@@ -74,7 +75,7 @@
// Test binding of a slot to another slot
{
boost::shared_ptr<int> shorty(new int(2));
- boost::slot<int (double)> other_slot(&myfunc, *shorty.get(), _1);
+ boost::slot<int (double)> other_slot(&myfunc, boost::cref(*shorty.get()), _1);
other_slot.track(shorty);
s1.connect(sig_type::slot_type(other_slot, 0.5).track(other_slot));
BOOST_CHECK(s1(3) == 2);
|